Skip to content

Instantly share code, notes, and snippets.

@bhundven

bhundven/.bash_functions

Last active Aug 29, 2015
Embed
What would you like to do?
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