[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/29: website: packages: Add the commit in package source URLs.
From: |
Ludovic Courtès |
Subject: |
07/29: website: packages: Add the commit in package source URLs. |
Date: |
Wed, 6 Dec 2017 09:24:22 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix-artwork.
commit f0f931a9678f8a09203fb8879e8aba766c7e9cdd
Author: Ludovic Courtès <address@hidden>
Date: Sat Jul 29 18:02:29 2017 +0200
website: packages: Add the commit in package source URLs.
This is a "port" of commit fba3435fb3b07823b2c666906510442110723d56.
* website/apps/packages/utils.scm (git-description): New procedure.
(location->ilink): Use it. Use 'string-append' instead of
'url-path-join'.
---
website/apps/packages/utils.scm | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/website/apps/packages/utils.scm b/website/apps/packages/utils.scm
index 1ca8069..0d4304e 100644
--- a/website/apps/packages/utils.scm
+++ b/website/apps/packages/utils.scm
@@ -1,5 +1,6 @@
;;; GuixSD website --- GNU's advanced distro website
;;; Copyright © 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2017 Eric Bavier <address@hidden>
;;;
;;; Initially written by sirgazil
;;; who waives all copyright interest on this file.
@@ -26,9 +27,14 @@
#:use-module (apps packages types)
#:use-module (guix packages)
#:use-module (guix utils)
+ #:use-module (guix build utils)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26)
#:use-module (texinfo)
#:use-module (texinfo html)
#:use-module (ice-9 match)
+ #:use-module (ice-9 rdelim)
+ #:use-module (ice-9 popen)
#:export (package-description-shtml
package-synopsis-shtml
@@ -67,6 +73,16 @@ vocabulary."
(('div ('p text ...))
text)))))
+(define git-description
+ (delay
+ (let* ((guix (find (lambda (p)
+ (file-exists? (string-append p "/guix/config.scm")))
+ %load-path))
+ (pipe (with-directory-excursion guix
+ (open-pipe* OPEN_READ "git" "describe")))
+ (desc (read-line pipe))
+ (git? (close-pipe pipe)))
+ (and (zero? git?) desc))))
(define (location->ilink loc)
"Convert the given location LOC into an Ilink.
@@ -78,9 +94,12 @@ vocabulary."
An Ilink object as defined in (apps packages types)."
(ilink (basename (location-file loc))
(guix-git-tree-url
- (url-path-join (location-file loc)
- (string-append "#n"
- (number->string (location-line
loc)))))))
+ (string-append (location-file loc)
+ (or (and=> (force git-description)
+ (cut string-append "?id=" <>))
+ "")
+ "#n"
+ (number->string (location-line loc))))))
;;; TODO: Stub. Implement.
- branch master updated (ae2d020 -> 81db25f), Ludovic Courtès, 2017/12/06
- 02/29: website: packages: Ignore third-party packages., Ludovic Courtès, 2017/12/06
- 04/29: website: utils: 'paginate' correctly handles the case with zero items., Ludovic Courtès, 2017/12/06
- 03/29: website: posts: Add missing tags and harmonize., Ludovic Courtès, 2017/12/06
- 05/29: website: packages: Implement grouping by letter., Ludovic Courtès, 2017/12/06
- 11/29: website: "download", not "test"., Ludovic Courtès, 2017/12/06
- 08/29: website: packages: Fix typo., Ludovic Courtès, 2017/12/06
- 07/29: website: packages: Add the commit in package source URLs.,
Ludovic Courtès <=
- 12/29: website: packages: Mark GNU packages in the listing., Ludovic Courtès, 2017/12/06
- 15/29: website: downloads: Change http to https in alpha.gnu.org URL., Ludovic Courtès, 2017/12/06
- 13/29: website: packages: Correctly compute supported systems., Ludovic Courtès, 2017/12/06
- 10/29: website: Use actual GuixSD screenshots., Ludovic Courtès, 2017/12/06
- 17/29: website: base: Change http to https in 'graphics'., Ludovic Courtès, 2017/12/06
- 19/29: website: base: Change URLs in 'data' from http to https., Ludovic Courtès, 2017/12/06
- 06/29: website: packages: Interpret synopsis/description Texinfo., Ludovic Courtès, 2017/12/06
- 21/29: website: packages: Gracefully deal with empty package descriptions., Ludovic Courtès, 2017/12/06
- 24/29: website: packages: Remove links to package issues., Ludovic Courtès, 2017/12/06
- 18/29: website: base: Change some http to https., Ludovic Courtès, 2017/12/06