0e50f1
http://lists.gnu.org/archive/html/grub-devel/2008-04/msg00079.html
0e50f1
0e50f1
Self-explainable. Make update-grub ignore rpm leftover files and VIM
0e50f1
swap files.
0e50f1
0e50f1
2008-04-15  Lubomir Kundrak  <lkundrak@redhat.com>
0e50f1
0e50f1
        * util/update-grub.in: replace the junk file switch with
0e50f1
        unconditional call to grub_file_is_not_garbage
0e50f1
        * util/update-grub_lib.in (grub_file_is_not_garbage): ignore
0e50f1
        also rpm leftover files and editor backup files
0e50f1
0e50f1
diff -urp grub-1.96.orig/util/update-grub.in grub-1.96/util/update-grub.in
0e50f1
--- grub-1.96.orig/util/update-grub.in  2008-04-15 00:16:12.000000000 +0200
0e50f1
+++ grub-1.96/util/update-grub.in       2008-04-15 00:17:06.000000000 +0200
0e50f1
@@ -145,18 +145,12 @@ cat << EOF
0e50f1
 EOF
0e50f1
 
0e50f1
 for i in ${update_grub_dir}/* ; do
0e50f1
-  case "$i" in
0e50f1
-    # emacsen backup files. FIXME: support other editors
0e50f1
-    *~) ;;
0e50f1
-    *)
0e50f1
-      if grub_file_is_not_garbage "$i" && test -x "$i" ; then
0e50f1
-        echo
0e50f1
-        echo "### BEGIN $i ###"
0e50f1
-        "$i"
0e50f1
-        echo "### END $i ###"
0e50f1
-      fi
0e50f1
-    ;;
0e50f1
-  esac
0e50f1
+  if grub_file_is_not_garbage "$i" && test -x "$i" ; then
0e50f1
+    echo
0e50f1
+    echo "### BEGIN $i ###"
0e50f1
+    "$i"
0e50f1
+    echo "### END $i ###"
0e50f1
+  fi
0e50f1
 done
0e50f1
 
0e50f1
 # none of the children aborted with error, install the new grub.cfg
0e50f1
diff -urp grub-1.96.orig/util/update-grub_lib.in grub-1.96/util/update-grub_lib.in
0e50f1
--- grub-1.96.orig/util/update-grub_lib.in      2008-04-15 00:16:12.000000000 +0200
0e50f1
+++ grub-1.96/util/update-grub_lib.in   2008-04-15 00:15:04.000000000 +0200
0e50f1
@@ -115,6 +115,8 @@ grub_file_is_not_garbage ()
0e50f1
   if test -f "$1" ; then
0e50f1
     case "$1" in
0e50f1
       *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg
0e50f1
+      *.rpmnew|*.rpmsave) return 1 ;; # Fedora rpm
0e50f1
+      *.bak|*~|.*.swp) return 1 ;;    # backup and swap files from editors
0e50f1
     esac
0e50f1
   else
0e50f1
     return 1