* util/grub-mkconfig_lib.in: Add missing quotes.
This commit is contained in:
parent
088cdb65eb
commit
cbac5b1ece
2 changed files with 47 additions and 43 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2011-04-10 Alexander Kurtz <kurtz.alex@googlemail.com>
|
||||||
|
|
||||||
|
* util/grub-mkconfig_lib.in: Add missing quotes.
|
||||||
|
|
||||||
2011-04-10 Colin Watson <cjwatson@ubuntu.com>
|
2011-04-10 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
* grub-core/gnulib/argp-parse.c (__argp_input): Don't crash if pstate
|
* grub-core/gnulib/argp-parse.c (__argp_input): Don't crash if pstate
|
||||||
|
|
|
@ -16,19 +16,19 @@
|
||||||
|
|
||||||
transform="@program_transform_name@"
|
transform="@program_transform_name@"
|
||||||
|
|
||||||
prefix=@prefix@
|
prefix="@prefix@"
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix="@exec_prefix@"
|
||||||
datarootdir=@datarootdir@
|
datarootdir="@datarootdir@"
|
||||||
datadir=@datadir@
|
datadir="@datadir@"
|
||||||
bindir=@bindir@
|
bindir="@bindir@"
|
||||||
sbindir=@sbindir@
|
sbindir="@sbindir@"
|
||||||
pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
|
pkgdatadir="${datadir}/`echo "@PACKAGE_TARNAME@" | sed "${transform}"`"
|
||||||
|
|
||||||
if test "x$grub_probe" = x; then
|
if test "x$grub_probe" = x; then
|
||||||
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
|
grub_probe="${sbindir}/`echo grub-probe | sed "${transform}"`"
|
||||||
fi
|
fi
|
||||||
if test "x$grub_mkrelpath" = x; then
|
if test "x$grub_mkrelpath" = x; then
|
||||||
grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}`
|
grub_mkrelpath="${bindir}/`echo grub-mkrelpath | sed "${transform}"`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $(which gettext >/dev/null 2>/dev/null) ; then
|
if $(which gettext >/dev/null 2>/dev/null) ; then
|
||||||
|
@ -44,20 +44,20 @@ grub_warn ()
|
||||||
|
|
||||||
make_system_path_relative_to_its_root ()
|
make_system_path_relative_to_its_root ()
|
||||||
{
|
{
|
||||||
${grub_mkrelpath} $1
|
"${grub_mkrelpath}" "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_path_readable_by_grub ()
|
is_path_readable_by_grub ()
|
||||||
{
|
{
|
||||||
path=$1
|
path="$1"
|
||||||
|
|
||||||
# abort if path doesn't exist
|
# abort if path doesn't exist
|
||||||
if test -e $path ; then : ;else
|
if test -e "$path" ; then : ;else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# abort if file is in a filesystem we can't read
|
# abort if file is in a filesystem we can't read
|
||||||
if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
|
if "${grub_probe}" -t fs "$path" > /dev/null 2>&1 ; then : ; else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -72,24 +72,24 @@ is_path_readable_by_grub ()
|
||||||
|
|
||||||
convert_system_path_to_grub_path ()
|
convert_system_path_to_grub_path ()
|
||||||
{
|
{
|
||||||
path=$1
|
path="$1"
|
||||||
|
|
||||||
grub_warn "convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead."
|
grub_warn "convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead."
|
||||||
|
|
||||||
# abort if GRUB can't access the path
|
# abort if GRUB can't access the path
|
||||||
if is_path_readable_by_grub ${path} ; then : ; else
|
if is_path_readable_by_grub "${path}" ; then : ; else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if drive=`${grub_probe} -t drive $path` ; then : ; else
|
if drive="`"${grub_probe}" -t drive "$path"`" ; then : ; else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if relative_path=`make_system_path_relative_to_its_root $path` ; then : ; else
|
if relative_path="`make_system_path_relative_to_its_root "$path"`" ; then : ; else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ${drive}${relative_path}
|
echo "${drive}${relative_path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
save_default_entry ()
|
save_default_entry ()
|
||||||
|
@ -103,15 +103,15 @@ EOF
|
||||||
|
|
||||||
prepare_grub_to_access_device ()
|
prepare_grub_to_access_device ()
|
||||||
{
|
{
|
||||||
device=$1
|
device="$1"
|
||||||
|
|
||||||
# Abstraction modules aren't auto-loaded.
|
# Abstraction modules aren't auto-loaded.
|
||||||
abstraction="`${grub_probe} --device ${device} --target=abstraction`"
|
abstraction="`"${grub_probe}" --device "${device}" --target=abstraction`"
|
||||||
for module in ${abstraction} ; do
|
for module in ${abstraction} ; do
|
||||||
echo "insmod ${module}"
|
echo "insmod ${module}"
|
||||||
done
|
done
|
||||||
|
|
||||||
partmap="`${grub_probe} --device ${device} --target=partmap`"
|
partmap="`"${grub_probe}" --device "${device}" --target=partmap`"
|
||||||
for module in ${partmap} ; do
|
for module in ${partmap} ; do
|
||||||
case "${module}" in
|
case "${module}" in
|
||||||
netbsd | openbsd)
|
netbsd | openbsd)
|
||||||
|
@ -121,15 +121,15 @@ prepare_grub_to_access_device ()
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
fs="`${grub_probe} --device ${device} --target=fs`"
|
fs="`"${grub_probe}" --device "${device}" --target=fs`"
|
||||||
for module in ${fs} ; do
|
for module in ${fs} ; do
|
||||||
echo "insmod ${module}"
|
echo "insmod ${module}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# If there's a filesystem UUID that GRUB is capable of identifying, use it;
|
# If there's a filesystem UUID that GRUB is capable of identifying, use it;
|
||||||
# otherwise set root as per value in device.map.
|
# otherwise set root as per value in device.map.
|
||||||
echo "set root='`${grub_probe} --device ${device} --target=drive`'"
|
echo "set root='`"${grub_probe}" --device "${device}" --target=drive`'"
|
||||||
if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
|
if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
|
||||||
echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
|
echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -149,21 +149,21 @@ grub_file_is_not_garbage ()
|
||||||
|
|
||||||
version_test_numeric ()
|
version_test_numeric ()
|
||||||
{
|
{
|
||||||
local a=$1
|
local a="$1"
|
||||||
local cmp=$2
|
local cmp="$2"
|
||||||
local b=$3
|
local b="$3"
|
||||||
if [ "$a" = "$b" ] ; then
|
if [ "$a" = "$b" ] ; then
|
||||||
case $cmp in
|
case "$cmp" in
|
||||||
ge|eq|le) return 0 ;;
|
ge|eq|le) return 0 ;;
|
||||||
gt|lt) return 1 ;;
|
gt|lt) return 1 ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
if [ "$cmp" = "lt" ] ; then
|
if [ "$cmp" = "lt" ] ; then
|
||||||
c=$a
|
c="$a"
|
||||||
a=$b
|
a="$b"
|
||||||
b=$c
|
b="$c"
|
||||||
fi
|
fi
|
||||||
if (echo $a ; echo $b) | sort -n | head -n 1 | grep -qx $b ; then
|
if (echo "$a" ; echo "$b") | sort -n | head -n 1 | grep -qx "$b" ; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
@ -172,25 +172,25 @@ version_test_numeric ()
|
||||||
|
|
||||||
version_test_gt ()
|
version_test_gt ()
|
||||||
{
|
{
|
||||||
local a=`echo $1 | sed -e "s/[^-]*-//"`
|
local a="`echo "$1" | sed -e "s/[^-]*-//"`"
|
||||||
local b=`echo $2 | sed -e "s/[^-]*-//"`
|
local b="`echo "$2" | sed -e "s/[^-]*-//"`"
|
||||||
local cmp=gt
|
local cmp=gt
|
||||||
if [ "x$b" = "x" ] ; then
|
if [ "x$b" = "x" ] ; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
case $a:$b in
|
case "$a:$b" in
|
||||||
*.old:*.old) ;;
|
*.old:*.old) ;;
|
||||||
*.old:*) a=`echo -n $a | sed -e s/\.old$//` ; cmp=gt ;;
|
*.old:*) a="`echo -n "$a" | sed -e 's/\.old$//'`" ; cmp=gt ;;
|
||||||
*:*.old) b=`echo -n $b | sed -e s/\.old$//` ; cmp=ge ;;
|
*:*.old) b="`echo -n "$b" | sed -e 's/\.old$//'`" ; cmp=ge ;;
|
||||||
esac
|
esac
|
||||||
version_test_numeric $a $cmp $b
|
version_test_numeric "$a" "$cmp" "$b"
|
||||||
return $?
|
return "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
version_find_latest ()
|
version_find_latest ()
|
||||||
{
|
{
|
||||||
local a=""
|
local a=""
|
||||||
for i in $@ ; do
|
for i in "$@" ; do
|
||||||
if version_test_gt "$i" "$a" ; then
|
if version_test_gt "$i" "$a" ; then
|
||||||
a="$i"
|
a="$i"
|
||||||
fi
|
fi
|
||||||
|
@ -202,7 +202,7 @@ version_find_latest ()
|
||||||
# printf; so this turns ' into \'. Note that you must use the output of
|
# printf; so this turns ' into \'. Note that you must use the output of
|
||||||
# this function in a printf format string.
|
# this function in a printf format string.
|
||||||
gettext_quoted () {
|
gettext_quoted () {
|
||||||
$gettext "$@" | sed "s/'/'\\\\\\\\''/g"
|
"$gettext" "$@" | sed "s/'/'\\\\\\\\''/g"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run the first argument through gettext_quoted, and then pass that and all
|
# Run the first argument through gettext_quoted, and then pass that and all
|
||||||
|
@ -215,9 +215,9 @@ gettext_printf () {
|
||||||
}
|
}
|
||||||
|
|
||||||
uses_abstraction () {
|
uses_abstraction () {
|
||||||
device=$1
|
device="$1"
|
||||||
|
|
||||||
abstraction="`${grub_probe} --device ${device} --target=abstraction`"
|
abstraction="`"${grub_probe}" --device "${device}" --target=abstraction`"
|
||||||
for module in ${abstraction}; do
|
for module in ${abstraction}; do
|
||||||
if test "x${module}" = "x$2"; then
|
if test "x${module}" = "x$2"; then
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue