Skip to content

Instantly share code, notes, and snippets.

@bhundven
Last active August 29, 2015 14:04
Show Gist options
  • Save bhundven/0abb68d2a33b7454bb01 to your computer and use it in GitHub Desktop.
Save bhundven/0abb68d2a33b7454bb01 to your computer and use it in GitHub Desktop.
Handy way to add patches to quilt.
# vi: ts=4:sw=4:et:ai:ft=sh
quilt-add-patch ()
{
dir=$1;shift
patch_file=$1;shift
quilt new $(basename ${patch_file} | sed -e 's/\.diff//' | sed -e 's/\.patch//')
quilt add $(awk '/^---/{ print $2 }' "${dir}/${patch_file}" | sed -e 's/a\///')
patch -p1 < "${dir}/${patch_file}"
quilt refresh
}
quilt-add-series ()
{
series_file=${1};shift
for patch_file in $(cat ${series_file}); do
quilt-add-patch $(dirname ${series_file}) $(basename ${patch_file})
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment