From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JlX4j-0001Io-3l for mharc-grub-devel@gnu.org; Mon, 14 Apr 2008 18:22:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JlX4e-0001CW-US for grub-devel@gnu.org; Mon, 14 Apr 2008 18:22:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JlX4d-00018H-Ck for grub-devel@gnu.org; Mon, 14 Apr 2008 18:22:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlX4d-00017W-33 for grub-devel@gnu.org; Mon, 14 Apr 2008 18:22:51 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JlX4c-0007Zu-Lu for grub-devel@gnu.org; Mon, 14 Apr 2008 18:22:50 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m3EMMn4k016377 for ; Mon, 14 Apr 2008 18:22:49 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3EMMmmc022751 for ; Mon, 14 Apr 2008 18:22:49 -0400 Received: from [10.34.1.17] (gopher.brq.redhat.com [10.34.1.17]) by pobox.stuttgart.redhat.com (8.13.1/8.13.1) with ESMTP id m3EMMmFE031513 for ; Mon, 14 Apr 2008 18:22:48 -0400 From: Lubomir Kundrak To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-hgf1IeexSrlxhYTsEFwv" Organization: Red Hat Inc. Date: Tue, 15 Apr 2008 00:22:48 +0200 Message-Id: <1208211768.3971.44.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] Extend the code to ignore junk files 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: Mon, 14 Apr 2008 22:22:54 -0000 --=-hgf1IeexSrlxhYTsEFwv Content-Type: text/plain Content-Transfer-Encoding: 7bit Self-explainable. Make update-grub ignore rpm leftover files and VIM swap files. 2008-04-15 Lubomir Kundrak * util/update-grub.in: replace the junk file switch with unconditional call to grub_file_is_not_garbage * util/update-grub_lib.in (grub_file_is_not_garbage): ignore also rpm leftover files and editor backup files -- Lubomir Kundrak (Red Hat Security Response Team) --=-hgf1IeexSrlxhYTsEFwv Content-Disposition: attachment; filename=grub-1.96-garbage.patch Content-Type: text/x-patch; name=grub-1.96-garbage.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -urp grub-1.96.orig/util/update-grub.in grub-1.96/util/update-grub.in --- grub-1.96.orig/util/update-grub.in 2008-04-15 00:16:12.000000000 +0200 +++ grub-1.96/util/update-grub.in 2008-04-15 00:17:06.000000000 +0200 @@ -145,18 +145,12 @@ cat << EOF EOF for i in ${update_grub_dir}/* ; do - case "$i" in - # emacsen backup files. FIXME: support other editors - *~) ;; - *) - if grub_file_is_not_garbage "$i" && test -x "$i" ; then - echo - echo "### BEGIN $i ###" - "$i" - echo "### END $i ###" - fi - ;; - esac + if grub_file_is_not_garbage "$i" && test -x "$i" ; then + echo + echo "### BEGIN $i ###" + "$i" + echo "### END $i ###" + fi done # none of the children aborted with error, install the new grub.cfg diff -urp grub-1.96.orig/util/update-grub_lib.in grub-1.96/util/update-grub_lib.in --- grub-1.96.orig/util/update-grub_lib.in 2008-04-15 00:16:12.000000000 +0200 +++ grub-1.96/util/update-grub_lib.in 2008-04-15 00:15:04.000000000 +0200 @@ -115,6 +115,8 @@ grub_file_is_not_garbage () if test -f "$1" ; then case "$1" in *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg + *.rpmnew|*.rpmsave) return 1 ;; # Fedora rpm + *.bak|*~|.*.swp) return 1 ;; # backup and swap files from editors esac else return 1 --=-hgf1IeexSrlxhYTsEFwv--