Control: tag -1 moreinfo

On Sun, May 16, 2021 at 12:23:32AM +0200, Patrick Franz wrote:
> the watch-file for plasma-desktop (and all other Plasma packages accordingly) 
> looks like this:
> 
> version=4 
> opts=pgpsigurlmangle=s/$/.sig/ 
> https://download.kde.org/stable/plasma/([\d.]+)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
> 
> The stable releases can be found at https://download.kde.org/stable/plasma/ 
> and are caught as intended.
> The beta-releases, however, can be found at 
> https://download.kde.org/unstable/plasma/ and are not 
> caught by the regular expression as intended.
> 
> Changing the watch file to
> 
> version=4 
> opts=pgpsigurlmangle=s/$/.sig/ 
> https://download.kde.org/(un)?stable/plasma/([\d.]+)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
> 
> should now catch both stable and unstable releases. Unfortunately, it only 
> catches the unstable releases,
> but not the stable releases any more.

I believe this is due to you misunderstanding the format of d/watch, and
in general how uscan works.
The "watch line" has this format:
    http://URL matching-pattern [version [script]]
Where:
    •   http://URL specifies the web page where upstream publishes the link to 
the latest source archive.
        •   Some parts of URL may be in the regex match pattern
            surrounded between ( and ) such as /foo/bar-([\.\d]+)/.  (If
            multiple directories match, the highest version is picked.)
            Otherwise, the URL is taken as verbatim.

So, effectively, you are not using anything for the "matching-pattern"
part of the watchline, in which case uscan "falls back" to the regex
parts of the URL.

Remember that what uscan does is downloading web pages and scraping
them.
If you look at the verbose output of uscan using your second watchline,
this is what I get:

...
uscan info: line: 
https://download.kde.org/(?:un)?stable/plasma/([\d.]+)/plasma-desktop(?:[-_]?(\d[\-+\.:\~\da-zA-Z]*))(?i)(?:\.(?:tar\.xz|tar\.bz2|tar\.gz|zip|tgz|tbz|txz))
...
uscan info: dir=>/  dirpattern=>(?:un)?stable
uscan info: Requesting URL:
   https://download.kde.org/
...
uscan info: Found the following matching directories (newest first):
   https://download.kde.org/stable/ (1)
   https://download.kde.org/stable/ (1)
   https://download.kde.org/unstable/ (1)
   https://download.kde.org/unstable/ (1)
uscan info: newest_dir => 'stable'
uscan info: dir=>/stable/plasma/  dirpattern=>([\d.]+)
uscan info: Requesting URL:
   https://download.kde.org/stable/plasma/
...
uscan info: Found the following matching directories (newest first):
   https://download.kde.org/stable/plasma/5.21.5/ (5.21.5)
   https://download.kde.org/stable/plasma/5.21.5/ (5.21.5)
   https://download.kde.org/stable/plasma/5.21.4/ (5.21.4)
   https://download.kde.org/stable/plasma/5.21.4/ (5.21.4)
...
uscan info: newest_dir => '5.21.5'
uscan info: Requesting URL:
   https://download.kde.org/stable/plasma/5.21.5/
uscan info: Matching pattern:
   
(?:(?:https://download.kde.org)?\/stable\/plasma\/5\.21\.5\/)?plasma-desktop(?:[-_]?(\d[\-+\.:\~\da-zA-Z]*))(?i)(?:\.(?:tar\.xz|tar\.bz2|tar\.gz|zip|tgz|tbz|txz))
uscan info: Found the following matching hrefs on the web page (newest first):
   https://download.kde.org/stable/plasma/5.21.5/plasma-desktop-5.21.5.tar.xz 
(5.21.5) index=5.21.5-4
   https://download.kde.org/stable/plasma/5.21.5/plasma-desktop-5.21.5.tar.xz 
(5.21.5) index=5.21.5-4
...


So, what it does is: download https://download.kde.org/, look at what
matches /(?:un)?stable/  (remember to use non-capturing groups when you
can…), it sorts them and then pick the highest.  Here uscan can't really
sort them, so it assignes a value of "1" to all options and picks
whatever comes first, in this run it picks /stable/, but it could easily
pick /unstable/ at a different moment.


This is all to say, it's working as intended, and honestly I can't
imagine a way to make it do what you'd like it to do.


-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
More about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

Attachment: signature.asc
Description: PGP signature

Reply via email to