From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MYzQW-0000xT-RF for mharc-grub-devel@gnu.org; Thu, 06 Aug 2009 05:38:24 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYzQU-0000vs-RS for grub-devel@gnu.org; Thu, 06 Aug 2009 05:38:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYzQQ-0000tA-Ra for grub-devel@gnu.org; Thu, 06 Aug 2009 05:38:22 -0400 Received: from [199.232.76.173] (port=55130 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYzQQ-0000sv-Gv for grub-devel@gnu.org; Thu, 06 Aug 2009 05:38:18 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:54539) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYzQN-0007zN-3w for grub-devel@gnu.org; Thu, 06 Aug 2009 05:38:16 -0400 Received: from [85.180.12.79] (e180012079.adsl.alicedsl.de [85.180.12.79]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MKv5w-1MYzQK0NRM-000cXF; Thu, 06 Aug 2009 11:38:12 +0200 From: Felix Zielcke To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-S9ArK7PQD3izZQouTS86" Date: Thu, 06 Aug 2009 11:39:11 +0200 Message-Id: <1249551551.3663.7.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.27.5 X-Provags-ID: V01U2FsdGVkX1+umbDUAPTA2gk9h4NJZKlgylvvQESePJR+6qa RqeBnFZbJ0C+G8P/LkctKyodVMmNb89W1uNVRuXvRCwChLwqhp 0v48SvvwvMSXnP0V027Kw== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] move functionality of font_path() directly to util/grub-mkconfig.in and prefer unicode.pf2 over ascii.pf2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2009 09:38:23 -0000 --=-S9ArK7PQD3izZQouTS86 Content-Type: text/plain Content-Transfer-Encoding: 7bit As discussed with Robert on IRC I moved the font_path function directly to grub-mkconfig where it's only used. And now the unicode font gets prefered over the ascii one. And LANG=C gets exported if ascii.pf2 gets used, which is the main reason for the move of it. -- Felix Zielcke Proud Debian Maintainer --=-S9ArK7PQD3izZQouTS86 Content-Disposition: attachment; filename="font.diff" Content-Type: text/x-patch; name="font.diff"; charset="UTF-8" Content-Transfer-Encoding: 7bit 2009-08-06 Felix Zielcke * util/grub-mkconfig_lib.in (font_path): Move the functionality of it to ... * util/grub-mkconfig.in: ... here. Prefer unicode.pf2 and unifont.pf2 over ascii.pf2. Export LANG=C in case ascii.pf2 gets used. Index: util/grub-mkconfig.in =================================================================== --- util/grub-mkconfig.in (revision 2469) +++ util/grub-mkconfig.in (working copy) @@ -24,6 +24,8 @@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ package_version=@PACKAGE_VERSION@ +datadir=@datadir@ +pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg="" grub_mkconfig_dir=${sysconfdir}/grub.d @@ -151,22 +153,30 @@ esac # check for terminals that require fonts case ${GRUB_TERMINAL_OUTPUT} in gfxterm) - if path=`font_path` ; then - GRUB_FONT_PATH="${path}" - else - # fallback to the native terminal for this platform - unset GRUB_TERMINAL_OUTPUT + for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do + for basename in unicode unifont ascii; do + path="${dir}/${basename}.pf2" + if is_path_readable_by_grub ${path} > /dev/null ; then + GRUB_FONT_PATH=${path} + else + continue + fi + if [ "${basename}" = "ascii"] ; then + # make sure all our children behave in conformance with ascii.. + export LANG=C + fi + break 2 + done + done + if [ -z "${GRUB_FONT_PATH}" ] ; then + # fallback to the native terminal for this platform + unset GRUB_TERMINAL_OUTPUT + fi fi ;; -esac - -# does our terminal support utf-8 ? -case ${GRUB_TERMINAL_OUTPUT} in - gfxterm) ;; *) # make sure all our children behave in conformance with ascii.. export LANG=C - ;; esac # These are defined in this script, export them here so that user can Index: util/grub-mkconfig_lib.in =================================================================== --- util/grub-mkconfig_lib.in (revision 2470) +++ util/grub-mkconfig_lib.in (working copy) @@ -148,23 +148,6 @@ prepare_grub_to_access_device () fi } -font_path () -{ - for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do - # FIXME: We prefer ascii because loading complete fonts is too slow (and - # we don't yet provide the gettext magic that would make unicode useful). - for basename in ascii unicode unifont ; do - path="${dir}/${basename}.pf2" - if is_path_readable_by_grub ${path} > /dev/null ; then - echo "${path}" - return 0 - fi - done - done - - return 1 -} - grub_file_is_not_garbage () { if test -f "$1" ; then --=-S9ArK7PQD3izZQouTS86--