[Pkg-gdb-logs] [gdb] 01/06: d/sanitize-gdb.sh: Don't assume input is .tar.bz2

Samuel Bronson naesten-guest at moszumanska.debian.org
Tue Aug 26 00:43:15 UTC 2014


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

naesten-guest pushed a commit to branch master
in repository gdb.

commit 26bb51effbca08f91883b6a786c9a38b50f805c5
Author: Samuel Bronson <naesten at gmail.com>
Date:   Sat Aug 23 15:02:23 2014 -0400

    d/sanitize-gdb.sh: Don't assume input is .tar.bz2
---
 debian/sanitize-gdb.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/debian/sanitize-gdb.sh b/debian/sanitize-gdb.sh
index 8380966..0830aa8 100644
--- a/debian/sanitize-gdb.sh
+++ b/debian/sanitize-gdb.sh
@@ -10,9 +10,9 @@ fi
 
 tardir=$(dirname "$tarball")
 tardir=$(cd "$tardir" && pwd)
-version=$(basename "$tarball" | sed "s/^gdb-//; s/\.tar\.bz2\$//")
+version=$(basename "$tarball" | sed "s/^gdb-//; s/\.tar\.\(gz\|xz\|bz2\)\$//")
 debversion=${version}
-tarball="$tardir"/gdb-$version.tar.bz2
+tarball="$tardir"/$(basename "$tarball")
 dfsg="$tardir/gdb_$debversion.orig.tar.xz"
 doc="$tardir/gdb-doc_$version.orig.tar.xz"
 
@@ -68,7 +68,16 @@ done
 popd > /dev/null
 
 tar --auto-compress -cf "$dfsg" gdb-$debversion
-bzcat "$tarball" | xz > "$doc"
 
+case "$tarball" in
+    *.xz)       cp "$tarball" "$doc"            ;;
+    *.bz2)      bzcat "$tarball" | xz > "$doc"  ;;
+    *.gz)       zcat "$tarball"  | xz > "$doc"  ;;
+    *)
+        echo "wtf is: $tarball"
+        ;;
+esac
+
+# XXX maybe we should install this as an exit handler?
 cd "$olddir"
 rm -rf $temp

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



More information about the Pkg-gdb-logs mailing list