diff --git a/ChangeLog b/ChangeLog index b35a5be2b..6d81bdfa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-05-30 Robert Millan + + * util/grub.d/00_header.in: Remove obsolete comment referencing + convert_system_path_to_grub_path(). + * util/update-grub.in: Likewise. + * util/update-grub_lib.in (is_path_readable_by_grub): New function. + (convert_system_path_to_grub_path): Add a warning message explaining + that this function is deprecated. Rely on is_path_readable_by_grub() + for the readability checks. + (font_path): Use is_path_readable_by_grub() for the readability + check rather than convert_system_path_to_grub_path(). + 2008-05-30 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): New function. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 9087b0003..cabe569c3 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -21,7 +21,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ platform=@platform@ -# for convert_system_path_to_grub_path() . ${libdir}/grub/update-grub_lib # Do this as early as possible, since other commands might depend on it. diff --git a/util/update-grub.in b/util/update-grub.in index 887ef19bc..537c32300 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -66,7 +66,6 @@ for option in "$@"; do esac done -# for convert_system_path_to_grub_path(), font_path() . ${libdir}/grub/update-grub_lib if [ "x$UID" = "x" ] ; then diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index d7be39d5e..255c12d2d 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -71,11 +71,11 @@ make_system_path_relative_to_its_root () echo $path | sed -e "s,^$dir,,g" } -convert_system_path_to_grub_path () +is_path_readable_by_grub () { path=$1 - # abort if file doesn't exist + # abort if path doesn't exist if test -e $path ; then : ;else return 1 fi @@ -85,6 +85,20 @@ convert_system_path_to_grub_path () return 1 fi + return 0 +} + +convert_system_path_to_grub_path () +{ + path=$1 + + echo "Warning: convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." >&2 + + # abort if GRUB can't access the path + if is_path_readable_by_grub ${path} ; then : ; else + return 1 + fi + if drive=`${grub_probe} -t drive $path` ; then : ; else return 1 fi @@ -120,7 +134,7 @@ font_path () # Prefer complete fonts over incomplete ones. for basename in unicode unifont ascii ; do path="${dir}/${basename}.pff" - if convert_system_path_to_grub_path ${path} > /dev/null ; then + if is_path_readable_by_grub ${path} > /dev/null ; then echo "${path}" return 0 fi