All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix locale installation
@ 2010-03-19 11:50 Colin Watson
  2010-03-19 20:35 ` Carles Pina i Estany
  0 siblings, 1 reply; 5+ messages in thread
From: Colin Watson @ 2010-03-19 11:50 UTC (permalink / raw)
  To: grub-devel

(cpina, if you're reading, I'd particularly appreciate your review.)

As far as I can see, locale installation is just wrong right now.
${pkglibdir}/locale/*.mo never exists, and copying files from
${grubdir}/locale/ to ${grubdir}/locale/ is pretty odd too ...

I think this patch matches reality rather better.

2010-03-19  Colin Watson  <cjwatson@ubuntu.com>

	* util/grub-install.in: Copy .mo files from @datadir@/locale, to
	match where 'make install' puts them.
	* util/i386/efi/grub-install.in: Likewise.

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2010-02-03 00:24:07 +0000
+++ util/grub-install.in	2010-03-19 01:04:39 +0000
@@ -32,6 +32,7 @@ platform=@platform@
 host_os=@host_os@
 font=@datadir@/@PACKAGE_TARNAME@/ascii.pf2
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
+localedir=@datadir@/locale
 
 grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
 if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] || [ "${target_cpu}-${platform}" = "mips-yeeloong" ] ; then
@@ -263,9 +264,9 @@ fi
 
 # Copy gettext files
 mkdir -p ${grubdir}/locale/
-for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do
-    if test -f "$file"; then
-        cp -f "$file" ${grubdir}/locale/
+for dir in ${localedir}/*; do
+    if test -f "$dir/LC_MESSAGES/grub.mo"; then
+        cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo"
     fi
 done
 

=== modified file 'util/i386/efi/grub-install.in'
--- util/i386/efi/grub-install.in	2010-03-04 14:12:34 +0000
+++ util/i386/efi/grub-install.in	2010-03-19 01:04:36 +0000
@@ -31,6 +31,7 @@ target_cpu=@target_cpu@
 platform=@platform@
 host_os=@host_os@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
+localedir=@datadir@/locale
 
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
@@ -182,9 +183,9 @@ done
 
 # Copy gettext files
 mkdir -p ${grubdir}/locale/
-for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do
-    if test -f "$file"; then
-        cp -f "$file" ${grubdir}/locale/
+for dir in ${localedir}/*; do
+    if test -f "$dir/LC_MESSAGES/grub.mo"; then
+        cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo"
     fi
 done
 

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-21 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 11:50 [PATCH] Fix locale installation Colin Watson
2010-03-19 20:35 ` Carles Pina i Estany
2010-03-19 22:21   ` Colin Watson
2010-03-19 22:28     ` Carles Pina i Estany
2010-03-21 23:07       ` Colin Watson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.