r30341 - /trunk/libxml-bare-perl/debian/repack.sh
antonio-guest at users.alioth.debian.org
antonio-guest at users.alioth.debian.org
Sat Jan 31 18:02:07 UTC 2009
Author: antonio-guest
Date: Sat Jan 31 18:02:03 2009
New Revision: 30341
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30341
Log:
added repack.sh
Added:
trunk/libxml-bare-perl/debian/repack.sh (with props)
Added: trunk/libxml-bare-perl/debian/repack.sh
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-bare-perl/debian/repack.sh?rev=30341&op=file
==============================================================================
--- trunk/libxml-bare-perl/debian/repack.sh (added)
+++ trunk/libxml-bare-perl/debian/repack.sh Sat Jan 31 18:02:03 2009
@@ -1,0 +1,69 @@
+#!/bin/sh
+# Repackage upstream source to exclude non-distributable files
+# 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 "\nRepackaging $FILE\n"
+
+REPACKED_ORIG=`echo $FILE | sed 's/\.orig\./+dfsg.1.orig./'`
+
+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"
+tar xzf "$FILE" -C "$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
+
+## Remove stuff
+
+# remove rfc1320.txt
+rm -v $UP_BASE/bench/src/barexml.c \
+ $UP_BASE/bench/src/ezxml_main.c \
+ $UP_BASE/bench/src/tinyxml.cpp \
+ $UP_BASE/bench/src/xmlio_testread.cpp \
+ $UP_BASE/bench/exe.tmpl \
+ $UP_BASE/bench/tree.tmpl \
+ $UP_BASE/bench/notree.tmpl \
+ $UP_BASE/bench/feed2.xml \
+ $UP_BASE/bench/test.xml \
+
+# delete lines referencing removed files from MANIFEST
+sed -i '\,bench/src/barexml.c, D' $UP_BASE/MANIFEST
+sed -i '\,bench/src/ezxml_main.c, D' $UP_BASE/MANIFEST
+sed -i '\,bench/src/tinyxml.cpp, D' $UP_BASE/MANIFEST
+sed -i '\,bench/src/xmlio_testread.cpp, D' $UP_BASE/MANIFEST
+sed -i '\,bench/exe.tmpl, D' $UP_BASE/MANIFEST
+sed -i '\,bench/tree.tmpl, D' $UP_BASE/MANIFEST
+sed -i '\,bench/notree.tmpl, D' $UP_BASE/MANIFEST
+sed -i '\,bench/feed2.xml, D' $UP_BASE/MANIFEST
+sed -i '\,bench/test.xml, D' $UP_BASE/MANIFEST
+## End
+
+# remove the dir, it should be empty
+rmdir $UP_BASE/bench/src
+rmdir $UP_BASE/bench
+
+mv "$UP_BASE" "$DIR/$REPACK_DIR"
+
+# Using a pipe hides tar errors!
+tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
+gzip -9 -n < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz"
+
+mv "$DIR/repacked.tar.gz" "$REPACKED_ORIG"
+
+echo "*** $REPACKED_ORIG ready"
Propchange: trunk/libxml-bare-perl/debian/repack.sh
------------------------------------------------------------------------------
svn:executable = *
More information about the Pkg-perl-cvs-commits
mailing list