From fed0f330e7f158449c85d32052749d6c5605bd0f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 12 May 2009 16:03:10 +0000 Subject: [PATCH] Fix nethack/zangband wrappers svn path=/nixpkgs/trunk/; revision=15575 --- pkgs/games/nethack/default.nix | 7 ++++--- pkgs/games/zangband/default.nix | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix index 6b9c25708f6d..788dbaffbdec 100644 --- a/pkgs/games/nethack/default.nix +++ b/pkgs/games/nethack/default.nix @@ -40,9 +40,10 @@ rec { ln -s $out/games/nethack $out/bin/nethack sed -i $out/bin/nethack -e '5aNEWHACKDIR="$HOME/.nethack"' sed -i $out/bin/nethack -e '6amkdir -p "$NEWHACKDIR/save"' - sed -i $out/bin/nethack -e '7aln -s "$HACKDIR"/* "$NEWHACKDIR" &>/dev/null' - sed -i $out/bin/nethack -e '8atest -L "$NEWHACKDIR/record" && rm "$NEWHACKDIR"/record' - sed -i $out/bin/nethack -e '9aexport HACKDIR="$NEWHACKDIR"' + sed -i $out/bin/nethack -e '7afor i in $(find "$NEWHACKDIR" -type l); do if ! test -e $(readlink "$i"); then rm "$i"; fi; done;' + sed -i $out/bin/nethack -e '8aln -s "$HACKDIR"/* "$NEWHACKDIR" &>/dev/null' + sed -i $out/bin/nethack -e '9atest -L "$NEWHACKDIR/record" && rm "$NEWHACKDIR"/record' + sed -i $out/bin/nethack -e '10aexport HACKDIR="$NEWHACKDIR"' '') ["minInit" "defEnsureDir"]; makeFlags = [ diff --git a/pkgs/games/zangband/default.nix b/pkgs/games/zangband/default.nix index 4749733b3aa2..6db453f3bb7f 100644 --- a/pkgs/games/zangband/default.nix +++ b/pkgs/games/zangband/default.nix @@ -44,6 +44,7 @@ rec { for i in lib/*/*.raw; do test -L "$i" && rm "$i"; done + for i in $(find lib -type l); do if ! test -e $(readlink "$i"); then rm "$i"; fi; done; export ANGBAND_PATH="$PWD" "'$out'/bin/.zangband.real" "$@" ' > $out/bin/zangband