build: Update push URL regexp for 'update-guix-package' script.

* build-aux/update-guix-package.scm
(%savannah-guix-git-repo-push-url-regexp): Rename to...
(%guix-git-repo-push-url-regexp): Update regexp.
(find-origin-remote): Adjust accordingly.

Change-Id: I3e6f1a1fb0b6921f7c263e9b93a47ac602b92f0d
This commit is contained in:
Maxim Cournoyer 2025-06-09 14:40:55 +09:00
parent 2d418933a4
commit 05afc4a72a
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -125,8 +125,8 @@ COMMIT. PROC receives the temporary directory file name as an argument."
(lambda () (lambda ()
(invoke "git" "worktree" "remove" "--force" tmp-directory)))))) (invoke "git" "worktree" "remove" "--force" tmp-directory))))))
(define %savannah-guix-git-repo-push-url-regexp (define %guix-git-repo-push-url-regexp
"git.(savannah|sv).gnu.org:?/srv/git/guix.git \\(push\\)") "(git.guix.gnu.org|codeberg.org/guix)/guix.git \\(push\\)")
(define-syntax-rule (with-input-pipe-to-string prog arg ...) (define-syntax-rule (with-input-pipe-to-string prog arg ...)
(let* ((input-pipe (open-pipe* OPEN_READ prog arg ...)) (let* ((input-pipe (open-pipe* OPEN_READ prog arg ...))
@ -138,12 +138,12 @@ COMMIT. PROC receives the temporary directory file name as an argument."
(string-trim-both output))) (string-trim-both output)))
(define (find-origin-remote) (define (find-origin-remote)
"Find the name of the git remote with the Savannah Guix git repo URL." "Find the name of the git remote with the Guix git repo URL."
(and-let* ((remotes (string-split (with-input-pipe-to-string (and-let* ((remotes (string-split (with-input-pipe-to-string
"git" "remote" "-v") "git" "remote" "-v")
#\newline)) #\newline))
(origin-entry (find (cut string-match (origin-entry (find (cut string-match
%savannah-guix-git-repo-push-url-regexp %guix-git-repo-push-url-regexp
<>) <>)
remotes))) remotes)))
(first (string-split origin-entry #\tab)))) (first (string-split origin-entry #\tab))))