[devscripts] 05/06: uscan: update manpage for filenamemangle etc.
Osamu Aoki
osamu at moszumanska.debian.org
Sun Nov 8 14:49:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
osamu pushed a commit to branch multitar
in repository devscripts.
commit 8927b9294fa7d4a0be3c7df8b8fbd0f5ed38f3b6
Author: Osamu Aoki <osamu at debian.org>
Date: Sun Nov 8 17:39:43 2015 +0900
uscan: update manpage for filenamemangle etc.
---
scripts/uscan.pl | 41 ++++++++++++++++++++++++++---------------
1 file changed, 26 insertions(+), 15 deletions(-)
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 9569a36..17267a1 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -391,20 +391,23 @@ selecting the latest upstream version.
Syntactic shorthand for B<uversionmangle=>I<rules>B<, dversionmangle=>I<rules>
+=item B<downloadurlmangle=>I<rules>
+
+Convert the selected upstream tarball href string into the accessible URL for
+obfusicated web sites.
+
=item B<filenamemangle=>I<rules>
-Normalize the downloaded tarball filename string I<< <upkg>-<uversion>.tar.gz
->> from the selected href string.
+Generate the upstream tarball filename from the selected href string if
+I<matching-pattern> can extract the latest upstream version I<< <uversion> >>
+from the selected href string. Otherwise, generate the upstream tarball
+filename from its full URL string and set the missing I<< <uversion> >> from
+the generated upstream tarball filename.
-If this option doesn't exist, the default upstream tarball filename is found by
+Without this option, the default upstream tarball filename is generated by
taking the last component of the URL and removing everything after any '?' or
'#'.
-=item B<downloadurlmangle=>I<rules>
-
-Convert the selected upstream tarball href string into the accessible URL for
-obfusicated web sites.
-
=item B<pgpsigurlmangle=>I<rules>
Generate the candidate upstream signature file URL string from the upstream
@@ -821,9 +824,7 @@ See L<COPYRIGHT FILE EXAMPLES>.
=head2 HTTP site (filenamemangle)
The upstream tarball filename is found by taking the last component of the URL
-and removing everything after any '?' or '#'. If that leaves nothing for
-filename, B<uscan> generate filename using the source package name in
-B<debian/changelog>, the new version, and suffix B<.download> .
+and removing everything after any '?' or '#'.
If this does not fit to you, use B<filenamemangle>. For example, F<< <A
href="http://foo.bar.org/dl/?path=&dl=foo-0.1.1.tar.gz"> >> could be handled
@@ -842,6 +843,15 @@ could be handled as:
http://foo.bar.org/dl/\?path=&dl_version=(.+) \
debian uupdate
+If the href string has no version using <I>matching-pattern>, the version can
+be obtained from the full URL using B<filenamemangle>.
+
+ version=4
+ opts=filenamemangle=s&.*/dl/(.*)/foo\.tar\.gz&foo-$1\.tar\.gz& \
+ http://foo.bar.org/dl/([\.\d]+)/ foo.tar.gz \
+ debian uupdate
+
+
=head2 HTTP site (downloadurlmangle)
The option B<downloadurlmangle> can be used to mangle the URL of the file
@@ -2410,12 +2420,12 @@ sub process_watchline ($$$$$$)
@{$options{'uversionmangle'}} = split /;/, $1;
@{$options{'dversionmangle'}} = split /;/, $1;
}
- elsif ($opt =~ /^\s*filenamemangle\s*=\s*(.+?)\s*$/) {
- @{$options{'filenamemangle'}} = split /;/, $1;
- }
elsif ($opt =~ /^\s*downloadurlmangle\s*=\s*(.+?)\s*$/) {
@{$options{'downloadurlmangle'}} = split /;/, $1;
}
+ elsif ($opt =~ /^\s*filenamemangle\s*=\s*(.+?)\s*$/) {
+ @{$options{'filenamemangle'}} = split /;/, $1;
+ }
elsif ($opt =~ /^\s*pgpsigurlmangle\s*=\s*(.+?)\s*$/) {
@{$options{'pgpsigurlmangle'}} = split /;/, $1;
$options{'pgpmode'} = 'mangle';
@@ -2774,6 +2784,7 @@ sub process_watchline ($$$$$$)
# need the map { ... } here to handle cases of (...)?
# which may match but then return undef values
if ($versionless) {
+ # exception, otherwise $mangled_version = 1
$mangled_version = '';
} else {
$mangled_version =
@@ -3069,7 +3080,7 @@ EOF
}
}
unless ($newversion) {
- # uversionmangles version not exist
+ # uversionmanglesd version is '', make best effort to set it
$newfile_base =~ m/^.+[-_]([^-_]+)(?:\.tar\.(gz|bz2|xz)|\.zip)$/i;
$newversion = $1;
unless ($newversion) {
--
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