]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Enclose all translated strings in grub.cfg in single quotes, and
authorCarles Pina i Estany <carles@pina.cat>
Tue, 13 Apr 2010 12:57:56 +0000 (13:57 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Tue, 13 Apr 2010 12:57:56 +0000 (13:57 +0100)
escape them appropriately (Ubuntu bug #552921).
* util/grub-mkconfig_lib.in (gettext_quoted): New function.
* util/grub.d/10_hurd.in: Use it.
* util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise.
* util/grub.d/10_linux.in (linux_entry): Likewise.
Also-By: Colin Watson <cjwatson@ubuntu.com>
ChangeLog
util/grub-mkconfig_lib.in
util/grub.d/10_hurd.in
util/grub.d/10_kfreebsd.in
util/grub.d/10_linux.in

index d766bcd50bcba9ae5c1e78af1b4cfd5aac67246b..4be24c1b2069a40409d2a6f5aff95fa5db9de51a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-04-13  Carles Pina i Estany  <carles@pina.cat>
+2010-04-13  Colin Watson  <cjwatson@ubuntu.com>
+
+       Enclose all translated strings in grub.cfg in single quotes, and
+       escape them appropriately (Ubuntu bug #552921).
+
+       * util/grub-mkconfig_lib.in (gettext_quoted): New function.
+       * util/grub.d/10_hurd.in: Use it.
+       * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise.
+       * util/grub.d/10_linux.in (linux_entry): Likewise.
+
 2010-04-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Fix cygwin compilation.
index bcd6baffb3cfa9fcc48b21b72eaa0efd96470d2f..a4151348ca92a1393c89b62e99f3861495f90b76 100644 (file)
@@ -188,3 +188,7 @@ version_find_latest ()
   done
   echo "$a"
 }
+
+gettext_quoted () {
+  gettext "$@" | sed "s/'/'\\\\''/g"
+}
index 5dbb11f224d7c8c60e482843f6050757d15e8d5e..8e16e7d9f74b73102081dc708e727fe521f5072c 100644 (file)
@@ -76,13 +76,13 @@ menuentry "${OS}" ${CLASS} {
 EOF
 prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
 cat << EOF
-       echo            $(gettext "Loading GNU Mach ...")
+       echo            '$(gettext_quoted "Loading GNU Mach ...")'
        multiboot       ${kernel} root=device:${GRUB_DEVICE#/dev/}
 EOF
 save_default_entry | sed -e "s/^/\t/"
 prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
 cat << EOF
-       echo            $(gettext "Loading the Hurd ...")
+       echo            '$(gettext_quoted "Loading the Hurd ...")'
        module          /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
                        --multiboot-command-line='\${kernel-command-line}' \\
                        --host-priv-port='\${host-port}' \\
@@ -98,13 +98,13 @@ menuentry "${OS} (recovery mode)" {
 EOF
 prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
 cat << EOF
-       echo            $(gettext "Loading GNU Mach ...")
+       echo            '$(gettext_quoted "Loading GNU Mach ...")'
        multiboot       ${kernel} root=device:${GRUB_DEVICE#/dev/} -s
 EOF
 save_default_entry | sed -e "s/^/\t/"
 prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
 cat << EOF
-       echo            $(gettext "Loading the Hurd ...")
+       echo            '$(gettext_quoted "Loading the Hurd ...")'
        module          /hurd/${hurd_fs}.static ${hurd_fs} \\
                        --multiboot-command-line='\${kernel-command-line}' \\
                        --host-priv-port='\${host-port}' \\
index 43651c82bdd43d4c57856a6a343299ee218c2c47..5ab54628217546a1d7b0dbe828fda654a580a34d 100644 (file)
@@ -44,15 +44,15 @@ kfreebsd_entry ()
   version="$2"
   recovery="$3"        # not used yet
   args="$4"    # not used yet
-  title="$(gettext "%s, with kFreeBSD %s")"
-  printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}"
+  title="$(gettext_quoted "%s, with kFreeBSD %s")"
+  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
   save_default_entry | sed -e "s/^/\t/"
   if [ -z "${prepare_boot_cache}" ]; then
     prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
   fi
   printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
-       echo                    $(printf "$(gettext "Loading kernel of FreeBSD %s ...")" ${version})
+       echo                    '$(printf "$(gettext_quoted "Loading kernel of FreeBSD %s ...")" ${version})'
        kfreebsd                ${rel_dirname}/${basename}
 EOF
 
index 8dc0df5d9180039802f77e0c57e994d7702f5ca5..e691cae86add610c750e3eada608ce0bbc9eb7b9 100644 (file)
@@ -56,11 +56,11 @@ linux_entry ()
   recovery="$3"
   args="$4"
   if ${recovery} ; then
-    title="$(gettext "%s, with Linux %s (recovery mode)")"
+    title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
   else
-    title="$(gettext "%s, with Linux %s")"
+    title="$(gettext_quoted "%s, with Linux %s")"
   fi
-  printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}"
+  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
   save_default_entry | sed -e "s/^/\t/"
 
   # Use ELILO's generic "efifb" when it's known to be available.
@@ -83,12 +83,12 @@ EOF
   fi
   printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
-       echo    $(printf "$(gettext "Loading Linux %s ...")" ${version})
+       echo    '$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})'
        linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     cat << EOF
-       echo    $(gettext "Loading initial ramdisk ...")
+       echo    '$(gettext_quoted "Loading initial ramdisk ...")'
        initrd  ${rel_dirname}/${initrd}
 EOF
   fi