The current method of creating the tarball, which is to the hard-link the source directory to the target directory, results in self-referential hardlinks which can be observed using tar xf. This patch resolves this by using an intermediate tarball, held in memory, which collects files to be distributed. This is then unpacked in the target directory which is finally packed into the distribution tarball, a file.
Unified · Split
| @@ -201,14 +201,13 @@ configure: configure.ac · 200 unmodified lines | ||
| 201 | 201 | tarball: $(TARBALL.gz) |
| 202 | 202 | |
| 203 | 203 | $(TARBALL): $(SRCS) $(GENERATED_SRCS) |
| 204 | − $(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 205 | − $(LN) -s $(srcdir) $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 204 | + $(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 205 | + $(MKDIR) $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 206 | + $(TAR) -c $(SRCS) $(GENERATED_SRCS) | \ | |
| 207 | + $(TAR) -C $(PACKAGE_NAME)-$(PACKAGE_VERSION) -x | |
| 206 | 208 | $(TAR) -cf $@ $(PSRCS) |
| 207 | − $(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 208 | − $(LN) -sf . $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 209 | 209 | $(TAR) -rf $@ $(PGSRCS) |
| 210 | − $(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 211 | − @echo $(dist) | |
| 210 | + $(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION) | |
| 212 | 211 | |
| 213 | 212 | $(TARBALL.gz): $(TARBALL) |
| 214 | 213 | gzip -c < $^ > $@ |