summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2020-10-21 18:33:52 -0500
committerEric Bavier <bavier@member.fsf.org>2020-10-30 10:00:29 -0500
commita73896425e92e5162766afdf042748b18f2462af (patch)
treeb62602861a5bdce8fda8899456f1536de3a1f48f /gnu
parenteee35fe3b7cb21792b90ecbf5a834b5a3fdb6f04 (diff)
downloadguix-a73896425e92e5162766afdf042748b18f2462af.tar.gz
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)<build-wrapper>: 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.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/aux-files/run-in-namespace.c2
1 files changed, 1 insertions, 1 deletions
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';