diff mbox

file timestamp not needed in pci.ids.gz

Message ID 1246009067-4532-1-git-send-email-g.esp@free.fr (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Gilles Espinasse June 26, 2009, 9:37 a.m. UTC
File timestamp (and file name) have no use for pci.ids.gz
This allow to produce the exact same file even when compiled at different times.
That make paranoid happy.

Even gzip-1.2.4 from 1993 support -n option

Concerning the fact that -n did not include file name, that does not matter
unless the compressed file is moved under a different name and later -N option
 is used to open the file.

[chroot-i486] root:/$ gzip -9 /usr/share/pci.ids
[chroot-i486] root:/$ gzip -l /usr/share/pci.ids.gz
         compressed        uncompressed  ratio uncompressed_name
             161106              590309  72.7% /usr/share/pci.ids
[chroot-i486] root:/$ mv /usr/share/pci.ids.gz /usr/share/pci.foo.gz
[chroot-i486] root:/$ gzip -lN /usr/share/pci.foo.gz
         compressed        uncompressed  ratio uncompressed_name
             161106              590309  72.7% /usr/share/pci.ids
[chroot-i486] root:/$ gzip -dN /usr/share/pci.foo.gz
[chroot-i486] root:/$ ls -l /usr/share/pci.ids
-rw-r--r-- 1 root root 590309 Jun 26 07:59 /usr/share/pci.ids

[chroot-i486] root:/$ gzip -9n /usr/share/pci.ids
[chroot-i486] root:/$ mv /usr/share/pci.ids.gz /usr/share/pci.foo.gz
[chroot-i486] root:/$ gzip -lN /usr/share/pci.foo.gz
         compressed        uncompressed  ratio uncompressed_name
             161098              590309  72.7% /usr/share/pci.foo

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Martin Mareš July 4, 2009, 1:48 p.m. UTC | #1
Hello!

> File timestamp (and file name) have no use for pci.ids.gz
> This allow to produce the exact same file even when compiled at different times.

Good idea, thanks. Applied.

				Have a nice fortnight
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 140c87a..0169f76 100644
--- a/Makefile
+++ b/Makefile
@@ -131,6 +131,6 @@  ifeq ($(SHARED),yes)
 endif
 
 pci.ids.gz: pci.ids
-	gzip -9 <$< >$@
+	gzip -9n <$< >$@
 
 .PHONY: all clean distclean install install-lib uninstall force