Skip to content

Creating and Managing Patches

Luke Horwell edited this page Aug 15, 2023 · 5 revisions

quilt is used for managing multiple patches. Here's a rough guide on using it.

Prerequisites

  1. Clone this repository

    git clone https://github.com/lah7/gtk3-classic
    cd gtk3-classic
  2. Download and extract GTK's source code

    source PKGBUILD
    wget "https://download.gnome.org/sources/gtk+/${pkgver%.*}/gtk+-$_gtkver.tar.xz"
    tar -xJf gtk+-$_gtkver.tar.xz
  3. Tell quilt where the patches are stored

    cd gtk*
    export QUILT_PATCHES=../

New Patch

  1. Apply all existing patches first

    quilt push -a
    
  2. Create the patch - see existing patches for suggested naming convention.

    quilt new name_of_new.patch
    
  3. Tell quilt which file(s) you wish to change.

    quilt add gtk/gtkentry.c
    
  4. Modify the file(s)

  5. Confirm the diff looks good

    quilt diff
    
  6. Save the patch

    quilt refresh
    
  7. If this is to be proposed to our repository: Use git to commit, push to your fork and open a pull request.

Edit Patch

  1. Repeat this command until you reach the desired patch to modify.

    quilt push
    

    For a reminder where you are in the series:

    quilt series
    
  2. Modify the source code with the desired changes

  3. Save the changes

    quilt refresh
    
  4. If this is to be proposed to our repository: Use git to commit, push to your fork and open a pull request.

Cheatsheet

  1. Unpatch everything in source code

    quilt pop -a
    
  2. Patch everything in source code

    quilt push -a
    
  3. List all patches and current patch

    quilt series
    
  4. Refresh current patch. Useful for different GTK versions, but watch out for "fuzzy" changes as they could potentially be lost.

    quilt refresh
    

Further Reading