[PATCH 2/2] High Priority: Fix for "tar: Cowardly refusing to create an empty archive" from 'make tarball'

Shawn Wells shawn at redhat.com
Sat Apr 21 12:34:06 UTC 2012


After pull'ing the recent RPM build patches I received an error when doing a 'make all':

> tar -czf /var/www/html/scap-security-guide/rhel6/src/scap-security-guide-0.1.tar.gz
> tar: Cowardly refusing to create an empty archive
> Try `tar --help' or `tar --usage' for more information.
> make: *** [/var/www/html/scap-security-guide/rhel6/src/scap-security-guide-0.1.tar.gz] Error 2

This appears to be from a line in the make file, specifically $@ wasn't being expanded:

> tarball: $(TARBALL)
>
> $(TARBALL): dist $(TAR_DEPS)
>         tar -czf $@ $(TAR_DEPS)

I updated the tar -czf to give full paths and now the build process works. Verified by running a 'make all' and not getting any errors. Also the SRPM and RPM are properly created now.

-Shawn
---
 rhel6/src/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rhel6/src/Makefile b/rhel6/src/Makefile
index 462a2ae..ebb84ab 100644
--- a/rhel6/src/Makefile
+++ b/rhel6/src/Makefile
@@ -127,7 +127,8 @@ dist: content guide tables
 tarball: $(TARBALL)
 
 $(TARBALL): dist $(TAR_DEPS)
-	tar -czf $@ $(TAR_DEPS)
+#	tar -czf $@ $(TAR_DEPS)
+	tar -czf $(SRPM_OUTPUT_DIR)/$(DIST).tar.gz $(DIST)/*
 
 srpm: $(SRPM_OUTPUT_DIR)/$(DIST)-$(RELEASE).src.rpm
 
-- 
1.7.1


--VbJkn9YxBvnuCH5J--


More information about the scap-security-guide mailing list