diff --git a/Manual.md b/Manual.md index e85cfb57d284be..48154ab4729f0d 100644 --- a/Manual.md +++ b/Manual.md @@ -913,6 +913,14 @@ file in the same directory as the relevant `template` file: mentioned. If unset, defaults to `homepage` and the directories where `distfiles` reside. +- `distfiles_only` if set to `yes`, the package homepage is excluded + from the URLs scanned for version detection. Only the directories + derived from `distfiles` (and any URL set via `site`) are checked. + This is useful when a custom `pattern` is tuned for a specific + endpoint format (such as a git forge's `info/refs`) and would + produce spurious matches against unrelated numbers appearing in the + homepage HTML. + - `pkgname` is the package name the default pattern checks for. If unset, defaults to `pkgname` from the template. @@ -944,6 +952,51 @@ in url. Defaults to `(|\.x)`. in cases where checking for updates is impossible or does not make sense. This should be set to a string describing why it is disabled. +#### Git forge endpoints + +When `update_check.sh` scans URLs against a git forge's `info/refs` +endpoint (used automatically for `github.com`, `gitlab.*`, +`bitbucket.org`, `codeberg.org`, and `git.sr.ht` URLs), custom +`pattern` entries may omit the `refs/tags/` prefix; it is auto-prefixed +when not already present. For example, these two patterns are +equivalent for a GitHub-hosted package: + + pattern='refs/tags/vulkan-sdk-\K[\d.]+' + pattern='vulkan-sdk-\K[\d.]+' + +The second form is preferred: it keeps the pattern focused on the +package-specific tag convention rather than restating the endpoint +format. + +This auto-prefixing only applies when the URL contains `info/refs`; +patterns used against URLs set explicitly via `site` are matched +as-written. + +#### Choosing between `site`, `distfiles_only` and the default behavior + +Most packages need neither `site` nor `distfiles_only`: the default +behavior of scanning the homepage and distfiles directories works +well when the `pattern` (or the default regex) has a strong anchor +that won't match unrelated content. + +Use `distfiles_only=yes` when: + +- A custom `pattern` is specific enough to detect versions on the + distfiles URL, but matches unrelated numbers when applied to the + package homepage. + +Use `site=URL` when: + +- The version cannot be detected from `homepage` or `distfiles` + directories alone (e.g., upstream lists versions on a separate + release page). +- One of the URLs in `distfiles` is a secondary file (such as a + pkg-config template fetched from `raw.githubusercontent.com`) that + produces unwanted matches independently of the homepage. +- A non-standard `info/refs` endpoint must be targeted (e.g., a + self-hosted forge whose URL doesn't match the automatic patterns + above). + ### Handling patches diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh index 216fefd967e837..17eae4dd6bdae5 100644 --- a/common/xbps-src/shutils/update_check.sh +++ b/common/xbps-src/shutils/update_check.sh @@ -43,7 +43,7 @@ update_check() { *ftp.gnome.org*|*download.gnome.org*) ;; *archive.xfce.org*) ;; *) - printf '%s\n' "$homepage" ;; + [ "$distfiles_only" = yes ] || printf '%s\n' "$homepage" ;; esac for i in $distfiles; do printf '%s\n' "${i%/*}/" @@ -216,6 +216,13 @@ update_check() { rx=${pattern:-$rx} rx=${rx:-'(?)' +pattern="V\K[\d-]+" diff --git a/srcpkgs/lmdb/update b/srcpkgs/lmdb/update index 2578d56778d3a3..cf8c5ef25fc895 100644 --- a/srcpkgs/lmdb/update +++ b/srcpkgs/lmdb/update @@ -1 +1 @@ -pattern='LMDB_\K[\d.]+(?=\.tar)' +pattern="LMDB_\K[\d.]+" diff --git a/srcpkgs/love/update b/srcpkgs/love/update index fca77c8115245d..8e4cd9326676bd 100644 --- a/srcpkgs/love/update +++ b/srcpkgs/love/update @@ -1 +1,2 @@ -pattern='/(get|downloads)/(v?|\Q'"$pkgname"'\E-)?\K[\d\.]+(?=(-linux-src)?\.tar)' +distfiles_only=yes +pattern="\K[\d.]+" diff --git a/srcpkgs/lsyncd/update b/srcpkgs/lsyncd/update index 35ccc57c5ec3d4..5ef6a1abbe650f 100644 --- a/srcpkgs/lsyncd/update +++ b/srcpkgs/lsyncd/update @@ -1 +1 @@ -pattern="release-\K[\d\.]*(?=\.tar.gz)" +pattern="release-\K[\d.]+" diff --git a/srcpkgs/lua54-luafilesystem/update b/srcpkgs/lua54-luafilesystem/update index 00a38fcaac6066..9683620253ab99 100644 --- a/srcpkgs/lua54-luafilesystem/update +++ b/srcpkgs/lua54-luafilesystem/update @@ -1,2 +1,2 @@ -pattern='/archive/refs/tags/(v?|\Q'"$pkgname"'\E-)?\K[\d._]+(?=\.tar\.gz")' +pattern="(v?|${pkgname}-)?\K[\d._]+" version=${version//_/.} diff --git a/srcpkgs/mame/update b/srcpkgs/mame/update index bee0828f49810d..7a2655af2ab378 100644 --- a/srcpkgs/mame/update +++ b/srcpkgs/mame/update @@ -1 +1 @@ -pattern="${pkgname}\K\d+(?=\.tar)" +pattern="mame\K\d+" diff --git a/srcpkgs/mathjax2/update b/srcpkgs/mathjax2/update index 4af56219ddb257..91397dc7d2bfb9 100644 --- a/srcpkgs/mathjax2/update +++ b/srcpkgs/mathjax2/update @@ -1 +1,2 @@ -pattern='refs/tags/\K2[.][0-9.]*(?=.tar.gz)' +distfiles_only=yes +pattern="\K2\.[\d.]+" diff --git a/srcpkgs/md4c/update b/srcpkgs/md4c/update index 75b937ad4877f3..5ef6a1abbe650f 100644 --- a/srcpkgs/md4c/update +++ b/srcpkgs/md4c/update @@ -1 +1 @@ -pattern="release-\K[0-9.]+(?=.tar.gz)" +pattern="release-\K[\d.]+" diff --git a/srcpkgs/minio/update b/srcpkgs/minio/update index e45793c85463dc..2ea1aac20b3184 100644 --- a/srcpkgs/minio/update +++ b/srcpkgs/minio/update @@ -1 +1 @@ -pattern="/archive/refs/tags/RELEASE\.\K[-\d]+(?=T[-\d]+Z\.tar\.gz)" +pattern="RELEASE\.\K[\d-]+" diff --git a/srcpkgs/miruo/update b/srcpkgs/miruo/update index 97780a418e6e1f..7a13539a91200a 100644 --- a/srcpkgs/miruo/update +++ b/srcpkgs/miruo/update @@ -1 +1 @@ -pattern='/archive/refs/tags/(v?|\Q'"$pkgname"'\E-)?\K[\d\.]+[a-z]*(?=\.tar\.gz")' +pattern="(v?|${pkgname}-)?\K[\d.]+[a-z]*" diff --git a/srcpkgs/moosefs/update b/srcpkgs/moosefs/update index d494050f3cc110..84f58f2c314b31 100644 --- a/srcpkgs/moosefs/update +++ b/srcpkgs/moosefs/update @@ -1 +1,2 @@ -pattern="$pkgname-\K[\d\.]*(?=\-1\.tar\.gz)" +distfiles_only=yes +pattern="v\K[\d.]+" diff --git a/srcpkgs/openimageio/update b/srcpkgs/openimageio/update index 1c6f7ece7517ad..86c7591df318d3 100644 --- a/srcpkgs/openimageio/update +++ b/srcpkgs/openimageio/update @@ -1 +1,3 @@ -pattern="Release-\K[\d\.]+(?=\.tar)" +distfiles_only=yes +pattern="v\K[\d.]+(-dev)?" +ignore="*dev*" diff --git a/srcpkgs/openjdk8/update b/srcpkgs/openjdk8/update index ea63bcfe4e1347..adcc1c02ed6b2b 100644 --- a/srcpkgs/openjdk8/update +++ b/srcpkgs/openjdk8/update @@ -1 +1 @@ -pattern='shenandoah\K8u[\db-]+(?=\.tar\.gz)' +pattern="shenandoah\K8u[\db-]+" diff --git a/srcpkgs/otfcc/update b/srcpkgs/otfcc/update index 237d271a07fe56..bc5a239c9b3667 100644 --- a/srcpkgs/otfcc/update +++ b/srcpkgs/otfcc/update @@ -1,2 +1,2 @@ -pattern='/archive/refs/tags/(v?|\Q'"$pkgname"'\E-)?\K[-\d\.a-z]+(?=\.tar\.gz")' +pattern="(v?|${pkgname}-)?\K[-\d.a-z]+" version="${version/alpha/.alpha}" diff --git a/srcpkgs/pgbackrest/update b/srcpkgs/pgbackrest/update index 7cd47a23caf40d..9d9ab260e04ce6 100644 --- a/srcpkgs/pgbackrest/update +++ b/srcpkgs/pgbackrest/update @@ -1 +1 @@ -pattern='/archive/refs/tags/(v?|\Qrelease/\E)?\K[\d\.]+(?=\.tar\.gz")' +pattern="release/\K[\d.]+" diff --git a/srcpkgs/poedit/update b/srcpkgs/poedit/update index 93e8bf47ac205b..c81dc68be70f99 100644 --- a/srcpkgs/poedit/update +++ b/srcpkgs/poedit/update @@ -1 +1 @@ -pattern='/archive/refs/tags/(v?|\Q'"$pkgname"'\E-)?\K[\d\.]+(?=-oss\.tar\.gz")' +pattern="(v?|${pkgname}-)?\K[\d.]+(?=-oss)" diff --git a/srcpkgs/python3-aioamqp/update b/srcpkgs/python3-aioamqp/update index 8920d4a4c61654..325c1185aa32c4 100644 --- a/srcpkgs/python3-aioamqp/update +++ b/srcpkgs/python3-aioamqp/update @@ -1 +1 @@ -pattern="${pkgname#*-}-\K[0-9.]*(?=.tar.gz)" +pattern="aioamqp-\K[0-9.]+" diff --git a/srcpkgs/python3-hypothesis/update b/srcpkgs/python3-hypothesis/update index 3c99b323e612e8..6795f3808fc4eb 100644 --- a/srcpkgs/python3-hypothesis/update +++ b/srcpkgs/python3-hypothesis/update @@ -1,2 +1,2 @@ pkgname=hypothesis-python -pattern="${pkgname}-\K[0-9.]+\.0(?=\.tar\.gz)" +pattern="${pkgname}-\K[0-9.]+" diff --git a/srcpkgs/python3-pyqtgraph/update b/srcpkgs/python3-pyqtgraph/update index 1c97eb13e50c26..e8a019ac390adc 100644 --- a/srcpkgs/python3-pyqtgraph/update +++ b/srcpkgs/python3-pyqtgraph/update @@ -1 +1,2 @@ -pattern='pyqtgraph-\K[\d.]+(?=")' +distfiles_only=yes +pattern="pyqtgraph-\K[\d.]+" diff --git a/srcpkgs/re2/update b/srcpkgs/re2/update index 0a8a22bb62e9ac..800f3a89c2ce35 100644 --- a/srcpkgs/re2/update +++ b/srcpkgs/re2/update @@ -1 +1,2 @@ -pattern="\K[\d\-]*([\d\-]+)(?=\.tar\.gz)" +distfiles_only=yes +pattern="\K[\d-]+" diff --git a/srcpkgs/redshift/update b/srcpkgs/redshift/update index 984f46ed2d0e66..84f58f2c314b31 100644 --- a/srcpkgs/redshift/update +++ b/srcpkgs/redshift/update @@ -1 +1,2 @@ -pattern='Redshift \K[\d.]+' +distfiles_only=yes +pattern="v\K[\d.]+" diff --git a/srcpkgs/redsocks/update b/srcpkgs/redsocks/update index 8d59b5daab99ad..756287650ebce6 100644 --- a/srcpkgs/redsocks/update +++ b/srcpkgs/redsocks/update @@ -1 +1,2 @@ -pattern="release-\K[\d.]*(?=\.tar\.gz)" +distfiles_only=yes +pattern="release-\K[\d.]+" diff --git a/srcpkgs/sane/update b/srcpkgs/sane/update index fd273397c12928..8e4cd9326676bd 100644 --- a/srcpkgs/sane/update +++ b/srcpkgs/sane/update @@ -1 +1,2 @@ -pattern='href="/sane-project/backends/-/tags/[^\d\.]*\K[\d\.]*' +distfiles_only=yes +pattern="\K[\d.]+" diff --git a/srcpkgs/sasm/update b/srcpkgs/sasm/update index e87dd25c3d26b8..84f58f2c314b31 100644 --- a/srcpkgs/sasm/update +++ b/srcpkgs/sasm/update @@ -1 +1,2 @@ -pattern=".*/archive/refs/tags/v\K.+(?=\.tar\.gz)" +distfiles_only=yes +pattern="v\K[\d.]+" diff --git a/srcpkgs/sdl12-compat/update b/srcpkgs/sdl12-compat/update index d5d5bd9b531f87..5ef6a1abbe650f 100644 --- a/srcpkgs/sdl12-compat/update +++ b/srcpkgs/sdl12-compat/update @@ -1 +1 @@ -pattern='release-\K[\d.]+(?=\.tar\.gz")' +pattern="release-\K[\d.]+" diff --git a/srcpkgs/slurm-wlm/update b/srcpkgs/slurm-wlm/update index 45710996f24987..90881adef32315 100644 --- a/srcpkgs/slurm-wlm/update +++ b/srcpkgs/slurm-wlm/update @@ -1,2 +1,3 @@ pkgname=slurm -pattern='slurm-\K[-\d]+(?=.tar.gz)' +pattern="${pkgname}-\K[\d-]+(rc\d*)?" +ignore="*rc*" diff --git a/srcpkgs/spectrwm/update b/srcpkgs/spectrwm/update index edc0c39a9ccf91..075bab04b16c2f 100644 --- a/srcpkgs/spectrwm/update +++ b/srcpkgs/spectrwm/update @@ -1 +1 @@ -pattern="SPECTRWM_\K[\d\_]*(?=\.tar\.gz)" +pattern="SPECTRWM_\K[\d_]+" diff --git a/srcpkgs/swayr/update b/srcpkgs/swayr/update index 6ca64b471c26fe..5de2860c3fd987 100644 --- a/srcpkgs/swayr/update +++ b/srcpkgs/swayr/update @@ -1 +1,2 @@ -pattern='Release swayr-\K[\d.]+(?=)' +distfiles_only=yes +pattern="swayr-\K[\d.]+" diff --git a/srcpkgs/swayrbar/update b/srcpkgs/swayrbar/update index 3cebd62d64025e..7788ec5d66c8b0 100644 --- a/srcpkgs/swayrbar/update +++ b/srcpkgs/swayrbar/update @@ -1 +1,2 @@ -pattern='Release swayrbar-\K[\d.]+(?=)' +distfiles_only=yes +pattern="swayrbar-\K[\d.]+" diff --git a/srcpkgs/taplo/update b/srcpkgs/taplo/update index d4af49a34d03a5..67d56b3698862e 100644 --- a/srcpkgs/taplo/update +++ b/srcpkgs/taplo/update @@ -1 +1 @@ -pattern="release-taplo-cli-\K[\d.]+(?=\.tar\.gz)" +pattern="release-taplo-cli-\K[\d.]+" diff --git a/srcpkgs/tectonic/update b/srcpkgs/tectonic/update index 93131668f6905c..b9a41262145658 100644 --- a/srcpkgs/tectonic/update +++ b/srcpkgs/tectonic/update @@ -1 +1 @@ -pattern="tectonic@\K[\d.]+(?=.tar.gz)" +pattern="tectonic@\K[\d.]+" diff --git a/srcpkgs/tinymist/update b/srcpkgs/tinymist/update index f4e0cdb9362dfd..b1115fe704330d 100644 --- a/srcpkgs/tinymist/update +++ b/srcpkgs/tinymist/update @@ -1,2 +1,3 @@ +distfiles_only=yes # odd patches are nightlies -pattern='/archive/refs/tags/(v?|\Qtinymist\E)?\K[\d.]+\.\d*[02468](?=\.tar\.gz)' +pattern="(v?|${pkgname})?\K[\d.]+\.\d*[02468]" diff --git a/srcpkgs/tmux/update b/srcpkgs/tmux/update index f2e185f58e1ba4..f271bcb55ad665 100644 --- a/srcpkgs/tmux/update +++ b/srcpkgs/tmux/update @@ -1,2 +1 @@ -#site="https://github.com/tmux/tmux/releases" -pattern="(?<=refs/tags/)[0-9.]+[a-z]*(?=.tar)" +pattern="\K[0-9.]+[a-z]*" diff --git a/srcpkgs/vapoursynth/update b/srcpkgs/vapoursynth/update index df623475c92d66..eeef89cfc181e0 100644 --- a/srcpkgs/vapoursynth/update +++ b/srcpkgs/vapoursynth/update @@ -1 +1,2 @@ -pattern="R[\d\.]+(?=\.tar\.gz)" +pattern="R[\d.]+(-?RC\d*)?" +ignore="*RC*" diff --git a/srcpkgs/w3m/update b/srcpkgs/w3m/update index 04b31ff7efac92..84f58f2c314b31 100644 --- a/srcpkgs/w3m/update +++ b/srcpkgs/w3m/update @@ -1 +1,2 @@ -pattern="/archive/refs/tags/v\K[\d\.]+\+git\d+(?=(\+deb[u\+.\d]+)?\.tar)" +distfiles_only=yes +pattern="v\K[\d.]+" diff --git a/srcpkgs/wire-desktop/update b/srcpkgs/wire-desktop/update index 741008b96adc43..9555c4280c95b6 100644 --- a/srcpkgs/wire-desktop/update +++ b/srcpkgs/wire-desktop/update @@ -1 +1 @@ -pattern="(?<=linux/)[0-9.]+(?=.tar.gz)" +pattern="linux/\K[\d.]+" diff --git a/srcpkgs/wlroots0.18/update b/srcpkgs/wlroots0.18/update index 29ccd1295c60c8..25cea06d0030db 100644 --- a/srcpkgs/wlroots0.18/update +++ b/srcpkgs/wlroots0.18/update @@ -1 +1 @@ -pattern="/wlroots-\K0\.18\.[\d.]+(?=\.tar\.gz)" +pattern="\K0\.18\.[\d.]+" diff --git a/srcpkgs/wlroots0.19/update b/srcpkgs/wlroots0.19/update index 9a012f2da0ce90..9434b752ffac7f 100644 --- a/srcpkgs/wlroots0.19/update +++ b/srcpkgs/wlroots0.19/update @@ -1 +1 @@ -pattern="/wlroots-\K0\.19\.[\d.]+(?=\.tar\.gz)" +pattern="\K0\.19\.[\d.]+" diff --git a/srcpkgs/wlroots0.20/update b/srcpkgs/wlroots0.20/update index 74e94e746ffd75..36fa7728c47910 100644 --- a/srcpkgs/wlroots0.20/update +++ b/srcpkgs/wlroots0.20/update @@ -1 +1 @@ -pattern="/wlroots-\K0\.20\.[\d.]+(?=\.tar\.gz)" +pattern="\K0\.20\.[\d.]+" diff --git a/srcpkgs/x265/update b/srcpkgs/x265/update index c64056fdc0ea63..8e4cd9326676bd 100644 --- a/srcpkgs/x265/update +++ b/srcpkgs/x265/update @@ -1 +1,2 @@ -pattern='/(get|downloads)/(v?|\Q'"$pkgname"'\E_)?\K[\d\.]+(?=\.tar\.gz")' +distfiles_only=yes +pattern="\K[\d.]+" diff --git a/srcpkgs/xdelta3/update b/srcpkgs/xdelta3/update index 3d26a415b07fbc..9d1cccffc0b854 100644 --- a/srcpkgs/xdelta3/update +++ b/srcpkgs/xdelta3/update @@ -1,2 +1,3 @@ pkgname=xdelta -pattern=$pkgname'-\K[\d.]+\d+' +distfiles_only=yes +pattern="v\K[\d.]+" diff --git a/srcpkgs/yaydl/update b/srcpkgs/yaydl/update index 541f111949254f..5ef6a1abbe650f 100644 --- a/srcpkgs/yaydl/update +++ b/srcpkgs/yaydl/update @@ -1 +1 @@ -pattern="/archive/refs/tags/release-\K[\d\.]+(?=\.tar\.gz)" +pattern="release-\K[\d.]+" diff --git a/srcpkgs/zeux-volk/update b/srcpkgs/zeux-volk/update index 825388a1d5ffca..74a61c18f26c2a 100644 --- a/srcpkgs/zeux-volk/update +++ b/srcpkgs/zeux-volk/update @@ -1 +1 @@ -pattern="/vulkan-sdk-\K[0-9.]+(?=.tar.gz)" +pattern="vulkan-sdk-\K[\d.]+" diff --git a/srcpkgs/zfs-auto-snapshot/update b/srcpkgs/zfs-auto-snapshot/update index f64124553d5421..7d6857f06ba475 100644 --- a/srcpkgs/zfs-auto-snapshot/update +++ b/srcpkgs/zfs-auto-snapshot/update @@ -1 +1 @@ -pattern="upstream/\K[\d\.]*(?=\.tar\.gz)" +pattern="upstream/\K[\d.]+" diff --git a/srcpkgs/zfs-lts/update b/srcpkgs/zfs-lts/update index 0f5b13809780f1..b7141201ba179d 100644 --- a/srcpkgs/zfs-lts/update +++ b/srcpkgs/zfs-lts/update @@ -1,3 +1,3 @@ pkgname=zfs +pattern="${pkgname}-\K\Q${version%.*}\E\.[\d.]+" ignore="*.*.99" -pattern="${pkgname}-\K\Q${version%.*}\E\.[0-9.]+(?=\.tar\.gz)" diff --git a/srcpkgs/zimg/update b/srcpkgs/zimg/update index f35c0ff94213ae..5ef6a1abbe650f 100644 --- a/srcpkgs/zimg/update +++ b/srcpkgs/zimg/update @@ -1 +1 @@ -pattern='release-\K[\d.]+(?=")' +pattern="release-\K[\d.]+"