GNU bug report logs - #26239
[PATCH] packages: Use "@" as version separator.

Previous Next

Package: guix-patches;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Fri, 24 Mar 2017 16:34:01 UTC

Severity: normal

Tags: patch

Merged with 26264, 26265

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alex Sassmannshausen <alex.sassmannshausen <at> gmail.com>
Subject: bug#26265: closed (Re: bug#26239: Acknowledgement ([PATCH]
 packages: Use "@" as version separator.))
Date: Tue, 28 Mar 2017 15:23:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#26239: [PATCH 1/1] packages: Add optional `for-ui` param to `package-full-name`.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 26265 <at> debbugs.gnu.org.

-- 
26239: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26239
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 26239-done <at> debbugs.gnu.org
Subject: Re: bug#26239: Acknowledgement ([PATCH] packages: Use "@" as version
 separator.)
Date: Tue, 28 Mar 2017 17:23:05 +0200
[Message part 3 (text/plain, inline)]
‘package-full-name’ is also used to construct store path names, to this
change alone isn't enough.

Closing this bug. Discussion continued at #26264.

Kind regards,

T G-R

[signature.asc (application/pgp-signature, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Alex Sassmannshausen <alex.sassmannshausen <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Alex Sassmannshausen <alex <at> pompo.co>
Subject: [PATCH 1/1] packages: Add optional `for-ui` param to
 `package-full-name`.
Date: Sun, 26 Mar 2017 14:25:55 +0200
* guix/packages.scm (package-full-name): Add optional parameter `for-ui`.
* guix/scripts/refresh.scm (list-dependents): Use it.
* tests/packages.scm: Add tests for `package-full-name`.
---
 guix/packages.scm        | 9 +++++----
 guix/scripts/refresh.scm | 6 +++---
 tests/packages.scm       | 4 ++++
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 4bc4b017f..5219b2acc 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -380,10 +380,11 @@ object."
 (define-condition-type &package-cross-build-system-error &package-error
   package-cross-build-system-error?)
 
-
-(define (package-full-name package)
-  "Return the full name of PACKAGE--i.e., `NAME-VERSION'."
-  (string-append (package-name package) "-" (package-version package)))
+(define* (package-full-name package #:optional for-ui)
+  "Return the full name of PACKAGE--i.e., `NAME-VERSION'.  If FOR-UI? is #t,
+return the full name of PACKAGE using \"@\" as the NAME, VERSION separator."
+  (string-append (package-name package) (if for-ui "@" "-")
+                 (package-version package)))
 
 (define (%standard-patch-inputs)
   (let* ((canonical (module-ref (resolve-interface '(gnu packages base))
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 4d3c695aa..14db7deb2 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -327,12 +327,12 @@ WARN? is true and no updater exists for PACKAGE, print a warning."
                  (N_ "No dependents other than itself: ~{~a~}~%"
                      "No dependents other than themselves: ~{~a~^ ~}~%"
                      (length packages))
-                 (map package-full-name packages)))
+                 (map (cut package-full-name <> #t) packages)))
 
         ((x)
          (format (current-output-port)
                  (_ "A single dependent package: ~a~%")
-                 (package-full-name x)))
+                 (package-full-name x #t)))
         (lst
          (format (current-output-port)
                  (N_ "Building the following package would ensure ~d \
@@ -341,7 +341,7 @@ dependent packages are rebuilt: ~*~{~a~^ ~}~%"
 dependent packages are rebuilt: ~{~a~^ ~}~%"
                      (length covering))
                  (length covering) (length dependents)
-                 (map package-full-name covering))))
+                 (map (cut package-full-name <> #t) covering))))
       (return #t))))
 
 
diff --git a/tests/packages.scm b/tests/packages.scm
index 247f75cc4..d19a44347 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -988,6 +988,10 @@
     (lambda (key . args)
       key)))
 
+(test-assert "package-full-name"
+  (and (string=? (package-full-name (dummy-package "foo")) "foo-0")
+       (string=? (package-full-name (dummy-package "foo") #t)  "foo <at> 0")))
+
 (test-end "packages")
 
 ;;; Local Variables:
-- 
2.12.1




This bug report was last modified 7 years and 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.