[devscripts] 04/05: uscan: Add support for a repacksuffix option in watch files
James McCoy
jamessan at debian.org
Sun Sep 21 01:48:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch master
in repository devscripts.
commit a92e313f0fa4ab0deb2144a18460d4b68dd6616f
Author: James McCoy <jamessan at debian.org>
Date: Sat Sep 20 21:39:22 2014 -0400
uscan: Add support for a repacksuffix option in watch files
The recommended mechanism for specifying how the upstream version should
be adjusted when upstream sources are modified was to use
uversionmangle. However, that's conflating two unrelated parts of
uscan's task. The new repacksuffix option provides a clear means for
doing this without interfering with other functionality.
Closes: #753772
Signed-off-by: James McCoy <jamessan at debian.org>
---
debian/changelog | 6 ++++++
scripts/uscan.1 | 5 +++++
scripts/uscan.pl | 4 ++++
test/test_uscan | 12 +++++++-----
4 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 8f1be07..10f089e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,12 @@ devscripts (2.14.7) UNRELEASED; urgency=low
* grep-excuses: Remove useless call to “hostname --fqdn”. (Closes: #758668)
* build-rdeps: Recognize arch-qualified package names. Thanks to Stuart
Prescott for the patch. (Closes: #757807)
+ * uscan:
+ + Consistently pass the path to the downloaded (and possibly
+ renamed/symlinked/…) file as an argument to the watch file's action
+ command.
+ + Add support for a repacksuffix option to the watch file. This is passed
+ through to mk-origtargz. (Closes: #753772)
* mk-origtargz: Add a --repack-suffix option to adjust the upstream version
when the upstream sources are modified (e.g., due to Files-Excluded).
diff --git a/scripts/uscan.1 b/scripts/uscan.1
index 8594560..215e0f9 100644
--- a/scripts/uscan.1
+++ b/scripts/uscan.1
@@ -296,6 +296,11 @@ by a key found in the keyring \fBdebian/upstream/signing-key.pgp\fR or
the armored keyring \fBdebian/upstream/signing-key.asc\fR. If it is not
valid, or not made by one of the listed keys, uscan will report an
error.
+.TP
+\fBrepacksuffix=\fIsuffix\fR
+If the upstream sources are modified because \fBdebian/copyright\fR contains
+the \fBFiles-Excluded\fR field, \fIsuffix\fR will be appended to the upstream
+version of the repacked tar archive.
.SH "Directory name checking"
Similarly to several other scripts in the \fBdevscripts\fR package,
\fBuscan\fR explores the requested directory trees looking for
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 18739af..728acd1 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -790,6 +790,9 @@ sub process_watchline ($$$$$$)
or $opt eq 'nopassive') {
$options{'pasv'}=0;
}
+ elsif ($opt =~ /^repacksuffix\s*=\s*(.+)/) {
+ $options{'repacksuffix'} = $1;
+ }
elsif ($opt =~ /^uversionmangle\s*=\s*(.+)/) {
@{$options{'uversionmangle'}} = split /;/, $1;
}
@@ -1474,6 +1477,7 @@ EOF
my @cmd = ("mk-origtargz");
push @cmd, "--package", $pkg;
push @cmd, "--version", $newversion;
+ push @cmd, '--repack-suffix', $options{repacksuffix} if defined $options{repacksuffix};
push @cmd, "--rename" if $symlink eq "rename";
push @cmd, "--copy" if $symlink eq "copy";
push @cmd, "--repack" if $repack;
diff --git a/test/test_uscan b/test/test_uscan
index e6c19a1..ff04cef 100755
--- a/test/test_uscan
+++ b/test/test_uscan
@@ -172,7 +172,7 @@ helperCreateRepo () {
cat <<END > $PKG/debian/watch
version=3
-http://localhost:$PORT/$PKG-(\d).tar.gz
+${OPTS}http://localhost:$PORT/$PKG-(\d).tar.gz
END
cat <<END > $PKG/debian/changelog
@@ -231,6 +231,7 @@ testFileExclusion() {
(
cd $TMPDIR
+ OPTS="opts=repacksuffix=+dfsg1 "
helperCreateRepo
cd repo
tar cfz $PKG-1.tar.gz * .hidden
@@ -239,7 +240,7 @@ testFileExclusion() {
(cd $TMPDIR/$PKG ; $COMMAND)
- TARBALL=${PKG}_1.orig.tar.gz
+ TARBALL=${PKG}_1+dfsg1.orig.tar.gz
assertTrue 'downloaded tarfile not present' "[ -f $TMPDIR/${PKG}-1.tar.gz ]"
assertTrue 'pristine tarball is not created' "[ -f $TMPDIR/$TARBALL ]"
assertFalse 'pristine tarball is a symlink (nothing repacked?)' "[ -L $TMPDIR/$TARBALL ]"
@@ -262,6 +263,7 @@ testFileExclusionSeparateDir() {
(
cd $TMPDIR
+ OPTS="opts=repacksuffix=+dfsg1 "
helperCreateRepo
cd repo
tar cfz $PKG-1.tar.gz * .hidden
@@ -273,7 +275,7 @@ testFileExclusionSeparateDir() {
cd $TMPDIR/otherdir; $COMMAND --package $PKG --force-download --upstream-version 1 --watchfile ../$PKG/debian/watch --copyright-file ../$PKG/debian/copyright
)
- TARBALL=${PKG}_1.orig.tar.gz
+ TARBALL=${PKG}_1+dfsg1.orig.tar.gz
assertTrue 'downloaded tarfile not present' "[ -f $TMPDIR/${PKG}-1.tar.gz ]"
assertTrue 'pristine tarball is not created' "[ -f $TMPDIR/$TARBALL ]"
assertFalse 'pristine tarball is a symlink (nothing repacked?)' "[ -L $TMPDIR/$TARBALL ]"
@@ -300,7 +302,7 @@ testFileExclusionZipToTar() {
helperCreateRepo
cat <<END > $PKG/debian/watch
version=3
-http://localhost:$PORT/$PKG-(\d).zip
+opts=repacksuffix=+dfsg1 http://localhost:$PORT/$PKG-(\d).zip
END
cd repo
@@ -310,7 +312,7 @@ END
(cd $TMPDIR/$PKG ; $COMMAND --repack)
- TARBALL=${PKG}_1.orig.tar.xz
+ TARBALL=${PKG}_1+dfsg1.orig.tar.xz
assertTrue 'unrepacked zipfile not present' "[ -f $TMPDIR/${PKG}-1.zip ]"
assertTrue 'pristine tarball is not created' "[ -f $TMPDIR/$TARBALL ]"
assertNotNull 'pristine tarball is not xz-compressed' \
--
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