[pkg-perl-tools] 02/04: pristine-orig: honour USCAN_DESTRIR from devscripts' configuration

Damyan Ivanov dmn at moszumanska.debian.org
Sun Dec 3 21:32:29 UTC 2017


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

dmn pushed a commit to branch master
in repository pkg-perl-tools.

commit efddd55481f832adf237ccc1b7b572b7fc131731
Author: Damyan Ivanov <dmn at debian.org>
Date:   Sun Dec 3 11:08:03 2017 +0000

    pristine-orig: honour USCAN_DESTRIR from devscripts' configuration
---
 bin/pristine-orig | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/bin/pristine-orig b/bin/pristine-orig
index 04876bf..e820a89 100755
--- a/bin/pristine-orig
+++ b/bin/pristine-orig
@@ -6,9 +6,19 @@ set -u
 PKG=`dpkg-parsechangelog --show-field Source`
 VER=`dpkg-parsechangelog --show-field Version | sed 's,^[0-9]\+:,,; s,-[^-]\+$,,'`
 
+if [ -f /etc/devscripts.conf ]; then
+    . /etc/devscripts.conf
+fi
+
+if [ -f ~/.devscripts ]; then
+    . ~/.devscripts
+fi
+
+ORIG_DIR=${USCAN_DESTDIR:-..}
+
 GOT_ONE=
 for c in gz bz2 xz; do
-    if pristine-tar checkout ../${PKG}_${VER}.orig.tar.$c 2>/dev/null; then
+    if pristine-tar checkout ${ORIG_DIR}/${PKG}_${VER}.orig.tar.$c 2>/dev/null; then
         GOT_ONE=$c
         break
     fi
@@ -17,10 +27,10 @@ done
 if [ -z "$GOT_ONE" ]; then
     # repeat, with error reporting enabled
     for c in gz bz2 xz; do
-        pristine-tar checkout ../${PKG}_${VER}.orig.tar.$c
+        pristine-tar checkout ${ORIG_DIR}/${PKG}_${VER}.orig.tar.$c
     done
 else
-    echo ../${PKG}_${VER}.orig.tar.$GOT_ONE ready
+    echo ${ORIG_DIR}/${PKG}_${VER}.orig.tar.$GOT_ONE ready
 fi
 
 exit 0
@@ -39,13 +49,17 @@ pristine-orig -- acquire upstream source of the current package version
 B<pristine-orig> checks the current package name via F<debian/control>
 and the current package version from F<debian/changelog> and calls
 L<pristine-tar(1)> with the right file name so that you get a pristine
-upstream source tarball in the parent directory.
+upstream source tarball ready.
 
 It tries gzip, bzip2 and xz compression suffices.
 
+The tarball is placed in the C<USCAN_DESTDIR> directory (configured via
+L<devscripts.conf(5)>, see L<uscan(1)>), or in the parent directory if no
+C<USCAN_DESTDIR> is configured.
+
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2011 Damyan Ivanov <dmn at debian.org>
+Copyright (c) 2011, 2017 Damyan Ivanov <dmn at debian.org>
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.

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



More information about the Pkg-perl-cvs-commits mailing list