From 3b0f2965073c07a10b32922405c3a67e00677902 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 27 Feb 2011 15:05:02 +0100 Subject: Add script to ignore .pc and tell dpkg-source unpatch the source See #591858. --- examples/gbp-configure-unpatched-source | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 examples/gbp-configure-unpatched-source (limited to 'examples') diff --git a/examples/gbp-configure-unpatched-source b/examples/gbp-configure-unpatched-source new file mode 100755 index 00000000..93e2cbea --- /dev/null +++ b/examples/gbp-configure-unpatched-source @@ -0,0 +1,52 @@ +#!/bin/bash +# +# +# Setup dpkg-source and git to unpatch the source after the build and ignore +# the .pc directory. + +GIT_EXCLUDE=.git/info/exclude +LOCAL_OPTIONS=debian/source/local-options + +help () +{ + cat << EOF >/dev/stdout +Modifies "$LOCAL_OPTIONS" and "$GIT_EXCLUDE" +to ignore .pc and unpatch the source after the build. +EOF + + exit $1 +} + + +case $1 in + -h|--help) + help 0 + ;; +esac + + +if [ ! -d .git ]; then + echo "Not the top of a git repository - aborting." + help 1 +fi + +if ! grep -qs '^3.*\(quilt\)' debian/source/format; then + echo "Not a source format 3 (quilt) package - aborting." + help 1 +fi + +if ! grep -qs '^unapply-patches' $LOCAL_OPTIONS; then + echo "Setting unapply-patches in $LOCAL_OPTIONS" + echo "unapply-patches" >> $LOCAL_OPTIONS + git add $LOCAL_OPTIONS + git commit -m "Unapply patches from source" $LOCAL_OPTIONS +else + echo "unapply-patches already configured" +fi + +if ! grep -qs "^\.pc/" $GIT_EXCLUDE; then + echo "Adding .pc/ to $GIT_EXCLUDE" + echo ".pc/" >> $GIT_EXCLUDE +else + echo "$GIT_EXCLUDE already configured" +fi -- cgit v1.2.3