From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VjhRf-0000Hn-ME for mharc-grub-devel@gnu.org; Thu, 21 Nov 2013 22:30:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjhRX-0000Fa-DQ for grub-devel@gnu.org; Thu, 21 Nov 2013 22:30:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjhRQ-00068W-Mx for grub-devel@gnu.org; Thu, 21 Nov 2013 22:30:07 -0500 Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:53206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjhRQ-00068Q-Fc for grub-devel@gnu.org; Thu, 21 Nov 2013 22:30:00 -0500 Received: by mail-ee0-f48.google.com with SMTP id e49so274407eek.7 for ; Thu, 21 Nov 2013 19:29:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=clTonM1SsDek//XpXuYjiUU3jNwNK2HeL2Td0J4gCig=; b=pTnAU3/vxB75q4+CBA/CFGdi4X+8h14v8RUXx0Slv6iqsvlUABQDsXIQSq3Qe3fz5Q 7pCNYEuuY8p4xM8+L9dc1FmH8X82Q0MG998gtUsSShQnnzYtm9wI+RRpS+KMf0KBILAK bk6MDvUzcrANUQy9YILUNFFHqil0FPtl/6UbNaC0kSPTGow78exw56tjVwGcihnDThyg 1eLw3ysxfXkbzf7K9W367tp90yI238a/ye5swhtFWoRNUfKvDUVxX26GMo1QLNoZ/2sU i6cp4wBJsqOjohV8FSOsuHg2FRAg9p24uyIP1+20avZSyQnN6zOzkeEY1aVwOidQxDum 6jEw== X-Received: by 10.15.91.3 with SMTP id r3mr13371861eez.18.1385090999506; Thu, 21 Nov 2013 19:29:59 -0800 (PST) Received: from [192.168.1.121] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id v45sm25379810eef.11.2013.11.21.19.29.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 19:29:48 -0800 (PST) Message-ID: <528ECFAB.7050609@gmail.com> Date: Fri, 22 Nov 2013 04:29:47 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] Add a --locale-directory option to grub-install and related tools. References: <20131121183206.GA1595@riva.ucam.org> In-Reply-To: <20131121183206.GA1595@riva.ucam.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2HSNPDQXEOGWAKLBKSONN" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::230 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 03:30:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2HSNPDQXEOGWAKLBKSONN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21.11.2013 19:32, Colin Watson wrote: > * include/grub/util/install.h (GRUB_INSTALL_OPTIONS): Add > --locale-directory option. > (enum grub_install_options): Add > GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY. > * util/grub-install-common.c (grub_install_help_filter): Handle > GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY. > (grub_install_parse): Likewise. > (get_localedir): New function to check for a user-provided option > before trying grub_util_get_localedir. > (copy_locales): Use get_localedir rather than > grub_util_get_localedir. > (grub_install_copy_files): Likewise. I think you need an addition to look for all of $localedir/$lang{.mo,.gmo} and $localedir/$lang/LC_MESSAGES/grub.mo. Like following (not tested): diff --git a/util/grub-install-common.c b/util/grub-install-common.c diff --git a/util/grub-install-common.c b/util/grub-install-common.c index 4e1d41a..bf722da 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -570,13 +586,26 @@ copy_locales (const char *dstd) { char *srcf; char *dstf; + char *ext; if (strcmp (de->d_name, ".") =3D=3D 0) continue; if (strcmp (de->d_name, "..") =3D=3D 0) continue; - srcf =3D grub_util_path_concat_ext (4, locale_dir, de->d_name, + ext =3D grub_strrchr (de->d_name, '.'); + if (ext && (grub_strcmp (ext, ".mo") =3D=3D 0 + || grub_strcmp (ext, ".gmo") =3D=3D 0)) + { + srcf =3D grub_util_path_concat (2, locale_dir, de->d_name); + dstf =3D grub_util_path_concat (2, dstd, de->d_name); + ext =3D grub_strrchr (dstf, '.'); + grub_strcpy (ext, ".mo"); + } + else + { + srcf =3D grub_util_path_concat_ext (4, locale_dir, de->d_name, "LC_MESSAGES", PACKAGE, ".mo"); - dstf =3D grub_util_path_concat_ext (2, dstd, de->d_name, ".mo"); + dstf =3D grub_util_path_concat_ext (2, dstd, de->d_name, ".mo")= ; + } grub_install_compress_file (srcf, dstf, 0); free (srcf); free (dstf); ------enig2HSNPDQXEOGWAKLBKSONN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKOz6sACgkQmBXlbbo5nOtZCwEAoU6pOsR8ncNTYLKSiwLf+w5C R8jMVhiKgfoLc7PLsGQBAIKytr+sBNcKTqAMHjRIl4KfCdyZRtnWfIcxD09DBHZz =gKNz -----END PGP SIGNATURE----- ------enig2HSNPDQXEOGWAKLBKSONN--