Change tarball compression from gzip to bzip2.
Set the user and group of all files to root. (This is not portable across all tar versions.)
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-make_tarball_fix/Makefile =================================================================== --- flashrom-make_tarball_fix/Makefile (Revision 636) +++ flashrom-make_tarball_fix/Makefile (Arbeitskopie) @@ -136,9 +136,9 @@ @echo Exported $(EXPORTDIR)/flashrom-$(VERSION)/
tarball: export - @tar cfz $(EXPORTDIR)/flashrom-$(VERSION).tar.gz -C $(EXPORTDIR)/ flashrom-$(VERSION)/ + @tar cjf $(EXPORTDIR)/flashrom-$(VERSION).tar.bz2 -C $(EXPORTDIR)/ --owner=root --group=root flashrom-$(VERSION)/ @rm -rf $(EXPORTDIR)/flashrom-$(VERSION) - @echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.gz + @echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.bz2
.PHONY: all clean distclean dep compiler pciutils features export tarball
On 29.06.2009 13:20, Carl-Daniel Hailfinger wrote:
Change tarball compression from gzip to bzip2.
Set the user and group of all files to root. (This is not portable across all tar versions.)
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
New version. Use --owner=root --group=root only for GNU tar.
Index: flashrom-make_tarball_fix/Makefile =================================================================== --- flashrom-make_tarball_fix/Makefile (Revision 636) +++ flashrom-make_tarball_fix/Makefile (Arbeitskopie) @@ -71,6 +71,8 @@
FEATURE_LIBS = $(shell LANG=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi")
+TAROPTIONS = $(shell LANG=C tar --version|grep -q GNU && echo "--owner=root --group=root") + %.o: %.c .features $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
@@ -136,9 +138,9 @@ @echo Exported $(EXPORTDIR)/flashrom-$(VERSION)/
tarball: export - @tar cfz $(EXPORTDIR)/flashrom-$(VERSION).tar.gz -C $(EXPORTDIR)/ flashrom-$(VERSION)/ + @tar cjf $(EXPORTDIR)/flashrom-$(VERSION).tar.bz2 -C $(EXPORTDIR)/ $(TAROPTIONS) flashrom-$(VERSION)/ @rm -rf $(EXPORTDIR)/flashrom-$(VERSION) - @echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.gz + @echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.bz2
.PHONY: all clean distclean dep compiler pciutils features export tarball
Change tarball compression from gzip to bzip2.
Set the user and group of all files to root for tar versions which support it. Add explanatory comments for supporting that feature with other tar versions.
Use LC_ALL instead of LANG everywhere.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-make_tarball_fix/Makefile =================================================================== --- flashrom-make_tarball_fix/Makefile (Revision 637) +++ flashrom-make_tarball_fix/Makefile (Arbeitskopie) @@ -58,7 +58,7 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # will not require subversion. The downloadable snapshots are already exported. -SVNVERSION := $(shell LANG=C svnversion -cn . | sed -e "s/.*://" -e "s/([0-9]*).*/\1/" | grep "[0-9]" || echo unknown) +SVNVERSION := $(shell LC_ALL=C svnversion -cn . | sed -e "s/.*://" -e "s/([0-9]*).*/\1/" | grep "[0-9]" || echo unknown)
VERSION := 0.9.0-r$(SVNVERSION)
@@ -67,10 +67,15 @@ $(PROGRAM): $(OBJS) $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) $(FEATURE_LIBS)
-FEATURE_CFLAGS = $(shell LANG=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'") +FEATURE_CFLAGS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'")
-FEATURE_LIBS = $(shell LANG=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi") +FEATURE_LIBS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi")
+# TAROPTIONS reduces information leakage from the packager's system. +# If other tar programs support command line arguments for setting uid/gid of +# stored files, they can be handled here as well. +TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root") + %.o: %.c .features $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
@@ -137,9 +142,9 @@ @echo Exported $(EXPORTDIR)/flashrom-$(VERSION)/
tarball: export - @tar cfz $(EXPORTDIR)/flashrom-$(VERSION).tar.gz -C $(EXPORTDIR)/ flashrom-$(VERSION)/ + @tar cjf $(EXPORTDIR)/flashrom-$(VERSION).tar.bz2 -C $(EXPORTDIR)/ $(TAROPTIONS) flashrom-$(VERSION)/ @rm -rf $(EXPORTDIR)/flashrom-$(VERSION) - @echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.gz + @echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.bz2
.PHONY: all clean distclean dep compiler pciutils features export tarball
On 30.06.2009 14:53, Carl-Daniel Hailfinger wrote:
Change tarball compression from gzip to bzip2.
Set the user and group of all files to root for tar versions which support it. Add explanatory comments for supporting that feature with other tar versions.
Use LC_ALL instead of LANG everywhere.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Thanks to Stefan for the Ack. Committed in r644.
Regards, Carl-Daniel