summary refs log tree commit diff
path: root/pre-inst-env.in
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-12-11 11:58:54 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-11 11:58:54 +0100
commitd862bf0fe92d62458a80eceecfa864164dd27cd5 (patch)
tree6419fe906ed709e2c952e74c85f321aaff198956 /pre-inst-env.in
parent68ad877c6becd2e99ebc909e942d082bbd6efe94 (diff)
downloadguix-d862bf0fe92d62458a80eceecfa864164dd27cd5.tar.gz
build: Remove '..' from srcdir/builddir in 'pre-inst-env'.
* pre-inst-env.in (abs_top_srcdir, abs_top_builddir): New variables.
  Use them instead of @abs_top_srcdir@ and @abs_top_builddir@.
  This fixes the "package-field-location, relative file name" test in
  'make distcheck'.
Diffstat (limited to 'pre-inst-env.in')
-rw-r--r--pre-inst-env.in19
1 files changed, 13 insertions, 6 deletions
diff --git a/pre-inst-env.in b/pre-inst-env.in
index 5e7758cd7c..acdce61168 100644
--- a/pre-inst-env.in
+++ b/pre-inst-env.in
@@ -23,20 +23,27 @@
 # Run COMMAND in a pre-installation environment.  Typical use is
 # "./pre-inst-env guix-build hello".
 
-GUILE_LOAD_COMPILED_PATH="@abs_top_builddir@${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
-GUILE_LOAD_PATH="@abs_top_builddir@:@abs_top_srcdir@${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
+# By default we may end up with absolute directory names that contain '..',
+# which get into $GUILE_LOAD_PATH, leading to '..' in the module file names
+# recorded by Guile.  To avoid that, make sure we get a real absolute
+# directory name.
+abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`"
+abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`"
+
+GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
+GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
 export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
 
 # Define $PATH so that `guix' and friends are easily found.
 
-PATH="@abs_top_builddir@/scripts:@abs_top_builddir@:$PATH"
+PATH="$abs_top_builddir/scripts:$abs_top_builddir:$PATH"
 export PATH
 
 # Daemon helpers.
 
-NIX_ROOT_FINDER="@abs_top_builddir@/nix/scripts/list-runtime-roots"
-NIX_SUBSTITUTERS="@abs_top_builddir@/nix/scripts/substitute-binary"
-NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper"
+NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
+NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute-binary"
+NIX_SETUID_HELPER="$abs_top_builddir/nix-setuid-helper"
 export NIX_ROOT_FINDER NIX_SETUID_HELPER NIX_SUBSTITUTERS
 
 # The following variables need only be defined when compiling Guix