guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/26: build-system/asdf: Fix normalize-string to support versioned depe


From: Pierre Neidhardt
Subject: 01/26: build-system/asdf: Fix normalize-string to support versioned dependencies
Date: Fri, 24 Aug 2018 09:14:03 -0400 (EDT)

ambrevar pushed a commit to branch wip-next-browser
in repository guix.

commit 06f1a4b0d75a596b0dfa171ed5e5a9e6303655f0
Author: Pierre Neidhardt <address@hidden>
Date:   Tue Aug 21 23:22:07 2018 +0200

    build-system/asdf: Fix normalize-string to support versioned dependencies
    
    * guix/build/lisp-utils.scm (normalize-string): Fix normalize-string to 
support versioned dependencies.
---
 guix/build/lisp-utils.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index 21cb620..5bc9ed7 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -77,9 +77,15 @@
   (string->char-set
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-._?="))
 
-(define (normalize-string str)
-  "Replace invalid characters in STR with a hyphen."
-  (string-join (string-tokenize str valid-char-set) "-"))
+(define (normalize-string str-or-list)
+  "Replace invalid characters in STR-OR-LIST with a hyphen."
+  ;; Dependencies can be either strings or list with properties, e.g.
+  ;; (:version "bar" "0.1.2")
+  (if (string? str-or-list)
+      (string-join (string-tokenize str-or-list valid-char-set) "-")
+      (map (lambda (e) (if (string? e)
+                           (normalize-string e)
+                           e)) str-or-list)))
 
 (define (inputs->asd-file-map inputs)
   "Produce a hash table of the form (system . asd-file), where system is the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]