]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-05-30 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Fri, 30 May 2008 15:09:11 +0000 (15:09 +0000)
committerrobertmh <robertmh@localhost>
Fri, 30 May 2008 15:09:11 +0000 (15:09 +0000)
        * 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().

ChangeLog
util/grub.d/00_header.in
util/update-grub.in
util/update-grub_lib.in

index b35a5be2bca4c6c3a649f097061f31c75bf782ec..6d81bdfa791dbd5588f1d2765d4324354323e86a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-05-30  Robert Millan  <rmh@aybabtu.com>
+
+       * 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  <rmh@aybabtu.com>
 
        * util/update-grub_lib.in (prepare_grub_to_access_device): New function.
index 9087b000394b2163c8651fced74182dbd45d8d3a..cabe569c3c6e055141befd8e69bad005b428dcfb 100644 (file)
@@ -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.
index 887ef19bce9a2504470e6c00986903ef671d8aa0..537c3230013e597a68a017d4a8b6d8539e4a5903 100644 (file)
@@ -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
index d7be39d5e89b59dd9e8314155bcb21120b7235f5..255c12d2d53547d1a4c1562f0db9deeed8922bc9 100644 (file)
@@ -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