Package: devscripts
Version: 2.25.19~bpo13+1
Severity: normal
File: /usr/bin/uscan
X-Debbugs-Cc: [email protected]

Dear Maintainer,

In experimenting with the new debian/upstream/metadata approach to
replace watch files, I realised that some sort of version ordering
scheme needs to be added or exposed to this method.

I used the following:

  Archive: GitHub
  Bug-Database: https://github.com/bumps/bumps/issues
  Bug-Submit: https://github.com/bumps/bumps/issues/new
  Repository: https://github.com/bumps/bumps.git
  Repository-Browse: https://github.com/bumps/bumps

which then gave me:

$ uscan --no-download --verbose
uscan info: Scan watch files in .
uscan info: Check debian/watch and debian/changelog in .
uscan info: Found debian/upstream/metadata instead of debian/watch, trying to 
read it
uscan info: package="python-bumps" version="1.0.1-1" (as seen in 
debian/changelog)
uscan info: package="python-bumps" version="1.0.1" (no epoch/revision)
uscan info: ./debian/changelog sets package="python-bumps" version="1.0.1"
uscan info: Process watch file at: /tmp/AA65Z7rlIo/watch
    package = python-bumps
    version = 1.0.1
    pkg_dir = .
uscan info: Parsing downloadurlmangle: 
s%(api.github.com/repos/[^/]+/[^/]+)/git/refs/%$1/tarball/refs/%g
uscan info: Parsing filenamemangle: 
s%.*/(?:[^/]+\-)?(?:[-_]?[Vv]?(\d[\-+\.:\~\da-zA-Z]*))%python-bumps-$1.tar.gz%
uscan info: Parsing pgpmode: none
uscan info: Parsing searchmode: plain
uscan info: Last orig.tar.* tarball version (from debian/changelog): 1.0.1
uscan info: Last orig.tar.* tarball version (dversionmangled): 1.0.1
uscan info: Requesting URL:
   https://api.github.com/repos/bumps/bumps/git/matching-refs/tags/
uscan info: Found the following matching files on the web page (newest first):
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3rc2 (1.0.3rc2) 
index=1.0.3rc2-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3rc1 (1.0.3rc1) 
index=1.0.3rc1-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3rc0 (1.0.3rc0) 
index=1.0.3rc0-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3b1 (1.0.3b1) 
index=1.0.3b1-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3b0 (1.0.3b0) 
index=1.0.3b0-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3 (1.0.3) 
index=1.0.3-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.2rc0 (1.0.2rc0) 
index=1.0.2rc0-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.2a0 (1.0.2a0) 
index=1.0.2a0-0 
   https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.2 (1.0.2) 
index=1.0.2-0 
[... lots more ...]
uscan info: Looking at $base        = 
https://api.github.com/repos/bumps/bumps/git/matching-refs/tags/ with
    $filepattern        = 
https://api.github.com/repos/[^/]+/[^/]+/git/refs/tags/(?:[^/]+\-)?(?:[-_]?[Vv]?(\d[\-+\.:\~\da-zA-Z]*))
 found
    $newfile            = 
https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3rc2
    $mangled_newversion = 1.0.3rc2
    $newversion         = 1.0.3rc2
    $lastversion        = 1.0.1
uscan info: Matching target for downloadurlmangle: 
https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3rc2
uscan info: Upstream URL(+tag) to download is identified as    
https://api.github.com/repos/bumps/bumps/tarball/refs/tags/v1.0.3rc2
uscan info: Matching target for filenamemangle: 
https://api.github.com/repos/bumps/bumps/git/refs/tags/v1.0.3rc2
uscan info: Filename (filenamemangled) for downloaded file: 
python-bumps-1.0.3rc2.tar.gz
Newest version of python-bumps on remote site is 1.0.3rc2, local version is 
1.0.1
 => Newer package available from:
        => https://api.github.com/repos/bumps/bumps/tarball/refs/tags/v1.0.3rc2
uscan info: Scan finished

It is seen in this output that the prelease versions are getting in the
way.

- There needs to be a way to include/exclude prerelease versions from
  the scan on a per-package basis (one might upload prereleases to
  experimental for some packages, for instance)

- The needs to be a way to control the sort order of the versions so
  that uscan selects the actual release (1.0.3) and not the prereleases
  (1.0.3rc1, 1.0.3b1, 1.0.3a1 etc); this sort order is the standard for
  Python modules, documented in PEP440 https://peps.python.org/pep-0440/

Inclusion/exclusion of prerelease versions used to be doable via
tweaking the version regex in d/watch -- what is the new equivalant to
that?

Sort order used to be done via a versionmangle -- what is the new
equivalent to that? Actually… I really don't want to have to write
mangles like that. Would it be feasible to instead specify something like
Version-Scheme: PEP440 in d/u/metadata and put the logic in uscan rather
than each package looking after a regex for that? There will no doubt be
other version schemes for Perl, GNU, dpkg, … that could be similar turned
into centralised schemas.)

(If this is already possible and I've just not figured out how, then
please take this is a bug requesting documentation instead!)

thanks
Stuart


-- System Information:
Debian Release: 13.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'proposed-updates'), (500, 'stable'), (60, 'unstable'), 
(1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.38+deb13-amd64 (SMP w/22 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages devscripts depends on:
ii  dpkg-dev              1.22.21
ii  file                  1:5.46-5
ii  gpg                   2.4.7-21+b3
ii  gpg-agent             2.4.7-21+b3
ii  gpgv                  2.4.7-21+b3
ii  libdpkg-perl          1.22.21
ii  libfile-dirlist-perl  0.05-3
ii  libfile-homedir-perl  1.006-2
ii  libfile-touch-perl    0.12-2
ii  libio-string-perl     1.08-4
ii  libmoo-perl           2.005005-1
ii  libwww-perl           6.78-1
ii  patchutils            0.4.2-1
ii  perl                  5.40.1-6
ii  python3               3.13.5-1
ii  sensible-utils        0.0.25
ii  wdiff                 1.2.2-9

Versions of packages devscripts recommends:
ii  apt                         3.0.3
ii  curl                        8.14.1-2
ii  dctrl-tools                 2.24-3+b1
ii  debian-keyring              2025.09.18
ii  debian-tag2upload-keyring   1.1
ii  dput-ng [dput]              1.43
ii  equivs                      2.3.2
ii  git-debpush                 13.15~bpo13+1
ii  libdistro-info-perl         1.13
ii  libencode-locale-perl       1.05-3
ii  libgitlab-api-v4-perl       0.27-1
ii  libjson-perl                4.10000-1
ii  liblwp-protocol-https-perl  6.14-1
ii  libmetacpan-client-perl     2.033000-1
ii  libsoap-lite-perl           1.27-3
ii  libstring-shellquote-perl   1.04-3
ii  liburi-perl                 5.30-1
ii  licensecheck                3.3.9-1
ii  lintian                     2.122.0
ii  lzip                        1.25-3
ii  man-db                      2.13.1-1
ii  patch                       2.8-2
ii  pristine-tar                1.50+nmu2
ii  python3-apt                 3.0.0
ii  python3-debian              1.0.1
ii  python3-magic               2:0.4.27-3
ii  python3-requests            2.32.3+dfsg-5
ii  python3-unidiff             0.7.5-2
ii  python3-xdg                 0.28-2
ii  strace                      6.13+ds-1
ii  unzip                       6.0-29
ii  wget                        1.25.0-2
ii  xz-utils                    5.8.1-1

Versions of packages devscripts suggests:
ii  adequate                                  0.17.5+b5
ii  at                                        3.2.5-2.2
ii  autopkgtest                               5.49
pn  bls-standalone                            <none>
ii  bsd-mailx [mailx]                         8.1.2-0.20220412cvs-1.1
ii  build-essential                           12.12
pn  check-all-the-things                      <none>
ii  debhelper                                 13.24.2
pn  diffoscope                                <none>
pn  disorderfs                                <none>
pn  docker.io                                 <none>
ii  dose-extra                                7.0.0-6+b1
pn  duck                                      <none>
pn  elpa-devscripts                           <none>
pn  faketime                                  <none>
ii  gnuplot                                   6.0.2+dfsg1-1
ii  gnuplot-x11 [gnuplot]                     6.0.2+dfsg1-1
ii  how-can-i-help                            20
ii  libauthen-sasl-perl                       2.1700-1
pn  libdbd-pg-perl                            <none>
ii  libgitlab-api-v4-perl                     0.27-1
ii  libterm-size-perl                         0.211-1+b5
ii  libtimedate-perl                          2.3300-2
ii  libyaml-libyaml-perl                      0.903.0+ds-1
ii  mmdebstrap                                1.5.7-1+deb13u1
ii  mutt                                      2.2.13-1
ii  openssh-client [ssh-client]               1:10.0p1-7
pn  piuparts                                  <none>
ii  postgresql-client                         17+278
ii  postgresql-client-17 [postgresql-client]  17.6-0+deb13u1
pn  pristine-lfs                              <none>
ii  python3-debianbts                         4.1.1
ii  python3-pycurl                            7.45.6-1
ii  quilt                                     0.68-1
pn  ratt                                      <none>
pn  reprotest                                 <none>
pn  svn-buildpackage                          <none>
ii  w3m                                       0.5.3+git20230121-2.1

-- debconf-show failed

Reply via email to