=== modified file 'ChangeLog' --- ChangeLog 2010-06-03 21:36:19 +0000 +++ ChangeLog 2010-06-03 22:02:54 +0000 @@ -1,5 +1,14 @@ 2010-06-03 Grégoire Sutre + * util/grub-install.in: Use -x instead of -f when checking for grub + programs, and factorize these checks by a for loop. + * util/grub-mkconfig.in: Likewise. + * util/grub-mkrescue.in: Likewise. + * util/i386/efi/grub-install.in: Likewise. + * util/ieee1275/grub-install.in: Likewise. + +2010-06-03 Grégoire Sutre + * configure.ac: Set and subsitute pkgdatadir, pkglibrootdir and defaultbootdir. * Makefile.in: Use the above autoconfigured variables. === modified file 'util/grub-install.in' --- util/grub-install.in 2010-06-03 21:36:19 +0000 +++ util/grub-install.in 2010-06-03 22:02:54 +0000 @@ -177,7 +177,7 @@ grub_probe="${grub_probe} --device-map=$ # Check if GRUB is installed. if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then set $grub_setup dummy - if test -f "$1"; then + if test -x "$1"; then : else echo "$1: Not found." 1>&2 @@ -185,21 +185,15 @@ if [ "${target_cpu}-${platform}" = "i386 fi fi -set $grub_mkimage dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi - -set $grub_mkdevicemap dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi +for prog in mkimage mkdevicemap probe; do + eval set \$grub_$prog dummy + if test -x "$1"; then + : + else + echo "$1: Not found." 1>&2 + exit 1 + fi +done # Create the GRUB directory if it is not present. mkdir -p "$grubdir" || exit 1 === modified file 'util/grub-mkconfig.in' --- util/grub-mkconfig.in 2010-06-03 21:36:19 +0000 +++ util/grub-mkconfig.in 2010-06-03 22:02:54 +0000 @@ -87,21 +87,16 @@ if $next_grub_cfg; then exit 1 fi -set $grub_mkdevicemap dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi - -set $grub_probe dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi +# Check if GRUB is installed. +for prog in mkdevicemap probe; do + eval set \$grub_$prog dummy + if test -x "$1"; then + : + else + echo "$1: Not found." 1>&2 + exit 1 + fi +done GRUB_DIR=${defaultbootdir} === modified file 'util/grub-mkrescue.in' --- util/grub-mkrescue.in 2010-06-03 21:36:19 +0000 +++ util/grub-mkrescue.in 2010-06-03 22:02:54 +0000 @@ -103,7 +103,7 @@ if [ "x${output_image}" = x ] ; then fi set $grub_mkimage dummy -if test -f "$1"; then +if test -x "$1"; then : else echo "$1: Not found." 1>&2 === modified file 'util/i386/efi/grub-install.in' --- util/i386/efi/grub-install.in 2010-06-03 21:36:19 +0000 +++ util/i386/efi/grub-install.in 2010-06-03 22:02:54 +0000 @@ -117,21 +117,15 @@ grubdir=${rootdir}${defaultbootdir} device_map=${grubdir}/device.map # Check if GRUB is installed. -set $grub_mkimage dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi - -set $grub_mkdevicemap dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi +for prog in mkimage mkdevicemap probe; do + eval set \$grub_$prog dummy + if test -x "$1"; then + : + else + echo "$1: Not found." 1>&2 + exit 1 + fi +done # Create the GRUB directory if it is not present. mkdir -p "$grubdir" || exit 1 === modified file 'util/ieee1275/grub-install.in' --- util/ieee1275/grub-install.in 2010-06-03 21:36:19 +0000 +++ util/ieee1275/grub-install.in 2010-06-03 22:02:54 +0000 @@ -125,13 +125,16 @@ fi grubdir=${rootdir}${defaultbootdir} device_map=${grubdir}/device.map -set $grub_mkimage dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi +# Check if GRUB is installed. +for prog in mkimage mkdevicemap probe; do + eval set \$grub_$prog dummy + if test -x "$1"; then + : + else + echo "$1: Not found." 1>&2 + exit 1 + fi +done # Find the partition at the right mount point. install_device=`$grub_mkdevicemap --device-map=/dev/stdout | $grub_probe --target=device --device-map=/dev/stdin ${grubdir}` @@ -195,7 +198,7 @@ modules="$modules $fs_module $partmap_mo if test $update_nvram = yes; then set $ofpathname dummy - if test -f "$1"; then + if test -x "$1"; then : else echo "$1: Not found." 1>&2 @@ -203,7 +206,7 @@ if test $update_nvram = yes; then fi set $nvsetenv dummy - if test -f "$1"; then + if test -x "$1"; then : else echo "$1: Not found." 1>&2