diff options
author | Ludovic Courtès <ludo@gnu.org> | 2023-04-21 16:27:07 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2023-04-21 17:09:50 +0200 |
commit | 1df54ceab38873dfc0fd2ec27313d7d17c79c350 (patch) | |
tree | 23816119c68a00447e61eafed4ddd1a9a0eae065 /guix/packages.scm | |
parent | 61a6b05850f99dcff65c83585c97604466d4ecf3 (diff) |
packages: 'package-direct-sources' correctly handles non-origin sources.
Previously 'package-direct-sources' would trigger a wrong-type-arg error
when passed a package whose 'source' is not an origin, such as
'ruby-sorbet-runtime'.
* guix/packages.scm (package-direct-sources): Call 'expand' if and only
if (package-source package) is an origin.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r-- | guix/packages.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index bce82ab3a3..e26602d589 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1234,11 +1234,14 @@ input list." "Return all source origins associated with PACKAGE; including origins in PACKAGE's inputs and patches." (define (expand source) - (cons - source - (filter origin? (origin-patches source)))) + (cons source + (filter origin? (origin-patches source)))) - `(,@(or (and=> (package-source package) expand) '()) + `(,@(match (package-source package) + ((? origin? origin) + (expand origin)) + (_ + '())) ,@(filter-map (match-lambda ((_ (? origin? orig) _ ...) orig) |