]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-01-10 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Thu, 10 Jan 2008 13:52:24 +0000 (13:52 +0000)
committerrobertmh <robertmh@localhost>
Thu, 10 Jan 2008 13:52:24 +0000 (13:52 +0000)
        * util/update-grub_lib.in (grub_file_is_not_garbage): New function.
        Determines if a file is garbage left by packaging systems, etc.
        * util/update-grub.in: Use grub_file_is_not_garbage() as a condition
        for processing /etc/grub.d scripts.
        * util/grub.d/10_hurd.in: Fix `GRUB_DISTRIBUTOR' comparison.
        * util/grub.d/10_linux.in: Likewise.  Use grub_file_is_not_garbage()
        as a condition for processing Linux images.

ChangeLog
util/grub.d/10_hurd.in
util/grub.d/10_linux.in
util/update-grub.in
util/update-grub_lib.in

index 0392f89e3c74ab3e6f8e9731919cbdcee1b3c2b8..bee07ab5aac8e5bca367acef906152768bdef69f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-10  Robert Millan  <rmh@aybabtu.com>
+
+       * util/update-grub_lib.in (grub_file_is_not_garbage): New function.
+       Determines if a file is garbage left by packaging systems, etc.
+       * util/update-grub.in: Use grub_file_is_not_garbage() as a condition
+       for processing /etc/grub.d scripts.
+       * util/grub.d/10_hurd.in: Fix `GRUB_DISTRIBUTOR' comparison.
+       * util/grub.d/10_linux.in: Likewise.  Use grub_file_is_not_garbage()
+       as a condition for processing Linux images.
+
 2008-01-10  Pavel Roskin  <proski@gnu.org>
 
        * include/grub/powerpc/libgcc.h (__ucmpdi2): New export.  Needed
index 1ec222542d571511edd075d29ba743c4c3918c91..dac54b12b38137de04ed6b901a302d341957f05d 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh -e
 
 # update-grub helper script.
-# Copyright (C) 2006,2007  Free Software Foundation, Inc.
+# Copyright (C) 2006,2007,2008  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
-if [ "x${GRUB_DISTRIBUTOR}" = "" ] ; then
+if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU
 else
   OS="${GRUB_DISTRIBUTOR} GNU/Hurd"
index 7aaed19f8c76cfdf5ccf8f9de59fb59ce9762b8d..390f4f619aed0fa3290a8d1621d951762b397925 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh -e
 
 # update-grub helper script.
-# Copyright (C) 2006,2007  Free Software Foundation, Inc.
+# Copyright (C) 2006,2007,2008  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
-if [ "x${GRUB_DISTRIBUTOR}" = "" ] ; then
+libdir=@libdir@
+. ${libdir}/grub/update-grub_lib
+
+if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU/Linux
 else
   OS="${GRUB_DISTRIBUTOR} GNU/Linux"
@@ -74,7 +77,7 @@ find_latest ()
 }
 
 list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
-        if test -e $i ; then echo -n "$i " ; fi
+        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
       done`
 
 while [ "x$list" != "x" ] ; do
index f60e6287c564450ac9cac7f918be2f95e1b240f9..7e33eee1166aab648fad0961f5c54de388ac5525 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh -e
 
 # Generate grub.cfg by inspecting /boot contents.
-# Copyright (C) 2006,2007  Free Software Foundation, Inc.
+# Copyright (C) 2006,2007,2008  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -145,7 +145,7 @@ for i in ${update_grub_dir}/* ; do
     # emacsen backup files. FIXME: support other editors
     *~) ;;
     *)
-      if test -f "$i" && test -x "$i" ; then
+      if grub_file_is_not_garbage "$i" && test -x "$i" ; then
         echo
         echo "### BEGIN $i ###"
         "$i"
index fd46f2103f215cd2200f016f8f54951003931ba5..7e5d4393f259f626f95195df1a9ecdeb4afa84c7 100644 (file)
@@ -113,3 +113,15 @@ font_path ()
 
   return 1
 }
+
+grub_file_is_not_garbage ()
+{
+  if test -f "$1" ; then
+    case "$1" in
+      *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg
+    esac
+  else
+    return 1
+  fi
+  return 0
+}