Bug#850966: Please support ftp search with version number only in the directory name

Osamu Aoki osamu at debian.org
Fri Mar 31 16:28:27 UTC 2017


Hi,

(Please use reportbug to file a bug.  It generates good amount of data to
diagnose your problem)

I thought I fixed this issue for strech.  Changelog has:


devscripts (2.15.10) unstable; urgency=low
   ...
   + Update filenamemangle to support the version pattern matching in any
      position of the URL and remove .download hack which breaks
      mk-origtargz. (Closes: #526450, #803948, #804239)
   ...

 -- James McCoy <jamessan at debian.org>  Wed, 30 Dec 2015 20:44:35 -0500

On Wed, Jan 11, 2017 at 05:58:51PM +0100, Ole Streicher wrote:
> Package: devscripts

Version missing

> Severity: wishlist
> User: devscripts at packages.debian.org
> Usertags: uscan

> I have the following sample download URL
> 
> ftp://andromeda.star.bris.ac.uk/pub/star/stilts/v3.0-9/stilts_src.zip
> 
> Corresponding Debian version number should be 3.0.9.
> 
> There is currently no way to get this downloaded via uscan. I tried
> 
> version=3
> options="uversionmangle=s/\-/./,filenamemangle=s/\/$/.zip/" \
> ftp://andromeda.star.bris.ac.uk/pub/star/stilts/v([\d\.\-]+)/ stilts_src.zip
> 
> but it doesn't work; basically it adjusts upstream version to be 1:
> 
> uscan info: Newest upstream tarball version selected for download (uversionmangled): 1

I don't understand where does this "1" came from.  I don't remember what
was it like 2 years ago. 

Hmmm.... are you using testing or backported version of uscan?

stable-bpo:  2.16.4~bpo8+1
testing:     2.17.5

(Actually, should work with version=3 watch file.)

My updated manpage has

filenamemangle=rules
    Generate the upstream tarball filename from the selected href
    string if matching-pattern can extract the latest upstream version
    <uversion> from the selected href string.  Otherwise, generate the
    upstream tarball filename from its full URL string and set the
    missing <uversion> from the generated upstream tarball filename.

    Without this option, the default upstream tarball filename is
    generated by taking the last component of the URL and removing
    everything after any '?' or '#'.

With correct watch file, this should work.  You see only example for
HTTP but FTP should work.

I thought I specifically addressed this problem of version in full URL with:
    my $newfile_base;
    if (exists $options{'filenamemangle'}) {
        if ($versionless) {
            $newfile_base = $upstream_url;
        } else {
            $newfile_base = $newfile;
        }

Did you try something like?  You should not use uversionmangle.

   filenamemangle=s%.*/v\(\d[^-/]*\)-\(\d[^-/]*)/stilts_src.zip$%stilts-%$1.$2.zip%"

(untested... but you get the idea.)


This is FYI from the latest manpage:

HTTP site (filenamemangle)

The upstream tarball filename is found by taking the last component of
the URL and removing everything after any '?' or '#'.

If this does not fit to you, use filenamemangle.  For example, <A
href="http://foo.bar.org/dl/?path=&dl=foo-0.1.1.tar.gz"> could be
handled as:

  version=4
  opts=filenamemangle=s/.*=(.*)/$1/ \
  http://foo.bar.org/dl/\?path=&dl=foo-(.+)\.tar\.gz \
  debian uupdate

<A href="http://foo.bar.org/dl/?path=&dl_version=0.1.1"> could be
handled as:

  version=4
  opts=filenamemangle=s/.*=(.*)/foo-$1\.tar\.gz/ \
  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 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



More information about the devscripts-devel mailing list