lol

hibernate: Fix impurities.

svn path=/nixpkgs/trunk/; revision=11445

+50 -1
+13 -1
pkgs/os-specific/linux/hibernate/default.nix
··· 9 9 sha256 = "1xpc2i16jczc3nhvxlkn6fb044srqrh528gnp92cwy4hxf2nzi1z"; 10 10 }; 11 11 12 - patches = [ ./install.patch ./gen-manpages.patch ]; 12 + patches = [ ./install.patch ./gen-manpages.patch ./hibernate.patch ]; 13 13 14 14 buildInputs = [ gawk ]; 15 15 16 16 installPhase = '' 17 17 # FIXME: Storing config files under `$out/etc' is not very useful. 18 + 19 + substituteInPlace "hibernate.sh" --replace \ 20 + 'SWSUSP_D="/etc/hibernate"' "SWSUSP_D=\"$out/etc/hibernate\"" 21 + 22 + # Remove all references to `/bin' and `/sbin'. 23 + for i in scriptlets.d/* 24 + do 25 + substituteInPlace "$i" --replace "/bin/" "" --replace "/sbin/" "" 26 + done 27 + 18 28 PREFIX="$out" CONFIG_PREFIX="$out" ./install.sh 29 + 30 + ln -s "$out/share/hibernate/scriptlets.d" "$out/etc/hibernate" 19 31 ''; 20 32 21 33 meta = {
+37
pkgs/os-specific/linux/hibernate/hibernate.patch
··· 1 + --- hibernate-script-1.98.1/hibernate.sh 2008-03-31 09:40:29.000000000 +0200 2 + +++ hibernate-script-1.98.1/hibernate.sh 2008-04-01 18:24:23.000000000 +0200 3 + @@ -224,7 +224,7 @@ FindXServer() { 4 + 5 + xauth="`get_env_var_of_process $xpid XAUTHORITY`" 6 + xhome="`get_env_var_of_process $xpid HOME`" 7 + - xuser=`/bin/ls -ld /proc/$xpid/ | awk '{print $3}'` 8 + + xuser=`ls -ld /proc/$xpid/ | awk '{print $3}'` 9 + [ -z $xauth ] && [ -n $xhome ] && [ -f $xhome/.Xauthority ] && xauth=$xhome/.Xauthority 10 + 11 + [ -z $xauth ] && continue 12 + @@ -273,14 +273,14 @@ UsingSuspendMethod() { 13 + # chain. 14 + SortSuspendBits() { 15 + # explicit path required to be ash compatible. 16 + - /bin/echo -ne "$SUSPEND_BITS" | sort -n 17 + + echo -ne "$SUSPEND_BITS" | sort -n 18 + } 19 + 20 + # SortResumeBits: Returns a list of functions registered in the correct order 21 + # to call for resuming, prefixed by their position number. 22 + SortResumeBits() { 23 + # explicit path required to be ash compatible. 24 + - /bin/echo -ne "$RESUME_BITS" | sort -rn 25 + + echo -ne "$RESUME_BITS" | sort -rn 26 + } 27 + 28 + # WrapHelpText: takes text from stdin, wraps it with an indent of 5 and width 29 + @@ -557,7 +557,7 @@ LoadScriptlets() { 30 + CURRENT_SOURCED_SCRIPTLET="" 31 + for scriptlet_dir in $SCRIPTLET_PATH ; do 32 + [ -d "$scriptlet_dir" ] || continue 33 + - [ -z "`/bin/ls -1 $scriptlet_dir`" ] && continue 34 + + [ -z "`ls -1 $scriptlet_dir`" ] && continue 35 + for scriptlet in $scriptlet_dir/* ; do 36 + # Avoid editor backup files. 37 + case "$scriptlet" in *~|*.bak) continue ;; esac