mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
utils: Move 'package-name->name+version' to (guix build utils).
* guix/utils.scm (package-name->name+version): Move to... * guix/build/utils.scm (package-name->name+version): ... here. New procedure. * guix/build/emacs-build-system.scm (package-name->name+version): Remove.
This commit is contained in:
parent
b7c7c03eb5
commit
8c578a6094
3 changed files with 26 additions and 45 deletions
|
@ -150,28 +150,6 @@ second hyphen. This corresponds to 'name-version' as used in ELPA packages."
|
|||
strip-store-file-name)
|
||||
store-dir))
|
||||
|
||||
;; from (guix utils). Should we put it in (guix build utils)?
|
||||
(define (package-name->name+version name)
|
||||
"Given NAME, a package name like \"foo-0.9.1b\", return two values:
|
||||
\"foo\" and \"0.9.1b\". When the version part is unavailable, NAME and
|
||||
#f are returned. The first hyphen followed by a digit is considered to
|
||||
introduce the version part."
|
||||
;; See also `DrvName' in Nix.
|
||||
|
||||
(define number?
|
||||
(cut char-set-contains? char-set:digit <>))
|
||||
|
||||
(let loop ((chars (string->list name))
|
||||
(prefix '()))
|
||||
(match chars
|
||||
(()
|
||||
(values name #f))
|
||||
((#\- (? number? n) rest ...)
|
||||
(values (list->string (reverse prefix))
|
||||
(list->string (cons n rest))))
|
||||
((head tail ...)
|
||||
(loop tail (cons head prefix))))))
|
||||
|
||||
(define %standard-phases
|
||||
(modify-phases gnu:%standard-phases
|
||||
(delete 'configure)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue