summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2015-09-10 15:39:44 -0500
committerEric Bavier <bavier@member.fsf.org>2015-09-14 18:02:37 -0500
commit3b4d01035f214ac57ac1517b719e2b0f0f092411 (patch)
treea4c485f05a0393fe98f54f7ec17b7fe70f7d3e80 /guix/scripts
parenteb95ace9f191a7291e6daf9c4af8759237408696 (diff)
guix: packages: Add origin-actual-file-name.
* guix/scripts/graph.scm (uri->file-name, node-full-name): Move origin file name logic to... * guix/packages.scm (origin-actual-file-name): ...here. * tests/packages.scm ("origin-actual-file-name") ("origin-actual-file-name, file-name"): New tests.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/graph.scm15
1 files changed, 1 insertions, 14 deletions
diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm
index 2b671be131..cddd63e5b7 100644
--- a/guix/scripts/graph.scm
+++ b/guix/scripts/graph.scm
@@ -33,7 +33,6 @@
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-37)
#:use-module (ice-9 match)
- #:use-module (web uri)
#:export (%package-node-type
%bag-node-type
%bag-emerged-node-type
@@ -78,25 +77,13 @@
;;; Package DAG.
;;;
-(define (uri->file-name uri)
- "Return the 'base name' of URI or URI itself, where URI is a string."
- (let ((path (and=> (string->uri uri) uri-path)))
- (if path
- (basename path)
- uri)))
-
(define (node-full-name thing)
"Return a human-readable name to denote THING, a package, origin, or file
name."
(cond ((package? thing)
(package-full-name thing))
((origin? thing)
- (or (origin-file-name thing)
- (match (origin-uri thing)
- ((head . tail)
- (uri->file-name head))
- ((? string? uri)
- (uri->file-name uri)))))
+ (origin-actual-file-name thing))
((string? thing) ;file name
(or (basename thing)
(error "basename" thing)))