mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
guix package: Inherit the transformed version number.
Previously, 'guix package -i emacs --with-source=./emacs-42.tar.gz' would fail to use "42" as the version number in the manifest entry. Reported by piyo on #guix. * guix/scripts/package.scm (process-actions)[transform-entry]: Inherit the version number from the result of TRANSFORM when it's a package. * tests/guix-package.sh: Test it.
This commit is contained in:
parent
b5d08d7c28
commit
494dc2fc62
2 changed files with 21 additions and 3 deletions
|
@ -794,9 +794,13 @@ (define profile (or (assoc-ref opts 'profile) %current-profile))
|
|||
(define transform (options->transformation opts))
|
||||
|
||||
(define (transform-entry entry)
|
||||
(manifest-entry
|
||||
(inherit entry)
|
||||
(item (transform store (manifest-entry-item entry)))))
|
||||
(let ((item (transform store (manifest-entry-item entry))))
|
||||
(manifest-entry
|
||||
(inherit entry)
|
||||
(item item)
|
||||
(version (if (package? item)
|
||||
(package-version item)
|
||||
(manifest-entry-version entry))))))
|
||||
|
||||
;; First, process roll-backs, generation removals, etc.
|
||||
(for-each (match-lambda
|
||||
|
|
|
@ -140,6 +140,20 @@ rm "$profile" "$profile"-[0-9]-link
|
|||
guix gc -d "$real_profile"
|
||||
[ ! -d "$real_profile" ]
|
||||
|
||||
# Package transformations.
|
||||
|
||||
# Make sure we get the right version number when using '--with-source'.
|
||||
mkdir "$module_dir"
|
||||
emacs_tarball="$module_dir/emacs-42.5.9rc7.tar.gz"
|
||||
touch "$emacs_tarball"
|
||||
guix package -p "$profile" -i emacs --with-source="$emacs_tarball" -n \
|
||||
2> "$tmpfile"
|
||||
grep -E 'emacs[[:blank:]]+42\.5\.9rc7[[:blank:]]+.*-emacs-42.5.9rc7' \
|
||||
"$tmpfile"
|
||||
rm "$emacs_tarball" "$tmpfile"
|
||||
rmdir "$module_dir"
|
||||
|
||||
|
||||
#
|
||||
# Try with the default profile.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue