From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RNlz6-0008Pb-Vo for mharc-grub-devel@gnu.org; Tue, 08 Nov 2011 08:45:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNlyz-0008NW-9a for grub-devel@gnu.org; Tue, 08 Nov 2011 08:45:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNlyt-0004AG-CZ for grub-devel@gnu.org; Tue, 08 Nov 2011 08:44:57 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:56345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNlyt-0004A1-1s for grub-devel@gnu.org; Tue, 08 Nov 2011 08:44:51 -0500 Received: by eye4 with SMTP id 4so402296eye.0 for ; Tue, 08 Nov 2011 05:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type; bh=+sp9NvVuU6h8d3WC4Kdo6dw8siVhmaGfX2rKwzMiEsI=; b=uuIKwtqPR8BTM0/RtLl0gR/V1yHaGoDivzqbpztL98P4DIhN4li/rhEAowpeTYjuXR Zc00ywyp2QuQcRsR1cxCJ9ABmcmrUzElD2gyfYKDszvCKETZBSkVPheyOzZ3cLizGzk7 1ye8CZemiEWi4es2kIvWze1PVDGSIQ768I4RY= Received: by 10.14.14.210 with SMTP id d58mr2511907eed.22.1320759890038; Tue, 08 Nov 2011 05:44:50 -0800 (PST) Received: from debian.x201.phnet (public-docking-hg-3-176.ethz.ch. [129.132.246.176]) by mx.google.com with ESMTPS id q28sm4391875eea.6.2011.11.08.05.44.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Nov 2011 05:44:49 -0800 (PST) Message-ID: <4EB9324F.507@gmail.com> Date: Tue, 08 Nov 2011 14:44:47 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20111010 Iceowl/1.0b2 Icedove/3.1.15 MIME-Version: 1.0 To: The development of GRUB 2 Subject: [PATCH] Remove the usage of "local" in scripts X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig5AFA8F1D534056110D0353CB" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.169 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: Tue, 08 Nov 2011 13:45:03 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5AFA8F1D534056110D0353CB Content-Type: multipart/mixed; boundary="------------050207060902020508080607" This is a multi-part message in MIME format. --------------050207060902020508080607 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, all. While I'm not particularly fond of this change we need our scripts to be portable --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------050207060902020508080607 Content-Type: text/x-diff; name="eliminate_local.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="eliminate_local.diff" =3D=3D=3D modified file 'util/grub-mkconfig_lib.in' --- util/grub-mkconfig_lib.in 2011-09-05 12:58:33 +0000 +++ util/grub-mkconfig_lib.in 2011-11-08 13:19:18 +0000 @@ -167,21 +167,21 @@ =20 version_test_numeric () { - local a=3D"$1" - local cmp=3D"$2" - local b=3D"$3" - if [ "$a" =3D "$b" ] ; then - case "$cmp" in + version_test_numeric_a=3D"$1" + version_test_numeric_cmp=3D"$2" + version_test_numeric_b=3D"$3" + if [ "$version_test_numeric_a" =3D "$version_test_numeric_b" ] ; then + case "$version_test_numeric_cmp" in ge|eq|le) return 0 ;; gt|lt) return 1 ;; esac fi - if [ "$cmp" =3D "lt" ] ; then - c=3D"$a" - a=3D"$b" - b=3D"$c" + if [ "$version_test_numeric_cmp" =3D "lt" ] ; then + version_test_numeric_c=3D"$version_test_numeric_a" + version_test_numeric_a=3D"$version_test_numeric_b" + version_test_numeric_b=3D"$version_test_numeric_c" fi - if (echo "$a" ; echo "$b") | sort -n | head -n 1 | grep -qx "$b" ; the= n + if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") |= sort -n | head -n 1 | grep -qx "$version_test_numeric_b" ; then return 0 else return 1 @@ -190,30 +190,30 @@ =20 version_test_gt () { - local a=3D"`echo "$1" | sed -e "s/[^-]*-//"`" - local b=3D"`echo "$2" | sed -e "s/[^-]*-//"`" - local cmp=3Dgt - if [ "x$b" =3D "x" ] ; then + version_test_gt_a=3D"`echo "$1" | sed -e "s/[^-]*-//"`" + version_test_gt_b=3D"`echo "$2" | sed -e "s/[^-]*-//"`" + version_test_gt_cmp=3Dgt + if [ "x$version_test_gt_b" =3D "x" ] ; then return 0 fi - case "$a:$b" in + case "$version_test_gt_a:$version_test_gt_b" in *.old:*.old) ;; - *.old:*) a=3D"`echo -n "$a" | sed -e 's/\.old$//'`" ; cmp=3Dgt ;; - *:*.old) b=3D"`echo -n "$b" | sed -e 's/\.old$//'`" ; cmp=3Dge ;; + *.old:*) version_test_gt_a=3D"`echo -n "$version_test_gt_a" | sed -e= 's/\.old$//'`" ; cmp=3Dgt ;; + *:*.old) version_test_gt_b=3D"`echo -n "$version_test_gt_b" | sed -e= 's/\.old$//'`" ; cmp=3Dge ;; esac - version_test_numeric "$a" "$cmp" "$b" + version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$ver= sion_test_gt_b" return "$?" } =20 version_find_latest () { - local a=3D"" + version_find_latest_a=3D"" for i in "$@" ; do - if version_test_gt "$i" "$a" ; then - a=3D"$i" + if version_test_gt "$i" "$version_find_latest_a" ; then + version_find_latest_a=3D"$i" fi done - echo "$a" + echo "$version_find_latest_a" } =20 # One layer of quotation is eaten by "", the second by sed, and the thir= d by @@ -227,9 +227,9 @@ # remaining arguments to printf. This is a useful abbreviation and tend= s to # be easier to type. gettext_printf () { - local format=3D"$1" + gettext_printf_format=3D"$1" shift - printf "$(gettext_quoted "$format")" "$@" + printf "$(gettext_quoted "$gettext_printf_format")" "$@" } =20 uses_abstraction () { =3D=3D=3D modified file 'util/grub.d/10_windows.in' --- util/grub.d/10_windows.in 2011-10-23 20:40:26 +0000 +++ util/grub.d/10_windows.in 2011-11-08 13:43:38 +0000 @@ -42,14 +42,14 @@ sort | uniq | wc -l`" =3D 1 || return 1 =20 # Search 'default=3DPARTITION' - local part=3D`sed -n 's,^default=3D,,p' "$1" | sed 's,\\\\,/,g;s,[ \t\= r]*$,,;1q'` - test -n "$part" || return 1 + get_os_name_from_boot_ini_part=3D`sed -n 's,^default=3D,,p' "$1" | sed= 's,\\\\,/,g;s,[ \t\r]*$,,;1q'` + test -n "$get_os_name_from_boot_ini_part" || return 1 =20 # Search 'PARTITION=3D"NAME" ...' - local name=3D`sed -n 's,\\\\,/,g;s,^'"$part"'=3D"\([^"]*\)".*$,\1,p' "= $1" | sed 1q` - test -n "$name" || return 1 + get_os_name_from_boot_ini_name=3D`sed -n 's,\\\\,/,g;s,^'"$get_os_name= _from_boot_ini_part"'=3D"\([^"]*\)".*$,\1,p' "$1" | sed 1q` + test -n "$get_os_name_from_boot_ini_name" || return 1 =20 - echo "$name" + echo "$get_os_name_from_boot_ini_name" } =20 =20 --------------050207060902020508080607-- --------------enig5AFA8F1D534056110D0353CB 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.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk65Mk8ACgkQNak7dOguQgkYAQEAv7wG2RzZrUFsuTFGSnKmp3RE Bk5T+veHSjKSYstRIBQA/3ohOR+QdhCVkNH3z4kkTTJz6kpSallYrcqv72bmYXjc =GQQV -----END PGP SIGNATURE----- --------------enig5AFA8F1D534056110D0353CB--