[rhel7-branch 5/8] livemedia-creator: Add --no-recursion to mktar (#1144140)

Brian C. Lane bcl at redhat.com
Tue Sep 23 00:28:40 UTC 2014

tar recurses into directories by default, but find is feeding it all the
files and directories so the tar it produces is considerably larger than
it needs to be due to duplicate files. Add --no-recursion flag so that
tar will only add the specific files and directories piped to it by find.

Related: rhbz#1144140
 src/pylorax/imgutils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py
index e202c65..91fd73c 100644
--- a/src/pylorax/imgutils.py
+++ b/src/pylorax/imgutils.py
@@ -78,7 +78,8 @@ def mkcpio(rootdir, outfile, compression="xz", compressargs=["-9"]):
                     rootdir, outfile, compression, compressargs)
 def mktar(rootdir, outfile, compression="xz", compressargs=["-9"]):
-    return compress(["tar", "--selinux", "--acls", "--xattrs", "-cf-", "--null", "-T-"],
+    compressargs = compressargs or ["-9"]
+    return compress(["tar", "--no-recursion", "--selinux", "--acls", "--xattrs", "-cf-", "--null", "-T-"],
                     rootdir, outfile, compression, compressargs)
 def mksquashfs(rootdir, outfile, compression="default", compressargs=[]):

More information about the anaconda-patches mailing list