All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Extend the code to ignore junk files
@ 2008-04-14 22:22 Lubomir Kundrak
  2008-04-15 13:20 ` Robert Millan
  0 siblings, 1 reply; 5+ messages in thread
From: Lubomir Kundrak @ 2008-04-14 22:22 UTC (permalink / raw)
  To: The development of GRUB 2

[-- 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Extend the code to ignore junk files
  2008-04-14 22:22 [PATCH] Extend the code to ignore junk files Lubomir Kundrak
@ 2008-04-15 13:20 ` Robert Millan
  2008-04-15 18:32   ` Chris Knadle
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Millan @ 2008-04-15 13:20 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, Apr 15, 2008 at 12:22:48AM +0200, Lubomir Kundrak wrote:
> --- 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

This has the side-effect that Linux images whose name ends with ~ are excluded,
which is probably not that uncommon.  E.g. /boot/vmlinuz-2.6.24.foobar~

Is this really what we want?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Extend the code to ignore junk files
  2008-04-15 13:20 ` Robert Millan
@ 2008-04-15 18:32   ` Chris Knadle
  2008-04-15 18:56     ` Pavel Roskin
  2008-04-17 16:01     ` Lubomir Kundrak
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Knadle @ 2008-04-15 18:32 UTC (permalink / raw)
  To: The development of GRUB 2

On Tuesday 15 April 2008, Robert Millan wrote:
> On Tue, Apr 15, 2008 at 12:22:48AM +0200, Lubomir Kundrak wrote:
> > --- 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
>
> This has the side-effect that Linux images whose name ends with ~ are
> excluded, which is probably not that uncommon.  E.g.
> /boot/vmlinuz-2.6.24.foobar~
>
> Is this really what we want?

   I don't know of any localversion policy requiring that the last character 
not be a tilde character.  However, I can say that 'fakeroot make-kpkg 
kernel_image' fails at the very last stage during making a .deb if the last 
character in the localversion ends in a tilde.  i.e. you can't build a 
kernel "the Debian way" that has a localversion ending in a tilde.

     dpkg-gencontrol: error: Illegal package name `linux-image-2.6.24.4-yee~'
     make[1]: *** [debian/linux-image-2.6.24.4-yee~] Error 255

   But a localversion ending in a tilde is fine as far as the Linux 'make' 
system is concerned, so the generic 'make install' method which is commonly 
used on many systems will still allow it.

   -- Chris

-- 

Chris Knadle
Chris.Knadle@coredump.us



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Extend the code to ignore junk files
  2008-04-15 18:32   ` Chris Knadle
@ 2008-04-15 18:56     ` Pavel Roskin
  2008-04-17 16:01     ` Lubomir Kundrak
  1 sibling, 0 replies; 5+ messages in thread
From: Pavel Roskin @ 2008-04-15 18:56 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, 2008-04-15 at 14:32 -0400, Chris Knadle wrote:
> On Tuesday 15 April 2008, Robert Millan wrote:
> > This has the side-effect that Linux images whose name ends with ~ are
> > excluded, which is probably not that uncommon.  E.g.
> > /boot/vmlinuz-2.6.24.foobar~
> >
> > Is this really what we want?
> 
>    I don't know of any localversion policy requiring that the last character 
> not be a tilde character.  However, I can say that 'fakeroot make-kpkg 
> kernel_image' fails at the very last stage during making a .deb if the last 
> character in the localversion ends in a tilde.  i.e. you can't build a 
> kernel "the Debian way" that has a localversion ending in a tilde.

Let's remember a simple rule: "be liberal in what you accept and
conservative in what you send".  Unless we know that the tilde is used
for junk (i.e. kernels that nobody would want to boot), let's accept it.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Extend the code to ignore junk files
  2008-04-15 18:32   ` Chris Knadle
  2008-04-15 18:56     ` Pavel Roskin
@ 2008-04-17 16:01     ` Lubomir Kundrak
  1 sibling, 0 replies; 5+ messages in thread
From: Lubomir Kundrak @ 2008-04-17 16:01 UTC (permalink / raw)
  To: The development of GRUB 2


On Tue, 2008-04-15 at 14:32 -0400, Chris Knadle wrote:
> On Tuesday 15 April 2008, Robert Millan wrote:
> > On Tue, Apr 15, 2008 at 12:22:48AM +0200, Lubomir Kundrak wrote:
> > > --- 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
> >
> > This has the side-effect that Linux images whose name ends with ~ are
> > excluded, which is probably not that uncommon.  E.g.
> > /boot/vmlinuz-2.6.24.foobar~
> >
> > Is this really what we want?

Not uncommon; well -- I've never seen that, nor heard about if as being
a custom -- but it might be just that have not seen enough.

>    I don't know of any localversion policy requiring that the last character 
> not be a tilde character.

I think the localversion policy doesn't forbid the names ending
with .dpkg-dist or .bak as well.

> However, I can say that 'fakeroot make-kpkg 
> kernel_image' fails at the very last stage during making a .deb if the last 
> character in the localversion ends in a tilde.  i.e. you can't build a 
> kernel "the Debian way" that has a localversion ending in a tilde.
> 
>      dpkg-gencontrol: error: Illegal package name `linux-image-2.6.24.4-yee~'
>      make[1]: *** [debian/linux-image-2.6.24.4-yee~] Error 255

I'm fairly sure rpm doesn't allow this too.

-- 
Lubomir Kundrak (Red Hat Security Response Team)




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-17 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-14 22:22 [PATCH] Extend the code to ignore junk files Lubomir Kundrak
2008-04-15 13:20 ` Robert Millan
2008-04-15 18:32   ` Chris Knadle
2008-04-15 18:56     ` Pavel Roskin
2008-04-17 16:01     ` Lubomir Kundrak

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.