[Python-modules-commits] r3943 - in packages/python-processing/trunk/debian (2 files)
bzed at users.alioth.debian.org
bzed at users.alioth.debian.org
Thu Dec 13 23:51:48 UTC 2007
Date: Thursday, December 13, 2007 @ 23:51:46
Author: bzed
Revision: 3943
debian/uscan-ziprepack.sh - please try & use it.
Added:
packages/python-processing/trunk/debian/uscan-ziprepack.sh
Modified:
packages/python-processing/trunk/debian/watch
Added: packages/python-processing/trunk/debian/uscan-ziprepack.sh
===================================================================
--- packages/python-processing/trunk/debian/uscan-ziprepack.sh (rev 0)
+++ packages/python-processing/trunk/debian/uscan-ziprepack.sh 2007-12-13 23:51:46 UTC (rev 3943)
@@ -0,0 +1,49 @@
+#!/bin/bash -e
+
+# Simple helper-script for uscan to repackage a .zip file into a tar.gz.
+#
+# Example debian/watch content:
+# version=3
+# http://foo.bar.com/fuzz/fuddl-(.*).zip debian debian/uscan-ziprepack.sh
+#
+# I hereby put this script into public domain.
+# Bernd Zeimetz <bzed at debian.org>, Dec 13 2007
+
+
+#command --upstream-version version filename
+[ $# -eq 3 ] || exit 255
+version="$2"
+filename="$3"
+source=`dpkg-parsechangelog | grep ^Source | awk '{print $2}'`
+destdir=`echo ${filename} | sed 's,/[^/]*$,,'`
+if [ "${destdir}" = "${filename}" ]; then
+ destdir=`pwd`
+fi
+tarball=${source}_${version}.orig.tar.gz
+TMP="tmp__${RANDOM}"
+
+mkdir ${TMP}
+unzip -d ${TMP} ${filename}
+
+
+contentcount=`ls ${TMP} | grep -c '[^*$]'`
+if [ ${contentcount} -eq 1 ]; then
+#if there's only one folder in the temp directory....
+ cd ${TMP}
+ tar cvf - * | gzip -9 > ../${tarball}
+ cd ..
+ rm -rf ${TMP}
+elif [ ${contentcount} -gt 1 ]; then
+#upstream forgot to add a subdir to the zip
+ mv ${TMP} ${source}-${version}.orig
+ tar cvf - ${source}-${version}.orig | gzip -9 > ${tarball}
+else
+#weird.
+ echo 'Empty zip file or an weird error happened.'
+ unzip -l ${filename}
+ exit 255
+fi
+
+mv ${tarball} ${destdir}
+echo "Tarball dropped to ${destdir}/${tarball}"
+
Property changes on: packages/python-processing/trunk/debian/uscan-ziprepack.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: packages/python-processing/trunk/debian/watch
===================================================================
--- packages/python-processing/trunk/debian/watch 2007-12-13 22:53:18 UTC (rev 3942)
+++ packages/python-processing/trunk/debian/watch 2007-12-13 23:51:46 UTC (rev 3943)
@@ -1,4 +1,3 @@
version=3
-
-http://pypi.python.org/packages/source/p/processing/processing-(.*)\.zip
+http://pypi.python.org/packages/source/p/processing/processing-(.*)\.zip debian debian/uscan-repack.sh
More information about the Python-modules-commits
mailing list