lint: Append "/info/refs" to git-reference-url.

For the atftp package added in the preceeding commit, lint produced this
warning:

  gnu/packages/networking.scm:2924:5: atftp@0.8.0:
    URI https://git.code.sf.net/p/atftp/code not reachable:
      404 ("Not Found")

Thanks to Sergey Trofimov for suggesting a fix! [1]

  [1]  https://issues.guix.gnu.org/62156#3

It was implemented here, and the warning disappeared.

* guix/lint.scm (check-source): Append "/info/refs" to git-reference-url.

Co-authored-by: Sergey Trofimov <sarg@sarg.org.ru>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Felix Lechner 2023-03-20 21:25:41 -07:00 committed by Ludovic Courtès
parent 38e7813c03
commit c9af27d4ca
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 9 additions and 2 deletions

View file

@ -1224,7 +1224,14 @@ (define (warnings-for-uris uris)
'()))) '())))
((git-reference? (origin-uri origin)) ((git-reference? (origin-uri origin))
(warnings-for-uris (warnings-for-uris
(list (string->uri (git-reference-url (origin-uri origin)))))) ;; for atftp, lint produced a warning:
;; gnu/packages/networking.scm:2924:5: atftp@0.8.0:
;; URI https://git.code.sf.net/p/atftp/code not reachable:
;; 404 ("Not Found")
;; fix from here: https://issues.guix.gnu.org/62156#3
(list (string->uri (string-append
(git-reference-url (origin-uri origin))
"/info/refs")))))
((or (svn-reference? (origin-uri origin)) ((or (svn-reference? (origin-uri origin))
(svn-multi-reference? (origin-uri origin))) (svn-multi-reference? (origin-uri origin)))
(let ((uri (svn-reference-uri-with-userinfo (origin-uri origin)))) (let ((uri (svn-reference-uri-with-userinfo (origin-uri origin))))

View file

@ -1052,7 +1052,7 @@ (define (package-with-phase-changes changes)
(parameterize ((%http-server-port 0)) (parameterize ((%http-server-port 0))
(with-http-server `((,redirect "")) (with-http-server `((,redirect ""))
(test-equal "source, git-reference: 301 -> 200" (test-equal "source, git-reference: 301 -> 200"
(format #f "permanent redirect from ~a to ~a" (format #f "permanent redirect from ~a/info/refs to ~a"
(%local-url) initial-url) (%local-url) initial-url)
(let ((pkg (dummy-package (let ((pkg (dummy-package
"x" "x"