[devscripts] 03/04: uupdate: work around missing debian.tar.xz etc.

Osamu Aoki osamu at moszumanska.debian.org
Sat Sep 12 16:03:38 UTC 2015


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

osamu pushed a commit to branch master
in repository devscripts.

commit a0477dfa2b9ef3ffba3431f7d5f65d8e65f874fb
Author: Osamu Aoki <osamu at debian.org>
Date:   Tue Sep 8 16:27:01 2015 +0000

    uupdate: work around missing debian.tar.xz etc.
    
    https://bugs.debian.org/798133
    Work around with missing debian.tar.xz
    
    https://bugs.debian.org/350454
    [uscan] please offer debugging possibility for mangle rules
    
     * work around missing debian.tar.xz
       This makes our life easy to use uupdate
       from VCS checkout directory.
    
     * add --verbose option to cope with uscan
       Some message adjustments.
---
 scripts/uupdate.1  |  3 +++
 scripts/uupdate.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/scripts/uupdate.1 b/scripts/uupdate.1
index 41c86ca..e795d4d 100644
--- a/scripts/uupdate.1
+++ b/scripts/uupdate.1
@@ -72,6 +72,9 @@ Simply create a symlink when moving a new upstream \fI.tar.gz\fR
 archive to the new \fI<package>_<version>.orig.tar.gz\fR location.
 This is the default behaviour.
 .TP
+.B \-\-verbose
+Give verbose output.
+.TP
 \fB\-\-no\-symlink\fR
 Copy the upstream \fI.tar.gz\fR to the new location instead of making
 a symlink.
diff --git a/scripts/uupdate.sh b/scripts/uupdate.sh
index 759d497..30da3fb 100755
--- a/scripts/uupdate.sh
+++ b/scripts/uupdate.sh
@@ -63,6 +63,7 @@ Options are:
    --no-conf, --noconf
                       Don't read devscripts config files;
                       must be the first option given
+   --verbose          Give verbose output
 
 $PROGNAME [--help|--version]
   show this message or give version information.
@@ -173,6 +174,7 @@ TEMP=$(getopt -s bash -o v:p:r:ubs \
 	--long pristine,no-pristine,nopristine \
 	--long symlink,no-symlink,nosymlink \
 	--long no-conf,noconf \
+	--long verbose \
 	--long help,version -n "$PROGNAME" -- "$@") || (usage >&2; exit 1)
 
 eval set -- $TEMP
@@ -197,6 +199,8 @@ while [ "$1" ]; do
     --no-conf|--noconf)
 	echo "$PROGNAME: $1 is only acceptable as the first command-line option!" >&2
 	exit 1 ;;
+    --verbose)
+	UUPDATE_VERBOSE=yes ;;
     --help) usage; exit 0 ;;
     --version) version; exit 0 ;;
     --)	shift; break ;;
@@ -237,12 +241,26 @@ mustsetvar VERSION "`dpkg-parsechangelog -SVersion`" "source version"
 # Get epoch and upstream version
 eval `echo "$VERSION" | perl -ne '/^(?:(\d+):)?(.*)/; print "SVERSION=$2\nEPOCH=$1\n";'`
 
-UVERSION=`expr "$SVERSION" : '\(.*\)-[0-9a-zA-Z.+~]*$'`
+if [ -n "$UUPDATE_VERBOSE" ]; then
+    echo "PATCH       = \"$PATCH\" is the name of the patch file" >&2
+    echo "ARCHIVE     = \"$ARCHIVE\" is the name of the next tarball" >&2
+    echo "NEW_VERSION = \"$NEW_VERSION\" is the next pristine tarball version (oversionmangled)" >&2
+    echo "PACKAGE     = \"$PACKAGE\" is in the top of debian/changelog" >&2
+    echo "VERSION     = \"$VERSION\" is in the top of debian/changelog" >&2
+    echo "EPOCH       = \"$EPOCH\" is epoch part of \$VERSION" >&2
+    echo "SVERSION    = \"$SVERSION\" is w/o-epoch part of \$VERSION" >&2
+fi
+
+UVERSION=`expr "$SVERSION" : '\(.*\)-[0-9a-zA-Z.+~]*$'` || true
 if [ -z "$UVERSION" ]; then
     echo "$PROGNAME: a native Debian package cannot take upstream updates" >&2
     exit 1
 fi
 
+if [ -n "$UUPDATE_VERBOSE" ]; then
+    echo "UVERSION    = \"$UVERSION\" the upstream portion w/o-epoch of \$VERSION" >&2
+fi
+
 # Save pwd before we goes walkabout
 OPWD=`pwd`
 
@@ -723,6 +741,24 @@ else
 	DIFF="../${PACKAGE}_$SVERSION.debian.tar.xz"
 	DIFFTYPE=tar
 	DIFFUNPACK="tar --xz -xf"
+    else
+	# non-native package with $SVERSION in <version>-<revision> format
+	# missing diff.gz/debian.tar.xz, make it with $OPWD/debian/*
+	# force to update next version to 3.0 (quilt)
+	cd $OPWD
+	if [ ! -d debian ]; then
+	    echo "$PROGNAME: None of *.diff.gz, *.debian.tar.xz, or debian/* found. failed;" >&2
+	    echo "aborting..." >&2
+	    exit 1
+	fi
+	mkdir -p debian/source
+	echo "3.0 (quilt)" > debian/source/format
+	tar --xz -cf ../${PACKAGE}_$SVERSION.debian.tar.xz debian
+	# return back to upstream source
+	cd ../$PACKAGE-$SNEW_VERSION
+	DIFF="../${PACKAGE}_$SVERSION.debian.tar.xz"
+	DIFFTYPE=tar
+	DIFFUNPACK="tar --xz -xf"
     fi
 
     if [ "$DIFFTYPE" = diff ]; then
@@ -825,6 +861,9 @@ else
 	    echo "to debian.upstream/ and use the Debian version" >&2
 	    mv debian debian.upstream
 	fi
+	if [ -n "$UUPDATE_VERBOSE" ]; then
+	    echo "-- Use ${DIFF} to create the new debian/ directory." >&2
+	fi
 	if $DIFFUNPACK $DIFF; then
 	    echo "Unpacking the debian/ directory from version $VERSION worked fine."
 	else
@@ -835,8 +874,13 @@ else
 	echo "$PROGNAME: could not find {diff|debian.tar}.{gz|bz2|lzma|xz} from version $VERSION to apply!" >&2
 	exit 1
     fi
-    chmod a+x debian/rules
-    debchange -v "$NEW_VERSION-$SUFFIX" New upstream release
+    if [ -f debian/rules ]; then
+	chmod a+x debian/rules
+    fi
+    if [ -n "$UUPDATE_VERBOSE" ]; then
+	echo "-- New upstream release=$NEW_VERSION-$SUFFIX" >&2
+    fi
+    debchange -v "$NEW_VERSION-$SUFFIX" "New upstream release"
     echo "Remember: Your current directory is the OLD sourcearchive!"
     echo "Do a \"cd ../$PACKAGE-$SNEW_VERSION\" to see the new package"
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list