tags 480597 = patch
thanks
This script will fail in dash if the program 'time' is not installed. You can
check for yourself.
$ dash -c 'command -V time'
time is /usr/bin/time
I've provided a patch that checks for 'time' to be installed and if not, falls
back to a different method of generating a random number that doesn't use
$RANDOM.
--
Regards,
Andres
--- fluxbox-1.1.1/build-tree/fluxbox-1.1.1/util/fbsetbg.old 2008-12-02 21:07:53.0 -0500
+++ fluxbox-1.1.1/build-tree/fluxbox-1.1.1/util/fbsetbg 2008-12-02 21:19:47.0 -0500
@@ -498,11 +498,11 @@
number_of_wallpapers=`ls $wallpaperdir|wc -l`
if find_it random_number; then
randomnumber=`random_number`
-# some shells don't support $RANDOM
-elif [ -z $RANDOM ]; then
+# check if the program 'time' is available
+elif [ $(command -v time) ]; then
randomnumber=`(echo $$ ;time ps; w ; date )21 | cksum | cut -f1 -d' '`
else
-randomnumber=$RANDOM
+randomnumber=$(dd if=/dev/urandom count=1 2 /dev/null | cksum | cut -f1 -d )
fi
wallpapernumber=`expr $randomnumber % $number_of_wallpapers + 1`
#remember previous wallpaper
signature.asc
Description: This is a digitally signed message part.