Skip to content

Commit

Permalink
Fix old build
Browse files Browse the repository at this point in the history
The symlinked `nix-profile.sh.in` was getting rewritten per the `%.in ->
%` rule, which was clobbering the test also named `nix-profile.sh`.
  • Loading branch information
Ericson2314 committed Jul 25, 2024
1 parent 9fc6694 commit d8d6a10
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/functional/bash-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source common.sh

sed -e "s|@localstatedir@|$TEST_ROOT/profile-var|g" -e "s|@coreutils@|$coreutils|g" < nix-profile.sh.in > "$TEST_ROOT"/nix-profile.sh
sed -e "s|@localstatedir@|$TEST_ROOT/profile-var|g" -e "s|@coreutils@|$coreutils|g" < ../../scripts/nix-profile.sh.in > "$TEST_ROOT"/nix-profile.sh

user=$(whoami)
rm -rf "$TEST_HOME" "$TEST_ROOT/profile-var"
Expand Down
12 changes: 12 additions & 0 deletions tests/functional/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ run_command(
meson.current_source_dir() / '',
meson.current_build_dir() / '',
)
# This current-source-escaping relative is no good because we don't know
# where the build directory will be, therefore we fix it up. Once the
# Make build system is gone, we should think about doing this better.
scripts_dir = fs.relative_to(
meson.current_source_dir() / '..' / '..' / 'scripts',
meson.current_build_dir(),
)
run_command(
'sed',
'-i', meson.current_build_dir() / 'bash-profile.sh',
'-e', 's^../../scripts^@0@^'.format(scripts_dir),
)

nix = find_program('nix')
bash = find_program('bash', native : true)
Expand Down
1 change: 0 additions & 1 deletion tests/functional/nix-profile.sh.in

This file was deleted.

0 comments on commit d8d6a10

Please sign in to comment.