diff options
| author | 宋文武 <iyzsong@member.fsf.org> | 2025-12-29 19:33:02 +0800 |
|---|---|---|
| committer | 宋文武 <iyzsong@member.fsf.org> | 2026-05-30 10:01:58 +0800 |
| commit | 5c41a431dfd67c558229a5d3b8605191c761a8c4 (patch) | |
| tree | 4e107b91aaeba3db2342ab03dbbd24a410ffcdde | |
| parent | 5863808183e11ae3f1ac1378dff8b079748ada3c (diff) | |
import: git: Support 'stable-version-regexp' property.
Some packages (eg: xfce4-panel) use even number for minor version to indicate
a stable release, when refresh such packages to latest versions we'd like them
to be stable ones. Introduce 'stable-version-regexp' as a package property,
so that unwanted releases can be filtered out.
* doc/guix.texi (Invoking guix refresh): Document 'stable-version-regexp'.
* guix/import/git.scm (import-git-release): Filter out unstable releases when
target-version is unset but 'stable-version-regexp' is available.
Change-Id: I7bbb2cb41b19175a7e3fb79e00cd8dbb20d049ad
| -rw-r--r-- | doc/guix.texi | 4 | ||||
| -rw-r--r-- | guix/import/git.scm | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 30c91d0df9d..17d4bdd23a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -16124,6 +16124,10 @@ the tag name for separating the numbers of the version. | |||
| 16124 | pre-releases; to make it also look for pre-releases, set the this | 16124 | pre-releases; to make it also look for pre-releases, set the this |
| 16125 | property to @code{#t}. | 16125 | property to @code{#t}. |
| 16126 | 16126 | ||
| 16127 | @item @code{stable-version-regexp}: a regular expression for matching the | ||
| 16128 | version string, if specified the updater will pick the latest version from | ||
| 16129 | matching ones when the @option{--target-version} option is omitted. | ||
| 16130 | |||
| 16127 | @end itemize | 16131 | @end itemize |
| 16128 | 16132 | ||
| 16129 | @lisp | 16133 | @lisp |
diff --git a/guix/import/git.scm b/guix/import/git.scm index 8d443895cf1..81ea9b73988 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm | |||
| @@ -206,7 +206,14 @@ a version prefix when PARTIAL-VERSION? is #t." | |||
| 206 | (old-reference (origin-uri (package-source package))) | 206 | (old-reference (origin-uri (package-source package))) |
| 207 | (tags (get-package-tags package)) | 207 | (tags (get-package-tags package)) |
| 208 | (versions (map car tags)) | 208 | (versions (map car tags)) |
| 209 | (version (find-version versions version partial-version?)) | 209 | (stable-rx (and=> (assq-ref (package-properties package) |
| 210 | 'stable-version-regexp) | ||
| 211 | make-regexp)) | ||
| 212 | (version (find-version | ||
| 213 | (if (and stable-rx (not version)) | ||
| 214 | (filter (cut regexp-exec stable-rx <>) versions) | ||
| 215 | versions) | ||
| 216 | version partial-version?)) | ||
| 210 | (tag (assoc-ref tags version))) | 217 | (tag (assoc-ref tags version))) |
| 211 | (and version | 218 | (and version |
| 212 | (upstream-source | 219 | (upstream-source |
