aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-02-27 15:05:02 +0100
committerGuido Günther <agx@sigxcpu.org>2011-02-27 15:15:50 +0100
commit3b0f2965073c07a10b32922405c3a67e00677902 (patch)
tree8b5ebdee3a4ba676a2c8f96382814ce957736446 /examples
parenta618bdcf4149443d5b68132e96b5a15b52fc3f05 (diff)
Add script to ignore .pc and tell dpkg-source unpatch the source
See #591858.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/gbp-configure-unpatched-source52
1 files changed, 52 insertions, 0 deletions
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