2008-05-06 Robert Millan <rmh@aybabtu.com>

* util/update-grub_lib.in (make_system_path_relative_to_its_root):
        Do not print a trailing slash (therefore, the root directory is an
        empty string).
        (convert_system_path_to_grub_path): Do not remove trailing slash
        from make_system_path_relative_to_its_root() output.

        * util/i386/pc/grub-install.in: Add trailing slash to output from
        make_system_path_relative_to_its_root().
This commit is contained in:
robertmh 2008-05-06 13:44:11 +00:00
parent 6cf12cbd25
commit b0346e0f43
3 changed files with 20 additions and 5 deletions

View file

@ -1,3 +1,14 @@
2008-05-06 Robert Millan <rmh@aybabtu.com>
* util/update-grub_lib.in (make_system_path_relative_to_its_root):
Do not print a trailing slash (therefore, the root directory is an
empty string).
(convert_system_path_to_grub_path): Do not remove trailing slash
from make_system_path_relative_to_its_root() output.
* util/i386/pc/grub-install.in: Add trailing slash to output from
make_system_path_relative_to_its_root().
2008-05-06 Robert Millan <rmh@aybabtu.com>
* util/grub-fstest.c (grub_refresh): Call `fflush (stdout)'. This

View file

@ -229,7 +229,7 @@ devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_ma
# _chain is often useful
modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain"
$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1
$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}`/ $modules || exit 1
# Now perform the installation.
$grub_setup --directory=${grubdir} --device-map=${device_map} \

View file

@ -61,7 +61,14 @@ make_system_path_relative_to_its_root ()
dir=$parent
done
echo $path | sed -e "s,^$dir,/,g" -e "s,//,/,g"
# This function never prints trailing slashes (so that its output can be
# appended a slash unconditionally). Each slash in $dir is considered a
# preceding slash, and therefore the root directory is an empty string.
if [ "$dir" = "/" ] ; then
dir=""
fi
echo $path | sed -e "s,^$dir,,g"
}
convert_system_path_to_grub_path ()
@ -86,9 +93,6 @@ convert_system_path_to_grub_path ()
return 1
fi
# remove any trailing slash, even if that slash is everything we have
relative_path=`echo ${relative_path} | sed -e "s,/*$,,g"`
echo ${drive}${relative_path}
}