[DRE-commits] r4869 - trunk/redmine-plugin-botsfilter/debian

Jérémy Lal kapouer-guest at alioth.debian.org
Tue Mar 2 21:07:59 UTC 2010


Author: kapouer-guest
Date: 2010-03-02 21:07:55 +0000 (Tue, 02 Mar 2010)
New Revision: 4869

Added:
   trunk/redmine-plugin-botsfilter/debian/repack.sh
Modified:
   trunk/redmine-plugin-botsfilter/debian/watch
Log:
Repack : upstream is zip file.

Added: trunk/redmine-plugin-botsfilter/debian/repack.sh
===================================================================
--- trunk/redmine-plugin-botsfilter/debian/repack.sh	                        (rev 0)
+++ trunk/redmine-plugin-botsfilter/debian/repack.sh	2010-03-02 21:07:55 UTC (rev 4869)
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Repackage upstream source to get a proper tar.gz instead of a zip file
+# should be called as "repack.sh --upstream-source <ver> <downloaded file>
+# (for example, via uscan)
+ 
+set -e
+set -u
+ 
+VER="$2"
+FILE="$3"
+PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`
+ 
+REPACK_DIR="$PKG-$VER.orig" # DevRef § 6.7.8.2
+ 
+echo -e "\Recompressing $FILE\n"
+ 
+DIR=`mktemp -d ./tmpRepackXXXXXX`
+trap "rm -rf \"$DIR\"" QUIT INT EXIT
+ 
+# Create an extra directory to cope with rootless tarballs
+UP_BASE="$DIR/unpack"
+mkdir "$UP_BASE"
+unzip "$FILE" -d "$UP_BASE"
+ 
+if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then
+        # Tarball does contain a root directory
+        UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`"
+fi
+ 
+mv "$UP_BASE" "$DIR/$REPACK_DIR"
+ 
+# Using a pipe hides tar errors!
+tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
+gzip -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz"
+FILE="../${PKG}_${VER}.orig.tar.gz"
+mv "$DIR/repacked.tar.gz" "$FILE"
+ 
+echo "*** $FILE recompressed"

Modified: trunk/redmine-plugin-botsfilter/debian/watch
===================================================================
--- trunk/redmine-plugin-botsfilter/debian/watch	2010-03-02 15:42:27 UTC (rev 4868)
+++ trunk/redmine-plugin-botsfilter/debian/watch	2010-03-02 21:07:55 UTC (rev 4869)
@@ -1,2 +1,2 @@
 version=3
-http://www.redmine.org/wiki/redmine/PluginBotsFilter .*/redmine_bots_filter_([\d\.]*).zip debian uupdate
+http://www.redmine.org/wiki/redmine/PluginBotsFilter .*/redmine_bots_filter_([\d\.]*).zip debian /bin/sh debian/repack.sh




More information about the Pkg-ruby-extras-commits mailing list