Back-patch creation of tar.bz2 tarball during "make dist".
authorTom Lane <[email protected]>
Sun, 3 Jul 2011 20:40:28 +0000 (16:40 -0400)
committerTom Lane <[email protected]>
Sun, 3 Jul 2011 20:40:28 +0000 (16:40 -0400)
Since commit a4d03bbcdaf7739d7e9073ee76bb186f68ddc163, "make dist" has
built both gzip- and bzip2-compressed tarballs.  However, this was
pretty useless, because our tarball build script didn't know about it
and proceeded to overwrite the bz2 file with new data.  Back-patch the
change to all active branches, so that creation of the tar.bz2 file
can be removed from the build script.

GNUmakefile.in
src/Makefile.global.in

index 5e7575abf9ba9f202a3a47e88357b6bd400ec5ca..c924f305994c25c2133b5e554d3fa61a2b5823a7 100644 (file)
@@ -86,7 +86,7 @@ distdir   = postgresql-$(VERSION)
 dummy  = =install=
 garbage = =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
 
-dist: $(distdir).tar.gz 
+dist: $(distdir).tar.gz $(distdir).tar.bz2
 ifeq ($(split-dist), yes)
 dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz 
 endif
@@ -96,6 +96,8 @@ dist:
 $(distdir).tar: distdir
    $(TAR) chf $@ $(distdir)
 
+.INTERMEDIATE: $(distdir).tar
+
 opt_files = \
    src/tools src/tutorial \
    $(addprefix src/pl/, plperl plpython tcl)
@@ -134,10 +136,10 @@ distdir:
    $(MAKE) -C $(distdir) distclean
    rm -f $(distdir)/README.git
 
-distcheck: $(distdir).tar.gz
+distcheck: dist
    rm -rf $(dummy)
    mkdir $(dummy)
-   $(GZIP) -d -c $< | $(TAR) xf -
+   $(GZIP) -d -c $(distdir).tar.gz | $(TAR) xf -
    install_prefix=`cd $(dummy) && pwd`; \
    cd $(distdir) \
    && ./configure --prefix="$$install_prefix"
index 763bdc004a04a2da4e19598c4f81230bbb88f3c5..17d3772e96c8861735811c8fc87092f0efdeafc0 100644 (file)
@@ -476,10 +476,10 @@ TAS         = @TAS@
    $(CPP) $(CPPFLAGS) -o $@ $<
 
 %.gz: %
-   $(GZIP) -f --best $<
+   $(GZIP) --best -c $< >$@
 
 %.bz2: %
-   $(BZIP2) -f $<
+   $(BZIP2) -c $< >$@
 
 ifndef PGXS