All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lubomir Kundrak <lkundrak@redhat.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] Extend the code to ignore junk files
Date: Tue, 15 Apr 2008 00:22:48 +0200	[thread overview]
Message-ID: <1208211768.3971.44.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

Self-explainable. Make update-grub ignore rpm leftover files and VIM
swap files.

2008-04-15  Lubomir Kundrak  <lkundrak@redhat.com>

	* 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)

[-- Attachment #2: grub-1.96-garbage.patch --]
[-- Type: text/x-patch, Size: 1345 bytes --]

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

             reply	other threads:[~2008-04-14 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 22:22 Lubomir Kundrak [this message]
2008-04-15 13:20 ` [PATCH] Extend the code to ignore junk files Robert Millan
2008-04-15 18:32   ` Chris Knadle
2008-04-15 18:56     ` Pavel Roskin
2008-04-17 16:01     ` Lubomir Kundrak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1208211768.3971.44.camel@localhost.localdomain \
    --to=lkundrak@redhat.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.