[PATCH 0/2] Add updater for packages hosted as SourceHut Git repositories

  • Open
  • quality assurance status badge
Details
3 participants
  • Léo Le Bouter
  • Ludovic Courtès
  • Xinglu Chen
Owner
unassigned
Submitted by
Xinglu Chen
Severity
normal
X
X
Xinglu Chen wrote on 9 Apr 2021 11:02
(address . guix-patches@gnu.org)(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
cover.1617958554.git.public@yoctocell.xyz
This adds support for updating packages hosted as SourceHut Git
repositories. It looks at the Git tags on the remote (thank you Léo for
pointing this out[1]) to determine the latest release. It won't be as
reliable as the GitHub updater, but still better than nothing, I
guess.

SourceHut also has support for Mercurial, but I am not familiar with it,
maybe I will look into it in the future. :)

See it in action:

$ ./pre-inst-env guix refresh fennel
gnu/packages/lua.scm:1176:13: fennel would be upgraded from 0.8.1 to 0.9.0


Xinglu Chen (2):
upstream: Add predicate for Git URLs.
gnu-maintenance: Add 'sourcehut-git' updater.

doc/guix.texi | 3 ++
guix/gnu-maintenance.scm | 90 ++++++++++++++++++++++++++++++++++++++++
guix/upstream.scm | 20 +++++++++
3 files changed, 113 insertions(+)


base-commit: 29a6c361492b18bcb0f6d2517d010a1b48441521
--
2.31.1
X
X
Xinglu Chen wrote on 9 Apr 2021 11:05
[PATCH 1/2] upstream: Add predicate for Git URLs.
(address . 47670@debbugs.gnu.org)
834e423bf8682e98d55bddb8f7c9b50389f7326c.1617958554.git.public@yoctocell.xyz
* guix/upstream.scm (git-url-predicate): New procedure.
---
guix/upstream.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (54 lines)
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 632e9ebc4f..47d11043dd 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -24,6 +25,7 @@
#:use-module (guix discovery)
#:use-module ((guix download)
#:select (download-to-store url-fetch))
+ #:use-module (guix git-download)
#:use-module (guix gnupg)
#:use-module (guix packages)
#:use-module (guix diagnostics)
@@ -54,6 +56,7 @@
url-predicate
url-prefix-predicate
+ git-url-predicate
coalesce-sources
upstream-updater
@@ -185,6 +188,23 @@ MATCHING-URL?."
source URLs starts with PREFIX."
(url-predicate (cut string-prefix? prefix <>)))
+(define (git-url-predicate matching-url?)
+ "Return a predicate that returns true when passed a package whose source is
+an <origin> with the GIT-FETCH method, and one of its URLs passes
+MATCHING-URL?."
+ (lambda (package)
+ (match (package-source package)
+ ((? origin? origin)
+ (and (eq? (origin-method origin) git-fetch)
+ (match (origin-uri origin)
+ ((? git-reference? git-reference)
+ (matching-url? (git-reference-url git-reference)))
+ (((? git-reference? git-reference) ...)
+ (any matching-url? (git-reference-url git-reference)))
+ (_
+ #f))))
+ (_ #f))))
+
(define (upstream-source-archive-types release)
"Return the available types of archives for RELEASE---a list of strings such
as \"gz\" or \"xz\"."
--
2.31.1
X
X
Xinglu Chen wrote on 9 Apr 2021 11:05
[PATCH 2/2] gnu-maintenance: Add 'sourcehut-git' updater.
(address . 47670@debbugs.gnu.org)(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
8ea188fa0521e9ea5f07dcc9973e1fa916dc4494.1617958554.git.public@yoctocell.xyz
* guix/gnu-maintenance.scm (latest-git-tag-version, sourcehut-git-package?,
latest-sourcehut-git-release): New procedures.
(%sourcehut-git-updater): New variable.
* doc/guix.texi (Invoking guix refresh): Document it.
---
doc/guix.texi | 3 ++
guix/gnu-maintenance.scm | 90 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+)

Toggle diff (152 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index d1a15cb28b..6b6e3401f0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11745,6 +11745,9 @@ the updater for @uref{https://www.stackage.org, Stackage} packages.
the updater for @uref{https://crates.io, Crates} packages.
@item launchpad
the updater for @uref{https://launchpad.net, Launchpad} packages.
+@item sourcehut-git
+the updater for packages hosted as @uref{https://sourcehut.org,
+SourceHut} Git repositories.
@item generic-html
a generic updater that crawls the HTML page where the source tarball of
the package is hosted, when applicable.
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index fece84b341..6a2a4ccf34 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,9 @@
#:use-module (sxml simple)
#:use-module (ice-9 regex)
#:use-module (ice-9 match)
+ #:use-module (ice-9 popen)
+ #:use-module (ice-9 rdelim)
+ #:use-module (ice-9 receive)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
@@ -38,6 +42,7 @@
#:use-module (guix records)
#:use-module (guix upstream)
#:use-module (guix packages)
+ #:use-module (guix git-download)
#:autoload (zlib) (call-with-gzip-input-port)
#:autoload (htmlprag) (html->sxml) ;from Guile-Lib
#:export (gnu-package-name
@@ -69,6 +74,7 @@
%sourceforge-updater
%xorg-updater
%kernel.org-updater
+ %sourcehut-git-updater
%generic-html-updater))
;;; Commentary:
@@ -802,6 +808,83 @@ the directory containing its source tarball."
(apply throw key args))
#f))))
+(define (latest-git-tag-version package)
+ "Return the latest version of PACKAGE based on Git tags. This relies on the
+Git tag having the version of the package in the name."
+ (let* ((url (git-reference-url (origin-uri (package-source package))))
+ (port (open-pipe* OPEN_READ
+ "git"
+ "ls-remote"
+ "--tags"
+ url)))
+
+ (define read-tags
+ (let loop ((lines '()))
+ (let ((line (read-line port)))
+ (cond
+ ((eof-object? line) lines)
+ ;; The hash on the lines without "^{}" dont't correspond to a
+ ;; commit.
+ ;;
+ ;; 0545ff5df25ea019fcb6fc1dcb40da06b35320e9 refs/tags/0.8.1
+ ;; 13042ec03837b72f8d14c04e9abe3ddae88449fa refs/tags/0.8.1^{}
+ ((not (string-suffix? "^{}" line)) (loop lines))
+ ;; Drop the "^{}"
+ (else (loop (cons (string-drop-right line 3) lines)))))))
+
+ (close-pipe port)
+
+ (define (tag->version tag)
+ (if (string-prefix? "v"tag)
+ (substring tag 1)
+ tag))
+
+ (define (valid-version? tag)
+ (if (string-match "^[0-9._-]*$" (tag->version tag)) #t #f))
+
+ ;; Some projects will publish release candidates which we usually don't
+ ;; want to package.
+ (if (not (null? read-tags))
+ (receive (valid invalid)
+ (partition valid-version?
+ (map (lambda (line)
+ (last (string-split line #\/)))
+ read-tags))
+ (tag->version (first valid)))
+ (package-version package))))
+
+;; Not guaranteed to always work correctly since you can self-host it.
+(define sourcehut-git-package?
+ (let ((hosting-site "git.sr.ht"))
+ (git-url-predicate (lambda (url)
+ (match (string->uri url)
+ (#f #f)
+ (uri
+ (let ((scheme (uri-scheme uri))
+ (host (uri-host uri)))
+ (and (memq scheme '(http https))
+ (if (string-match hosting-site host)
+ #t #f)))))))))
+
+(define (latest-sourcehut-git-release package)
+ "Return the latest release of PACKAGE."
+ (let ((name (package-name package))
+ (old-version (package-version package))
+ (new-version (latest-git-tag-version package))
+ (url (git-reference-url (origin-uri (package-source package)))))
+ (define (ensure-trailing-slash str)
+ (if (string-suffix? "/" str) str (string-append str "/")))
+
+ (if (not (string= old-version new-version))
+ (upstream-source
+ (package name)
+ (version new-version)
+ (urls (list (string-append (ensure-trailing-slash url)
+ "archive/"
+ new-version
+ ".tar.gz"))))
+ #f))) ; no tags
+
(define %gnu-updater
;; This is for everything at ftp.gnu.org.
(upstream-updater
@@ -849,6 +932,13 @@ the directory containing its source tarball."
(pred (url-prefix-predicate "mirror://kernel.org/"))
(latest latest-kernel.org-release)))
+(define %sourcehut-git-updater
+ (upstream-updater
+ (name 'sourcehut-git)
+ (description "Updater for packages hosted as SourceHut Git repositories")
+ (pred sourcehut-git-package?)
+ (latest latest-sourcehut-git-release)))
+
(define %generic-html-updater
(upstream-updater
(name 'generic-html)
--
2.31.1
L
L
Léo Le Bouter wrote on 9 Apr 2021 12:54
Re: [PATCH 0/2] Add updater for packages hosted as SourceHut Git repositories
6b8ddedae2addf01efa57dcf3a6723bed81bf076.camel@zaclys.net
On Fri, 2021-04-09 at 11:02 +0200, Xinglu Chen wrote:
Toggle quote (34 lines)
> This adds support for updating packages hosted as SourceHut Git
> repositories. It looks at the Git tags on the remote (thank you Léo
> for
> pointing this out[1]) to determine the latest release. It won't be
> as
> reliable as the GitHub updater, but still better than nothing, I
> guess.
>
> SourceHut also has support for Mercurial, but I am not familiar with
> it,
> maybe I will look into it in the future. :)
>
> See it in action:
>
> $ ./pre-inst-env guix refresh fennel
> gnu/packages/lua.scm:1176:13: fennel would be upgraded from 0.8.1 to
> 0.9.0
>
> [1]:
> https://yhetil.org/guix-bugs/f8aad9c186074f29907952a6740c09faf0820cac.camel@zaclys.net
>
> Xinglu Chen (2):
> upstream: Add predicate for Git URLs.
> gnu-maintenance: Add 'sourcehut-git' updater.
>
> doc/guix.texi | 3 ++
> guix/gnu-maintenance.scm | 90
> ++++++++++++++++++++++++++++++++++++++++
> guix/upstream.scm | 20 +++++++++
> 3 files changed, 113 insertions(+)
>
>
> base-commit: 29a6c361492b18bcb0f6d2517d010a1b48441521

Thanks a lot for working on this!!

I have a question, why do you name it specific to Sourcehut? It could
also work for Github, Gitlab, Gitea or Gogs etc., e.g.

d230516d81971cff4c8b68adeb2aa29684f20cd9 HEAD
d230516d81971cff4c8b68adeb2aa29684f20cd9 refs/heads/master
19b46ab2b545a75c4cea25fd2f8a6647bfeeebc3 refs/heads/release/1.0
126e0482d05a0da61e6f8770e97c1cc8e64b5d23 refs/heads/release/1.1
6580c4e94e0fd40a79f0f13c12bf183b4f321e6d refs/merge-
requests/100/head
e1ecb3efb904461fec9612b9c6472b0845af9b97 refs/merge-
requests/101/head
e1ecb3efb904461fec9612b9c6472b0845af9b97 refs/merge-
requests/102/head
ae0b8406d3070f13e647b7c649510fc2e8d982dd refs/merge-
requests/103/head
a1e8a9c2b487124edebf57cd355f23638aa01421 refs/merge-
requests/104/head
893258bb220a13d8d9b91201ce44a508347e3d90 refs/merge-
requests/105/head
395f05073562e4cab8d0b6742bfd655ea889d9a8 refs/merge-
requests/106/head
d7ca4da82a5df1238696b1b21fd84bc4560e197b refs/merge-
requests/107/head
15ea0b574f74774a8368ec00cd36c5e9e8f14343 refs/merge-
requests/108/head
5a0d8f184753b88427a3adc8ffbbc065b6454333 refs/merge-
requests/109/head
2295897f102f9bd2a773462d4ced0338a0cd5a6e refs/merge-
requests/11/head
7215796d7a37a8277c2936c13c037e0a915e6d3e refs/merge-
requests/111/head
64c0205bf3d842170153f80b0a0581a75bb6bfe0 refs/merge-
requests/112/head
1eb769d39203ee2a0e0dff59a713a19067742eb0 refs/merge-
requests/113/head
f4f60a3c8f8548b9a3e3e50d50149418c490237e refs/merge-
requests/114/head
5c7eb588293d03a975319b79c1ad2c54d3305bf0 refs/merge-
requests/116/head
43fee93e511c90e79ef9456da5d9e12b964fe9b6 refs/merge-
requests/118/head
014da7b0785474d35cfa6adc39846a64c07d4e66 refs/merge-
requests/119/head
e1a0ada22b9f3fae61f7d06d4e49fd6087039524 refs/merge-
requests/120/head
0332e1fc5823c03fcdeae8c6da9488efc685c1a5 refs/merge-
requests/121/head
d7f22959fa05f4e2d7fc6f354572b269c0857d35 refs/merge-
requests/122/head
e61f8e03c6217866a4c7bef5cfe2a49116a3189a refs/merge-
requests/123/head
be3c1c5b470cf0abf88e4574110bb3c4c008b64a refs/merge-
requests/125/head
a7c445e3a5add45918210309ed133b7ef3fa0491 refs/merge-
requests/126/head
6bb0295443ce9a838b54de1e24d7711827197772 refs/merge-
requests/127/head
72e5f8226f7e3e56b77e8555c9d7075e43830ca0 refs/merge-
requests/128/head
8a97d6f7fe494e8f603d54b28c48c9769f67c5c9 refs/merge-
requests/130/head
1495843c8173f60d32af0153e5c987efbb6e6bcd refs/merge-
requests/131/head
eee3c198d713476c49cdfea936409bd091e123e0 refs/merge-
requests/132/head
3b639dca636f51fc319b695f0998b8eb30433e48 refs/merge-
requests/133/head
5c75c198b4f774fc6647832321132b0ccafcc6a9 refs/merge-
requests/134/head
e35da4033af571aec4f440a8b2e4efe9a2309f46 refs/merge-
requests/135/head
9ec91fd59bd5055433af6fd9fbc2f520b4913d10 refs/merge-
requests/136/head
3398e65e19ee15899434cccdda07500c6659a862 refs/merge-
requests/137/head
16eb2d4d51b38b9d7474f67c1721fe119d09a8a1 refs/merge-
requests/138/head
c2a303d359faf44248a8d73afbe549b38be44e79 refs/merge-
requests/139/head
58f7adedde50246a502521f76f4e26ab47fa21f5 refs/merge-
requests/140/head
98fe22eee606175befbfec032242c6e4d66bb91e refs/merge-
requests/141/head
01c44617991bca49539acbf5d4df0594a59c9a4d refs/merge-
requests/142/head
4fe9c7adcaa322bb0bbe35064b2113e146e58c14 refs/merge-
requests/144/head
cecc1bfed95f13b1a6262f1b7d6fde4e9feff56a refs/merge-
requests/145/head
5561ee46edbb029104009f9d47167f9927b91863 refs/merge-
requests/146/head
1a21fbbe29c604dccbc2fd39b77bb6525932b377 refs/merge-
requests/147/head
beefd837e1b9ded394fd809f51446aff3c185bbc refs/merge-
requests/148/head
acee367a75627a5a081e97a556da7440ee6c21ca refs/merge-
requests/149/head
06a386852d6598460fa3c27143848eb834597020 refs/merge-
requests/15/head
b541fe34f27d1a203cfb07fa9d826a661d1d8946 refs/merge-
requests/150/head
9b1fbaff125f040261e137a14eb8654bb9d6e5e2 refs/merge-
requests/151/head
d1040e709d88a750063ecc6583878045dd123d81 refs/merge-
requests/152/head
4bdb2d59beb1d10e6e7939e964f06fb91dbb0627 refs/merge-
requests/153/head
cd8510b080d79f39e0e950f49a72dce303a9adac refs/merge-
requests/154/head
84dd70f7bffee9b683269451d0beea104a23099d refs/merge-
requests/155/head
36441f15cc13e6843096f023ef376651cc9bf756 refs/merge-
requests/157/head
687072009f9abf7425c942e16b58c4de1c9d3c33 refs/merge-
requests/158/head
33ad8a5c4df4f8443530f63d0450d42c2e27cc0f refs/merge-
requests/159/head
22ef30097d6a2e4959ced73c69d2fe3ee0ac2f30 refs/merge-
requests/16/head
c71902b802e623868290adefd36d6a49a9886a36 refs/merge-
requests/160/head
1e58131ede1a20ada23c5ffbdba49e219d82919e refs/merge-
requests/160/merge
e74e4a5792e9b190313b884f2bce21b4683b1406 refs/merge-
requests/161/head
8135cb92e8e415fd3e1ed141e06299b8a90a77af refs/merge-
requests/162/head
5c20602d5c7d045918aee3237ea6df958f9f979c refs/merge-
requests/163/head
cd8b79da18d212775b4b4ab2461d51e3a766e5a7 refs/merge-
requests/166/head
e725d9f01e002bacd34096ff59d769bce880a512 refs/merge-
requests/167/head
2b4e0ca945a6bdf864df3109a080fa75d73f09b2 refs/merge-
requests/168/head
2497a5b87ed35f06d46d60464a96b7887fdd8b77 refs/merge-
requests/168/merge
eadd3f14376206d5b254658753c830658b645e31 refs/merge-
requests/169/head
5ede2ebbb956e19ae5435868f621f5189f4666f9 refs/merge-
requests/17/head
f2c62d2205df33d392e197c82a8ee3311fd0268d refs/merge-
requests/170/head
6df07f3352b8837e6c55fa52754749667c4bdab2 refs/merge-
requests/171/head
c10fb9f70030ab75f68e4f08070fcfc21f04ec28 refs/merge-
requests/173/head
3dff736cd96dce5e633db6fc665fe91834020cbd refs/merge-
requests/174/head
6511a335f230b495d97e86ae4e927f4631e8f92d refs/merge-
requests/174/merge
33962d764c39dedce8f565e7fcf280658befd7b5 refs/merge-
requests/177/head
5d52a4d3e3a19994feab922d74ef27e31ec88ad4 refs/merge-
requests/177/merge
7f7a5ec03bb3be22ed4ae23dbb72fb84f386b16a refs/merge-
requests/178/head
09efec47082697d512542a613dab693087162ec9 refs/merge-
requests/178/merge
e97bb32601eec422d90dfc7062c83d2608a2750f refs/merge-
requests/179/head
b903d094b7e41102f3cd10e7969df8838d7ec343 refs/merge-
requests/179/merge
03cbc94dbaefdc24be3617f7f76d0a4780a85249 refs/merge-
requests/181/head
c6f1dd91e5873d2a1f33e5f9b33056306eb1d377 refs/merge-
requests/181/merge
ddfc0e71264ee8b206625c45f20ac902501f55ea refs/merge-
requests/182/head
8e608c82e46362f6a61ce133d91d903594872675 refs/merge-
requests/182/merge
cb4052c2adfb84439175ececfbe293ed49339d30 refs/merge-
requests/183/head
2ef89f0562b16a14ddf14b9009483aa6d12314e0 refs/merge-
requests/183/merge
014dd7d0ecfde87951d6f97ba3bebc577f9b7961 refs/merge-
requests/184/head
e940e13fc14d726d46977d6c203a237d0969603e refs/merge-
requests/184/merge
18d7f24a989b501fa2d3d65082bfaa238585b1cc refs/merge-
requests/185/head
6262b4aaec8239e1192e6fe3793f51d9d4ae8616 refs/merge-
requests/185/merge
7d4b29df64cb79025817c2f7ef512f7ddebbe00b refs/merge-
requests/186/head
279efe7c05ab5b79c6ab030edce94ec1f57bf3e9 refs/merge-
requests/186/merge
fb787bcc92df3de53344730402b1d2d4a231d5eb refs/merge-
requests/187/head
f6e793d827e619e1cf633354e26e5e25734861cc refs/merge-
requests/188/head
4b4bd869ebc9c5053d5ebd7390bc266b311f150b refs/merge-
requests/188/merge
571b7d7afc102e9a9a9b8086d58fed50b3025830 refs/merge-
requests/189/head
34fd7d332b0e47e5acda664d6ae89d81e3f49b85 refs/merge-
requests/189/merge
ce15f625bd903e3053999950f5a9e399d62cf9bd refs/merge-
requests/19/head
1858c93ef4a917a585fb7b3e34d65c591e5501a4 refs/merge-
requests/191/head
7ff1da023e751541b10f84bbc6e6b91526337793 refs/merge-
requests/191/merge
5cd64bdd1d15baa7009b7f1cae82858981d8824a refs/merge-
requests/192/head
b6f42d9a4da86a467c8b37c9e0820aeca2551ca2 refs/merge-
requests/192/merge
ae561f893bb2c427fbe0a9d8a8f093e55670f406 refs/merge-
requests/193/head
808f7dbbc25a48d10e61a6685b02ddbbd2bd239f refs/merge-
requests/193/merge
fc9702561fa19f1b8c2fd5885793fb1bbfda8def refs/merge-
requests/195/head
03a92d69b5cca5fc125399f392e40f018a3a1912 refs/merge-
requests/195/merge
fc9702561fa19f1b8c2fd5885793fb1bbfda8def refs/merge-
requests/196/head
40956889efe21693f2ef0c4c2521444432a4cd13 refs/merge-
requests/196/merge
fc9702561fa19f1b8c2fd5885793fb1bbfda8def refs/merge-
requests/197/head
4598211a22df9c07992523d9e351211c0f7c4b1f refs/merge-
requests/197/merge
7a720abaec9964c53bd746c50f13389b41654f4f refs/merge-
requests/2/head
c95c00276000f48f1ac2d211450f54454e74fe9c refs/merge-
requests/201/head
c184a979036dfb3c97ff74d5b047f79962eb3390 refs/merge-
requests/201/merge
278a7a27bba0051e9051a6e557c2db41eb3dfe4a refs/merge-
requests/202/head
b32042f79dd31ba02a32f5466b7ecfa1778c913c refs/merge-
requests/202/merge
cb31123d950b76e7130b48d43bf777de25a705ed refs/merge-
requests/203/head
8bc30ec82e872b28f6384e41e4555997605d14c9 refs/merge-
requests/203/merge
bf228e83fdd4695a349ab051512af7281aa86fc8 refs/merge-
requests/206/head
60ed8eefe9e453e070cd666f1a6f930261965eda refs/merge-
requests/206/merge
0553672357d98379e7c84854511d77f95ba599c9 refs/merge-
requests/208/head
8f86004039f072cf97187139b8495e503a64ea4d refs/merge-
requests/208/merge
4a31e1b6be3b478cb283263432c35cdb98865039 refs/merge-
requests/209/head
5c747a08bf2e05b26ae2e0e061a44d9696c176c4 refs/merge-
requests/209/merge
e383b82ed6847cc94126998957e95447cae25010 refs/merge-
requests/21/head
fe8458328769a3265675844058c0a8e56f1e872f refs/merge-
requests/210/head
7e05e2be405bf113f334a3fbc064fa7ff3fc4be8 refs/merge-
requests/210/merge
57af6ce3d4614051203a38cd30402ed78b8e7c1f refs/merge-
requests/211/head
a3ce9aca070ea9567e9b64a07bbc01a163fe795b refs/merge-
requests/211/merge
82917f40e5671d3831189f95e7fa0b8800f3affe refs/merge-
requests/212/head
a2a788ae02be579ea4f64fb9c425af3f6dffa0d5 refs/merge-
requests/212/merge
1782e77c5947004d7d605c9cf1435644219a84d3 refs/merge-
requests/213/head
96b1c06bd9438a2c88a0090dc51e5b731dcd9e87 refs/merge-
requests/213/merge
1498b6fb4468d00f93037bd5ba1eacab681e0d88 refs/merge-
requests/214/head
898d64fee3c2dd2620d143aeb78deb4853ea289d refs/merge-
requests/214/merge
f68e858163b8b60ad11bbcd3dc26fe1582666006 refs/merge-
requests/215/head
14e41a6082ecf0bcf447ff34f6434a257b851fb6 refs/merge-
requests/215/merge
60c461fa19c159a71d537e05d64bbddea6564156 refs/merge-
requests/216/head
9f643545da77446204f4d1676c0ce5a5a1231ec0 refs/merge-
requests/216/merge
564b5a59eaebcdfa4621bcb2a30567c36d725020 refs/merge-
requests/217/head
ddd3bd8841299ecf0349b7fcd64cc3859b4f68d9 refs/merge-
requests/217/merge
9734f5e6801c469c815c3edcc226caa194263668 refs/merge-
requests/218/head
a35ed86f68b59c63de744e4b3f0fddb1d66ff5da refs/merge-
requests/218/merge
a26bee998937c6b40c767c178c37d4b41afbbf63 refs/merge-
requests/219/head
426b0e2775eab70145cf848ee7025bdb23ee6033 refs/merge-
requests/219/merge
c62b21f49d5c39828ed73f4f6a4ba5025f85ba40 refs/merge-
requests/22/head
f41d97b777fe3efc0bbe534333b90841732c5fb6 refs/merge-
requests/220/head
c55c0a86865526ffe9660f1d18603168f5ff3d03 refs/merge-
requests/220/merge
9b93be581813a5008b6d011757e234fbb0f7c0ee refs/merge-
requests/221/head
e60ca7571788a4388dc554bd1986f15355a52b53 refs/merge-
requests/221/merge
d825d376c1419dcf86414da46233963599bf59ef refs/merge-
requests/222/head
280245847c75e7e24aa60f12ea82977aabd6706f refs/merge-
requests/222/merge
b15ebaab2253210cc5db7931f806966972f180c4 refs/merge-
requests/224/head
d1931b2d7ab4575be5c0b557f3bdd7846f3f40e0 refs/merge-
requests/224/merge
03c99ad5beefeac4474b5a00c840fd9debccba02 refs/merge-
requests/228/head
c3b17d7ce8597d8095f68b4c5a11fa2b7f8ff7dd refs/merge-
requests/228/merge
f845dee0746bf393d5c24ed5084bf5de69fd8028 refs/merge-
requests/231/head
37b8dd48ff2dd8ff0b81a529a3bdfc55dc7d68fe refs/merge-
requests/231/merge
d2783cd0b7b4f64d1ee06c45d1373570b4983310 refs/merge-
requests/234/head
174abd1cdde98bd3b34d34f3e6e51454392346d7 refs/merge-
requests/234/merge
c102c6fd0c1c69eca73b1f297fe0267e9868eeb4 refs/merge-
requests/235/head
67183e4ada7ace655f35095c5382a3e2196c9a15 refs/merge-
requests/235/merge
499e133f109089c0b0665b56d8834fa074fbcf32 refs/merge-
requests/236/head
aa2174ec9bc3bf5d72c07a543105b1f73167878f refs/merge-
requests/236/merge
ab509181bdce4194b2f59717468baf89e641495a refs/merge-
requests/237/head
30da08fb5919a4422923f19af69f6748452c5505 refs/merge-
requests/237/merge
88c94ad207f0a38c45988ad1c22289106eb41871 refs/merge-
requests/238/head
97234e212bf4c3dc02cc81db0e6c6f317718335e refs/merge-
requests/238/merge
0a76d287c2395c8339e35f035160d026b208f4c6 refs/merge-
requests/239/head
991a6dda459eb412646788764af0a5c9ca0393b1 refs/merge-
requests/239/merge
026202853d2cde624809395446affc3961846e1a refs/merge-
requests/24/head
ff06d276ecfbbcc2d778a60dcffca2e442ee01c7 refs/merge-
requests/24/merge
3ebd40dae7db7fdbef4dd567c92859c7d4e49573 refs/merge-
requests/241/head
36837dca2bc3b27f3f08c8d1e58636a652b7e01b refs/merge-
requests/241/merge
0649c1c158a2b1ca8d628625acbf0ab2780baecb refs/merge-
requests/242/head
99ef9b8078b92d4a23023a3b5c4ff79a8806e05b refs/merge-
requests/242/merge
cb236e8855e53de2de43c1b0dc2eafd1166416cf refs/merge-
requests/243/head
9d388bf056b6276ea828fc453327661f4bcb28f0 refs/merge-
requests/243/merge
431d462a9466753f5e08424a3011f230e82bd853 refs/merge-
requests/244/head
6e41430f5e03fee68251952ae97216f9ef04a689 refs/merge-
requests/244/merge
0e2427caa9bf2d6a8e97c78da29ff038801135f5 refs/merge-
requests/245/head
aefc15265007b936b8cf899244634177ece24557 refs/merge-
requests/245/merge
89d07fb0f80ac47ad345993805a58b485bb72b83 refs/merge-
requests/246/head
377d8c0d757982a236b67bdee21d12c310193502 refs/merge-
requests/246/merge
566654dab8afacb006601e939d3b06dda528c22d refs/merge-
requests/247/head
f38ee12d541bd1f8ae552183b6ddb124824d9ce5 refs/merge-
requests/247/merge
9acf7c5b823ed2a3967d04f8cf1cf02c4f76fe07 refs/merge-
requests/248/head
8aa64d3c43112888bbec4fc2380d5b48ff1ce541 refs/merge-
requests/248/merge
08db2c05446f37ec248adf000fa75b45aade5ded refs/merge-
requests/249/head
208759afeaa2bb6eece8b7b8702bbb45cf7b114d refs/merge-
requests/249/merge
74270753b8a6d83b0bac54bfaf55d6435ddeb978 refs/merge-
requests/25/head
ddae2298ba66643b380b1eeef29a877c70259b91 refs/merge-
requests/250/head
abb73c3e6b41fe9addc87052781d99deca27a126 refs/merge-
requests/250/merge
2060804bc90467f1393973289ee4d65dad54080c refs/merge-
requests/251/head
9e812be0762cb6f97d998be81e94f19bb2963c1a refs/merge-
requests/251/merge
65fb69d61b805bb7aa713924def21b7652e91124 refs/merge-
requests/252/head
9c1b7330a26424392aab5b76afada801d285a382 refs/merge-
requests/252/merge
e95a01c43af406056f411adde79a3987877d565b refs/merge-
requests/253/head
3af73dbf2a7fb709187aaa6ab8537657c9986e3e refs/merge-
requests/253/merge
38d8107616486d0e8ac271bab89e3a0f6e208d96 refs/merge-
requests/254/head
780e54ed2528b1c1b6e0f973a3422aec866df374 refs/merge-
requests/254/merge
f3f46b4c82bfe8b7faf55e43c42d2fe5c1e76df6 refs/merge-
requests/255/head
6fbb42f56b1f5aea7ed4355dcdefa2f1a2fcb13f refs/merge-
requests/255/merge
74c4ff926e2938c44f07024b8688663aefe818d5 refs/merge-
requests/256/head
b80e8a356f118fbf64dc668b7628fd8f5486c1dc refs/merge-
requests/256/merge
b87dd3a031ed361807f1c5ae5311551210e87317 refs/merge-
requests/257/head
a037bf2fd3c05a8d90232a7d810310da85b3c454 refs/merge-
requests/257/merge
eaee2d5f667426950c2c461b3c78e4b761e0a617 refs/merge-
requests/258/head
0aeef4f531f2ec4a29556bfffbd720c573fc8820 refs/merge-
requests/258/merge
a7854fe653439a0474f07496757ce4a1debd5b1a refs/merge-
requests/259/head
130c6824fcaefb09e3e6adc6cc033e27e33d3bc1 refs/merge-
requests/259/merge
e93305b32e395d1d9d2ad29da4a56c7809fcb3e0 refs/merge-
requests/26/head
4794ea7fbf13025cfeb14a6eda3befe825df2791 refs/merge-
requests/26/merge
d5da351c666291e76b089d0e58b96aaec7a7dd86 refs/merge-
requests/260/head
4a0fada7eac788478ff902903fd540f27a9c28be refs/merge-
requests/260/merge
9a8abf100bca7ec6b74fdd935a4cb5b9d059f25b refs/merge-
requests/261/head
eaddf518cb8f9a3cc2cd8eabcf7242583692f0fa refs/merge-
requests/261/merge
14e36b4eff676c5c111bbf3d2b529e4784bd0434 refs/merge-
requests/262/head
fd91ac255d2dabe358499862825c2cecbbd905d2 refs/merge-
requests/262/merge
ace7708a8013e2db17e1aa039c2f234d4d66ef45 refs/merge-
requests/264/head
199b0165f4d747c937d0808e0bdc6e5bbe56a529 refs/merge-
requests/264/merge
c8f47075e5c9e962c906abbb9089021b0a92a43e refs/merge-
requests/265/head
a0a2a0e3d77f0a6a802f140e0e53f04871b56896 refs/merge-
requests/265/merge
8feb164198db2011a3ebb04dda9ff49675224f14 refs/merge-
requests/267/head
3a4f817376255e9ae70428c7264359a1cdc04331 refs/merge-
requests/267/merge
5ebbc697819c44d121ce9d0b20d20ffd8538ffae refs/merge-
requests/268/head
7efea243bf3027c7e979f9286246301338975736 refs/merge-
requests/268/merge
6791affb7b1eefdd788287936b22fa2192ffe46f refs/merge-
requests/269/head
1e8a037ca27f21a2ae0b3c98871b8dd6642d6d57 refs/merge-
requests/269/merge
5403d4af6608bb603a35e40542c47cff2f1b8e50 refs/merge-
requests/27/head
e112877296315df2d6079091e218c150a04b7de4 refs/merge-
requests/270/head
8c1f8ab5216003fd1054128214d756b01dd40094 refs/merge-
requests/270/merge
4d8a3c26fde066e569fada612eaf1374c6be3be7 refs/merge-
requests/271/head
565461bc546675b777bfe9a0438ec240940a96e6 refs/merge-
requests/271/merge
3436496f652f6b903549040b9678e0c467f6366c refs/merge-
requests/28/head
0af78fb4f353200170067b258d6a7693ba0c3a61 refs/merge-
requests/29/head
81ef46796be4142aec046d5a2e87e6269e998e3d refs/merge-
requests/298/head
5fc1dbdfe290f35daf2e1cd702b9b8c185599bb1 refs/merge-
requests/298/merge
b581a98b8db8f0a41694c368ad455ead3394ebd6 refs/merge-
requests/30/head
0cc94eb0ef94eb3f73b28cd139554de4226614f8 refs/merge-
requests/300/head
ebf73a22196704cae4474610e6314c64bb570de2 refs/merge-
requests/300/merge
2069b94a45533ea59f18e9c6f8aa4a5fc4df62d2 refs/merge-
requests/301/head
35325745fedcefab5c7e5ffad79ec1ceda00acb6 refs/merge-
requests/301/merge
d88b4c43eac5ebf357084db3d8697896ed4c2c32 refs/merge-
requests/302/head
17e43af30bd0ae580d97aa716f061aa14b502a71 refs/merge-
requests/302/merge
22067cbeee32852429c6f148c3957aadcebe75c8 refs/merge-
requests/303/head
7c75c8db1210fbdb53a3cbc077ee4cc5673ea862 refs/merge-
requests/303/merge
7b449322d5f6d6fb1971d45830c4f9cdc644a8fa refs/merge-
requests/304/head
e545c3013af06064a08469a9cd10678b907e94d0 refs/merge-
requests/304/merge
4b7f3b4cab9f9e521c3f9c9683ed5849f813e1b3 refs/merge-
requests/305/head
f855fc58dc31d5f7020ed17e460331ddbd79a798 refs/merge-
requests/305/merge
e75bde84c89ffaeb59a3213129ddf6585dca09f5 refs/merge-
requests/306/head
0620dc17bc1cfa731acc64e3421301b50c71d91f refs/merge-
requests/306/merge
155a578880994ed7db2864127cb902de1ba1711c refs/merge-
requests/307/head
fd68fd1e5427f48925fff02fa6b0b291fc81830c refs/merge-
requests/307/merge
79590070d9bee6ee679f610dd85add65c1049e04 refs/merge-
requests/308/head
721de09ea3678c7c72b2752da95d8391c2abdc31 refs/merge-
requests/308/merge
50c6a63dc71553d39c72b1ef285d7e6b697d32dc refs/merge-
requests/309/head
620b3bd8f51cebdf2ef56c8966a553f64c4d5612 refs/merge-
requests/309/merge
688b4331fe1423f4e5d2300bc8bbe3bff0015f6d refs/merge-
requests/31/head
b8fa45efa75dc3f668784fc3a4741ee559dbefe7 refs/merge-
requests/310/head
d0aa
This message was truncated. Download the full message here.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBwMmgACgkQRaix6GvN
EKazMw//cQa7vnmul6HvdMDHXmKtpeJDXCIynswdu7yLa56SoTuPy44X9Dbz+zIj
miVzsggubqtUfFXL4PpjiRZ3I6+d9CInuFuE3qEhoUnDQspinvzwm2BkyUEL2YJ4
re/+71rbbDZlfx0YKGSgAaTkwT4M0PytovBx/hxMAp/h7+CptLomRajoFkkxo6I2
VN8Up6f+iOpG2+UFRNaUpnPS2isy2sNbpfTd/hGTpyzWGgZ31125CEJH0TYwLRAD
QstfyhfaEWjsFffxSpu6I8kiCuPJYCbZMLpsA5bPXJFg1XRZozgxxALCmwJYkFI4
3xIbb6zOO7AnGIFCoaNYRR6SLhQba6O6fOaIXZGy42/CYDa3DZNVmnKy0MOXggfY
wwmnbANE5pRWKyYw6qsfzC/ukqPjgPxLbzp9CKpihTmHPF9aubbpIFtoAML0+Eh5
8c64RUi4qWsDcgFe6kxJJDbi9t2SsAbvrTDayuQm3GbSlAlWIrL1SSJ0r1JUFxS7
YL9olRaYpG3xt1HRAL6/eqU9ChC7GZ3RcWMgtAHT1m16Vf6f41cXC0onq0Cw1IKL
GpMh5deU++5HQ1aO6cUqoNAOj4rZnKdNwC6oM4NMzGR4wS5LOKwQ1KvSqi7Omgac
llKHE3K/qmtEGxLKZuHsOdCKZCkzMwmmsgnwTVhZ72KXx4JN2wc=
=pJ6v
-----END PGP SIGNATURE-----


X
X
Xinglu Chen wrote on 9 Apr 2021 13:58
Re: [bug#47670] [PATCH 0/2] Add updater for packages hosted as SourceHut Git repositories
87im4vwtyd.fsf@yoctocell.xyz
On Fri, Apr 09 2021, Léo Le Bouter via Guix-patches via wrote:

Toggle quote (2 lines)
> Thanks a lot for working on this!!

You are welcome. :)

Toggle quote (3 lines)
> I have a question, why do you name it specific to Sourcehut? It could
> also work for Github, Gitlab, Gitea or Gogs etc., e.g.

All the forges have different URL schemes so they would have to be
hardcoded somehow, e.g. SourceHut uses
something else, etc.. Maybe we could just clone the repo, but that
would use more bandwidth, and it could get pretty slow for big
repositories.

Toggle quote (11 lines)
> Also I suggest adding a property to somehow specify what the version
> number format could be in tags, and also handling cases where format
> changes from version to version because upstream has not been
> consistent with naming. You can see for Hyperkitty they don't have the
> 'v' anymore starting 1.3.1, but I also have examples where version is
> separated by '_' and not '.', some times with prefix like:
> 'release_4_2_1', it would be nice to be able to specify those formats
> with e.g. regex and somehow also be able to handle inconsistency in
> upstream naming, maybe some heuristic to generically match version
> numbers separated by ANY character with any prefix or suffix?

Adding a property for the tag prefix and suffix, and a version separator
would be a good idea. Right now it only supports "v" as a prefix and
"_", ".", and "-" as separators.

Toggle quote (2 lines)
> Thank you!! :-D

Thank you for the feedback!
L
L
Léo Le Bouter wrote on 9 Apr 2021 14:04
2513bc7a1e52872be1cd1b8ecde11e21a6f613e0.camel@zaclys.net
On Fri, 2021-04-09 at 13:58 +0200, Xinglu Chen wrote:
Toggle quote (8 lines)
> All the forges have different URL schemes so they would have to be
> hardcoded somehow, e.g. SourceHut uses
> https://git.sr.ht/~user/repo/archive/TAG.tar.gz, Gitea probably uses
> something else, etc.. Maybe we could just clone the repo, but that
> would use more bandwidth, and it could get pretty slow for big
> repositories.
>

Is that an autogenerated tarball? I am under the impression that usage
of those is banned in GNU Guix, and that there's a lint pass for it.
What do you use these autogenerated tarballs for? Is the 'ls-remote'
command not enough to replace the version and hash? GNU Guix uses
shallow clones (AIUI) to save bandwidth, do you need this to generate
the hash? I encourage you use the same shallow clone mechanism here, so
it's more generic and not specific to Sourcehut.

Toggle quote (5 lines)
> Adding a property for the tag prefix and suffix, and a version
> separator
> would be a good idea. Right now it only supports "v" as a prefix and
> "_", ".", and "-" as separators.

What do you think about that last idea of matching versions in tags
with ANY separator and ANY suffix and prefix? That should work fine,
right? I can't think of a case where it wouldnt, but please do share
one if you do.

Thanks!!
Léo
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBwQuAACgkQRaix6GvN
EKZpexAAk/t6gr+4F2H2gDjz+F9yCBl5qhstWkHIjnXJbwARuD7G61vdyo+2ZszO
2xjcXJj8lAUInjrAER6PixwwXZXzD6gMYhLYfqpbI7xWh36snDVF7pWcGW0bJyfM
eL03ZlL+pKWq0d5PfnpN/naSajmWWSTrshn9d5Jaqld+tdVHbvyYj6Jap3h1N9St
61xQlt2eKNoGbjiEOwuqpDxeLXjsqCrwrvM1luYIjeeZQKPbxgyATqehcrYm9UkL
FO2lAqLAIchqvx7oaqhB6cNZySQu5Gsb7Ma3EVMvLu+X3NfH+Cd9X9ppdbngP6J8
yVzvQ7hcdZds7EM32l2nBfu7L+9lZd6qXs/5xL0JltIjBnHVy++SPRz5I67Evdrr
AWGtbwrKPi2OVB/j9UXoxBeJdj8LNSOrbenhXOEWJFZOa75V3HHwoGCYJrOt4pJh
Gf6DzzDMuwmpfPXDMZCK8ZSYdixci/oldv6uzugZ0b+d80s4Kb3a6CAvdFOpVyU2
tT96DRQVSfVcwCHtUoFc1QxtbgOGeMZKbD2CgNDTEg+EsLRMoxAefZMaAA5ybLaP
DkiiBwc5STSgp5PBYjVE6H46iHPkrNQQOhPFg5x/eimqTZX9KsQpag4pMxT715xf
IlLlpsWCSa3gvvam6czYxzoKTFa4EZg/nvvKkScrONhhSs+Ng6I=
=y4r5
-----END PGP SIGNATURE-----


X
X
Xinglu Chen wrote on 9 Apr 2021 14:41
87fszzwryv.fsf@yoctocell.xyz
On Fri, Apr 09 2021, Léo Le Bouter via Guix-patches via wrote:

Toggle quote (14 lines)
> On Fri, 2021-04-09 at 13:58 +0200, Xinglu Chen wrote:
>> All the forges have different URL schemes so they would have to be
>> hardcoded somehow, e.g. SourceHut uses
>> https://git.sr.ht/~user/repo/archive/TAG.tar.gz, Gitea probably uses
>> something else, etc.. Maybe we could just clone the repo, but that
>> would use more bandwidth, and it could get pretty slow for big
>> repositories.
>>
>
> Is that an autogenerated tarball? I am under the impression that usage
> of those is banned in GNU Guix, and that there's a lint pass for it.
> What do you use these autogenerated tarballs for? Is the 'ls-remote'
> command not enough to replace the version and hash?

The GitHub updater fetches the autogenerated tarball so that's what I
did as well. I wasn't aware about the fact that we would like to avoid
them.

Toggle quote (4 lines)
> GNU Guix uses shallow clones (AIUI) to save bandwidth, do you need
> this to generate the hash? I encourage you use the same shallow clone
> mechanism here, so it's more generic and not specific to Sourcehut.

Ok, I will use shallow clones to make it more generic.

Toggle quote (10 lines)
>> Adding a property for the tag prefix and suffix, and a version
>> separator
>> would be a good idea. Right now it only supports "v" as a prefix and
>> "_", ".", and "-" as separators.
>
> What do you think about that last idea of matching versions in tags
> with ANY separator and ANY suffix and prefix? That should work fine,
> right? I can't think of a case where it wouldnt, but please do share
> one if you do.

Maybe it wasn't clear, I think it would be a good idea to have a
property field like this:

#+begin_src scheme
(properties '((tag-prefix . "some-prefix")
(tag-suffix . "some-suffix")
(version-separator . "some-separator")))
#+end_src

The updater would then read those fields and do some regex to get the
latest version. These options would probably also have some sane
defaults, like empty prefix and suffix, and "." as the separator.
X
X
Xinglu Chen wrote on 9 Apr 2021 14:48
87czv3wrnj.fsf@yoctocell.xyz
On Fri, Apr 09 2021, Xinglu Chen wrote:

Toggle quote (17 lines)
> On Fri, Apr 09 2021, Léo Le Bouter via Guix-patches via wrote:
>
>> Is that an autogenerated tarball? I am under the impression that usage
>> of those is banned in GNU Guix, and that there's a lint pass for it.
>> What do you use these autogenerated tarballs for? Is the 'ls-remote'
>> command not enough to replace the version and hash?
>
> The GitHub updater fetches the autogenerated tarball so that's what I
> did as well. I wasn't aware about the fact that we would like to avoid
> them.
>
>> GNU Guix uses shallow clones (AIUI) to save bandwidth, do you need
>> this to generate the hash? I encourage you use the same shallow clone
>> mechanism here, so it's more generic and not specific to Sourcehut.
>
> Ok, I will use shallow clones to make it more generic.

Umm, the 'upstream-source-compiler' uses 'url-fetch' to fetch the url, I
guess we would have to make it support Git repositories first.
L
L
Ludovic Courtès wrote on 6 Jun 2021 15:23
Re: bug#47670: [PATCH 0/2] Add updater for packages hosted as SourceHut Git repositories
(name . Xinglu Chen)(address . public@yoctocell.xyz)(address . 47670@debbugs.gnu.org)
87zgw3jfed.fsf_-_@gnu.org
Hi!

Xinglu Chen <public@yoctocell.xyz> skribis:

Toggle quote (22 lines)
> On Fri, Apr 09 2021, Xinglu Chen wrote:
>
>> On Fri, Apr 09 2021, Léo Le Bouter via Guix-patches via wrote:
>>
>>> Is that an autogenerated tarball? I am under the impression that usage
>>> of those is banned in GNU Guix, and that there's a lint pass for it.
>>> What do you use these autogenerated tarballs for? Is the 'ls-remote'
>>> command not enough to replace the version and hash?
>>
>> The GitHub updater fetches the autogenerated tarball so that's what I
>> did as well. I wasn't aware about the fact that we would like to avoid
>> them.
>>
>>> GNU Guix uses shallow clones (AIUI) to save bandwidth, do you need
>>> this to generate the hash? I encourage you use the same shallow clone
>>> mechanism here, so it's more generic and not specific to Sourcehut.
>>
>> Ok, I will use shallow clones to make it more generic.
>
> Umm, the 'upstream-source-compiler' uses 'url-fetch' to fetch the url, I
> guess we would have to make it support Git repositories first.

Yes, that’s a limitation of (guix upstream) right now.
‘%method-updates’ was a first step in the direction of supporting Git
repos.

Now, I agree with Léo that (1) this is not SourceHut-specific, and (2)
it should not download generated archives.

Also, I’d prefer to have the code rely on Guile-Git to list tags rather
than invoking ‘git’, if possible. Perhaps that code could leave in its
own (guix import git) module or similar, rather than in (guix
gnu-maintenance), which already has little to do with GNU maintenance at
this point. :-)

Thoughts?

Ludo’.
X
X
Xinglu Chen wrote on 11 Jun 2021 11:25
Re: [bug#47670] [PATCH 0/2] Add updater for packages hosted as SourceHut Git repositories
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47670@debbugs.gnu.org)
87lf7gbvmx.fsf@yoctocell.xyz
On Sun, Jun 06 2021, Ludovic Courtès wrote:

Toggle quote (30 lines)
> Hi!
>
> Xinglu Chen <public@yoctocell.xyz> skribis:
>
>> On Fri, Apr 09 2021, Xinglu Chen wrote:
>>
>>> On Fri, Apr 09 2021, Léo Le Bouter via Guix-patches via wrote:
>>>
>>>> Is that an autogenerated tarball? I am under the impression that usage
>>>> of those is banned in GNU Guix, and that there's a lint pass for it.
>>>> What do you use these autogenerated tarballs for? Is the 'ls-remote'
>>>> command not enough to replace the version and hash?
>>>
>>> The GitHub updater fetches the autogenerated tarball so that's what I
>>> did as well. I wasn't aware about the fact that we would like to avoid
>>> them.
>>>
>>>> GNU Guix uses shallow clones (AIUI) to save bandwidth, do you need
>>>> this to generate the hash? I encourage you use the same shallow clone
>>>> mechanism here, so it's more generic and not specific to Sourcehut.
>>>
>>> Ok, I will use shallow clones to make it more generic.
>>
>> Umm, the 'upstream-source-compiler' uses 'url-fetch' to fetch the url, I
>> guess we would have to make it support Git repositories first.
>
> Yes, that’s a limitation of (guix upstream) right now.
> ‘%method-updates’ was a first step in the direction of supporting Git
> repos.

One of the problems with adding support for Git repos in (guix upstream)
was that Libgit2 (and by extension Guile-Git) doesn’t provide an API for
verifying tags, the I only way I know of is to run ‘git verify-tag’ in
the shell. There is a ‘git_commit_extract_signature’ API, but it only
for individual commits, and since the majority of people don’t sign
their commits it means that a most of the time its not going to be able
to verify the checkout.

Toggle quote (6 lines)
> Now, I agree with Léo that (1) this is not SourceHut-specific, and (2)
> it should not download generated archives.
>
> Also, I’d prefer to have the code rely on Guile-Git to list tags rather
> than invoking ‘git’, if possible.

Libgit2 has a ‘git_tag_list’ API, though it doesn’t seem like Guile-Git
supports it.


Toggle quote (4 lines)
> Perhaps that code could leave in its own (guix import git) module or
> similar, rather than in (guix gnu-maintenance), which already has
> little to do with GNU maintenance at this point. :-)

Yeah, I think that’s a good idea :)
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmDDLBYVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5sqAQAJdux5Zhi45qOdFJupG7RRtenYXD
93CI2I4tYqdm7enHXLOB9yxbZ+Hfk7t4rr0mBDLtDs4j3GvtYAOak6+lM9+02WJu
TkzjeyTZNtAEWWRX2+QsG2Ei/Na/ah4fPAotsZXeYK63hHKJW7FtuCdb0UBJfJbw
MeqBTj9w4PEqJl90h6/yMw+l3094js+mrz07mEqYqcNB5vgJKzCXWPsdj7KGoGf+
vyvwnFNrr6v87SaFBtp01ftxMWEAA0XP9wHyKqVxg6JUOMSSoXCLod7gXMkKN5xc
SC3Mxsh28AuTfn9MQz77tnZQHYMLWk5Qk+XPFsl+gXmFE82Y1WxpQFJ3W+jQbVvu
o+Ql4j7beOrDL2UTeBHVW7i9IB0KOzIwMRheUaQ9P7QKkxo6unFB0TpJhUuoFQQm
im6SrmKaT3LpjBOSmSVigdsoXbEFPrHmCSMOEvR4BeIh+mknCKYAo+G8KhTgoK9R
sdUF/budK2H6zha7Fb2aIvFcQ3mbdMR98OysRClkwXboifruFqZ59VAl3djKqRlY
ed2gaXu6ss/s3HnMaqX9Ld0++W9kYJtengPlC452fiCZN22GAzgWfi8BZ4CfX49I
kkrFHnzyf+AhFBln3ugvwJ7/z2Fb6F2K6Fgn0EL1nPP34PCbe/Zqo1hlyKfXLE6V
az0q8SmOcYpUim6K
=30d2
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 27 Jul 2021 12:19
(name . Xinglu Chen)(address . public@yoctocell.xyz)(address . 47670@debbugs.gnu.org)
87lf5s3vp9.fsf@gnu.org
Hi,

Replying to an old message…

Xinglu Chen <public@yoctocell.xyz> skribis:

Toggle quote (2 lines)
> On Sun, Jun 06 2021, Ludovic Courtès wrote:

[...]

Toggle quote (15 lines)
>>> Umm, the 'upstream-source-compiler' uses 'url-fetch' to fetch the url, I
>>> guess we would have to make it support Git repositories first.
>>
>> Yes, that’s a limitation of (guix upstream) right now.
>> ‘%method-updates’ was a first step in the direction of supporting Git
>> repos.
>
> One of the problems with adding support for Git repos in (guix upstream)
> was that Libgit2 (and by extension Guile-Git) doesn’t provide an API for
> verifying tags, the I only way I know of is to run ‘git verify-tag’ in
> the shell. There is a ‘git_commit_extract_signature’ API, but it only
> for individual commits, and since the majority of people don’t sign
> their commits it means that a most of the time its not going to be able
> to verify the checkout.

The (guix git-authenticate) commit has code that retrieves the OpenPGP
signature and checks it. It can serve as inspiration.

Toggle quote (11 lines)
>> Now, I agree with Léo that (1) this is not SourceHut-specific, and (2)
>> it should not download generated archives.
>>
>> Also, I’d prefer to have the code rely on Guile-Git to list tags rather
>> than invoking ‘git’, if possible.
>
> Libgit2 has a ‘git_tag_list’ API, though it doesn’t seem like Guile-Git
> supports it.
>
> https://libgit2.org/libgit2/#HEAD/group/tag/git_tag_list

Ah, we could add it.

Toggle quote (6 lines)
>> Perhaps that code could leave in its own (guix import git) module or
>> similar, rather than in (guix gnu-maintenance), which already has
>> little to do with GNU maintenance at this point. :-)
>
> Yeah, I think that’s a good idea :)

Thanks,
Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 47670@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 47670
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch