[DRE-commits] [ruby-json] 01/10: Repack tarball for 2.0.1 to avoid non-DFSG RFC

Lucas Nussbaum lucas at moszumanska.debian.org
Thu Jul 21 21:28:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

lucas pushed a commit to branch master
in repository ruby-json.

commit 8fce742ca3c84469527b37fe9a65295e51bbecf8
Author: Lucas Nussbaum <lucas at debian.org>
Date:   Thu Jul 21 23:00:42 2016 +0200

    Repack tarball for 2.0.1 to avoid non-DFSG RFC
---
 debian/repack.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
 debian/watch     |  4 +++-
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/debian/repack.sh b/debian/repack.sh
new file mode 100755
index 0000000..fd20408
--- /dev/null
+++ b/debian/repack.sh
@@ -0,0 +1,43 @@
+#!/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+dfsg"
+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"
+
+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 undistributable files from source.
+rm -vfr $UP_BASE/references/rfc7159.txt
+## End
+
+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 repackaged"
+
diff --git a/debian/watch b/debian/watch
index 7ce27ed..a9ca289 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,4 @@
 version=3
-http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/json .*/json-(.*).tar.gz
+opts=dversionmangle=s/\+dfsg// \
+http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/json .*/json-(.*).tar.gz \
+debian debian/repack.sh

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-json.git



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