diff options
| -rw-r--r-- | guix/profiles.scm | 11 | ||||
| -rw-r--r-- | tests/profiles.scm | 10 |
2 files changed, 15 insertions, 6 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm index 1adb143c164..db807a8136e 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm | |||
| @@ -163,9 +163,8 @@ | |||
| 163 | (call-with-input-file file read-manifest) | 163 | (call-with-input-file file read-manifest) |
| 164 | (manifest '())))) | 164 | (manifest '())))) |
| 165 | 165 | ||
| 166 | (define* (package->manifest-entry package #:optional output) | 166 | (define* (package->manifest-entry package #:optional (output "out")) |
| 167 | "Return a manifest entry for the OUTPUT of package PACKAGE. When OUTPUT is | 167 | "Return a manifest entry for the OUTPUT of package PACKAGE." |
| 168 | omitted or #f, use the first output of PACKAGE." | ||
| 169 | (let ((deps (map (match-lambda | 168 | (let ((deps (map (match-lambda |
| 170 | ((label package) | 169 | ((label package) |
| 171 | (gexp-input package)) | 170 | (gexp-input package)) |
| @@ -175,7 +174,7 @@ omitted or #f, use the first output of PACKAGE." | |||
| 175 | (manifest-entry | 174 | (manifest-entry |
| 176 | (name (package-name package)) | 175 | (name (package-name package)) |
| 177 | (version (package-version package)) | 176 | (version (package-version package)) |
| 178 | (output (or output (car (package-outputs package)))) | 177 | (output output) |
| 179 | (item package) | 178 | (item package) |
| 180 | (dependencies (delete-duplicates deps)) | 179 | (dependencies (delete-duplicates deps)) |
| 181 | (search-paths (package-transitive-native-search-paths package))))) | 180 | (search-paths (package-transitive-native-search-paths package))))) |
| @@ -188,8 +187,8 @@ denoting a specific output of a package." | |||
| 188 | (map (match-lambda | 187 | (map (match-lambda |
| 189 | ((package output) | 188 | ((package output) |
| 190 | (package->manifest-entry package output)) | 189 | (package->manifest-entry package output)) |
| 191 | (package | 190 | ((? package? package) |
| 192 | (package->manifest-entry package))) | 191 | (package->manifest-entry package))) |
| 193 | packages))) | 192 | packages))) |
| 194 | 193 | ||
| 195 | (define (manifest->gexp manifest) | 194 | (define (manifest->gexp manifest) |
diff --git a/tests/profiles.scm b/tests/profiles.scm index fc1dfd2bfcc..028d7b6fb45 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm | |||
| @@ -207,6 +207,16 @@ | |||
| 207 | #:hooks '()))) | 207 | #:hooks '()))) |
| 208 | (return (derivation-inputs drv)))) | 208 | (return (derivation-inputs drv)))) |
| 209 | 209 | ||
| 210 | (test-assert "package->manifest-entry defaults to \"out\"" | ||
| 211 | (let ((outputs (package-outputs packages:glibc))) | ||
| 212 | (equal? (manifest-entry-output | ||
| 213 | (package->manifest-entry (package | ||
| 214 | (inherit packages:glibc) | ||
| 215 | (outputs (reverse outputs))))) | ||
| 216 | (manifest-entry-output | ||
| 217 | (package->manifest-entry packages:glibc)) | ||
| 218 | "out"))) | ||
| 219 | |||
| 210 | (test-assertm "profile-manifest, search-paths" | 220 | (test-assertm "profile-manifest, search-paths" |
| 211 | (mlet* %store-monad | 221 | (mlet* %store-monad |
| 212 | ((guile -> (package | 222 | ((guile -> (package |
