[bug#34626] pack: Construct inferior package names correctly.

Message ID f265653b-50de-49f5-9bbe-095a04b5c192@www.fastmail.com
State Accepted
Headers show
Series [bug#34626] pack: Construct inferior package names correctly. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Shyam Feb. 23, 2019, 4:11 a.m. UTC
Hello everyone,

This patch fixes a bug where inferior packages' names were not being
constructed correctly when calling `guix pack --relocatable`.

Cheers,

Shyam

Patch

From dd2171ce0d074cb6003afdaec353df572ed784a8 Mon Sep 17 00:00:00 2001
From: "P.C. Shyamshankar" <shyam@sykloid.org>
Date: Fri, 22 Feb 2019 22:38:47 -0500
Subject: [PATCH] pack: Construct inferior package names correctly.

* guix/scripts/pack.scm: 'wrapped-package' now correctly constructs full
  names of inferior packages, allowing relocatable packs.
---
 guix/scripts/pack.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index b19a4ae1b..181a82696 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -28,6 +28,7 @@ 
   #:use-module (guix store)
   #:use-module (guix status)
   #:use-module (guix grafts)
+  #:use-module (guix inferior)
   #:use-module (guix monads)
   #:use-module (guix modules)
   #:use-module (guix packages)
@@ -570,7 +571,14 @@  please email '~a'~%")
                             (find-files #$(file-append package "/sbin"))
                             (find-files #$(file-append package "/libexec")))))))
 
-  (computed-file (string-append (package-full-name package "-") "R")
+  (computed-file (string-append
+                  (cond ((package? package)
+                         (package-full-name package "-"))
+                        ((inferior-package? package)
+                         (string-append (inferior-package-name package)
+                                        "-"
+                                        (inferior-package-version package))))
+                  "R")
                  build))
 
 (define (map-manifest-entries proc manifest)
-- 
2.20.1