From a73896425e92e5162766afdf042748b18f2462af Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Wed, 21 Oct 2020 18:33:52 -0500 Subject: guix: pack: Fix offset calculation for store directory mount point. Fixes wrapping of non-package things, where the target store directory may differ in length from the original. * guix/scripts/pack.scm (wrapped-package): Define WRAPPER_PROGRAM macro with wrapper's file name. * gnu/packages/aux-files/run-in-namespace.c (main): Offset index by len of that file name. --- gnu/packages/aux-files/run-in-namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages') diff --git a/gnu/packages/aux-files/run-in-namespace.c b/gnu/packages/aux-files/run-in-namespace.c index 52a16a5362..947ff02dda 100644 --- a/gnu/packages/aux-files/run-in-namespace.c +++ b/gnu/packages/aux-files/run-in-namespace.c @@ -620,7 +620,7 @@ main (int argc, char *argv[]) /* SELF is something like "/home/ludo/.local/gnu/store/…-foo/bin/ls" and we want to extract "/home/ludo/.local/gnu/store". */ size_t index = strlen (self) - - strlen ("@WRAPPED_PROGRAM@") + strlen (original_store); + - strlen (WRAPPER_PROGRAM) + strlen (original_store); char *store = strdup (self); store[index] = '\0'; -- cgit v1.2.3