[SCM] Debian packaging for sketch 3D line drawing software branch, master, updated. debian/0.2.183-1-2-gae6c7b3

David Bremner bremner at unb.ca
Sat Dec 18 00:11:03 UTC 2010


The following commit has been merged in the master branch:
commit ae6c7b31cd1373d1696ca2d61accbb93a386035a
Author: David Bremner <bremner at unb.ca>
Date:   Fri Dec 17 19:58:03 2010 -0400

    Updated export-patches.sh so that it takes pairs of refs from a recipe
    file and interpolates the current debian version.

diff --git a/debian/export-patches.sh b/debian/export-patches.sh
index 39d2255..6046268 100644
--- a/debian/export-patches.sh
+++ b/debian/export-patches.sh
@@ -1,19 +1,42 @@
-# export patches from a tag named after the Debian Version
+#!/bin/sh
+# export patches according to a recipe in debian/git-patches
 # To use as a hook in gitpkg, 
 #   git config gitpkg.deb-export-hook debian/export-patches.sh
 
-PATCH_TAG=patches/$(dpkg-parsechangelog | sed -n 's/^Version: \(.*:\|\)\(.*\)/\2/p')
+# make this configable?
+recipe=debian/git-patches
 
 export GIT_DIR
 if [ -n "$REPO_DIR" ]; then
-   GIT_DIR=$REPO_DIR/.git
+    GIT_DIR=$REPO_DIR/.git
+else
+    # support running as a free-standing script, without gitpkg
+    DEB_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*:\|\)\(.*\)/\2/p')
 fi;
 
-if git rev-parse ${PATCH_TAG} >/dev/null 2>&1; then 
-    echo exporting patches from ${PATCH_TAG} 
+tmpdir=$(mktemp -d patches.XXXXXXX)
+echo "# Patches exported from git by gitpkg-export-patches" > $tmpdir/series
+
+sed s/%DEB_VERSION%/${DEB_VERSION}/g  < $recipe |
+while read -r base tip
+do
+    case $base in
+	\#*)
+	    ;;
+	*)
+	    count=$(wc -l $tmpdir/series | cut -f1 -d' ')
+	    PATCHES=$(git format-patch --start-number $count -N -o $tmpdir $base...$tip)
+	    echo $PATCHES | sed -e "s%$tmpdir/%%g" -e 's% %\n%g'>> $tmpdir/series
+    esac
+done
+
+count=$(wc -l $tmpdir/series | cut -f1 -d' ')
+
+if [ $count -gt 1 ]; then
     rm -rf debian/patches
-    PATCHES=`git format-patch -N -o debian/patches HEAD...$PATCH_TAG`
-    echo $PATCHES | sed -e 's%debian/patches/%%g' -e 's% %\n%g'> debian/patches/series
-else 
-    echo No patch tag/branch ${PATCH_TAG}; 
-fi 
+    mv $tmpdir debian/patches
+else
+    echo "No patches found: debian/patches left untouched"
+    rm -rf $tmpdir
+fi
+

-- 
Debian packaging for sketch 3D line drawing software



More information about the debian-science-commits mailing list