Patches

Table of contents

  1. Patches
    1. Creation
      1. git artifacts
    2. Maintenance
    3. Deletion

How the Debian Kubernetes Team copes with patches.

Where patches are changes to get upstream source build into Debian policy compliant package.


Creation

Some git command TODO

Decide on report upstream. If so, do so!

git artifacts

Example “git artifact” in patches:

diff --git a/staging/src/k8s.io/kubectl/sourcefile.go b/staging/src/k8s.io/kubectl/sourcefile.go
index 63aa86b..01a13bc 100644

We try to keep them when upstream got the patch with the git artifacts. When minimal diff becomes a hassle during maintenance, we drop them because quilt refresh can not recreate them.

Update debian/patches/series.

Something like git add debian/patches/, verify with git status and/or git diff --staged.

And when fine git commit.


Maintenance

Before you execute quilt push, quilt pop and quilt refresh commands, you want this in your shell environment:

## Where are the patches located?
export QUILT_PATCHES=debian/patches
## Some settings for keeping changes small upon updating patches
export QUILT_DIFF_ARGS="-p ab --no-index --no-timestamps"
export QUILT_REFRESH_ARGS="-p ab --no-index --no-timestamps"
export QUILT_DIFF_OPTS="--show-c-function"
## to avoid those environment settings get overwritten
## ( quilt does "source /etc/quilt.quiltrc" in each run )
alias quilt="quilt --quiltrc=/dev/null"

The updated patch goes into the git repository. We try to keep the diff minimal.

This snippet helps to get to such a minimal diff:

git diff -- ':(exclude)debian'

(Use git diff -- . ':(exclude)debian', note the ., when your git version is older as version 2.13.)


Deletion

Obviously the counter part of Creation.

git rm -f debian/patches/file_name_of.patch

$EDITOR debian/patches/series

git add debian/patches/series

git commit