From 9345e5fe15ddd9ae68601743d2f864f3719fb9c3 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 12 Oct 2022 14:35:27 +0530 Subject: package: Pass -cf as the last argument to tar Old tar versions and bsdtar do not accept any further arguments after -f so everything passed after -f will be interpreted as archive contents, and bsdtar will silently ignore non-existing files. Part-of: --- cerbero/packages/disttarball.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cerbero/packages/disttarball.py b/cerbero/packages/disttarball.py index 898ead93..57511a8f 100644 --- a/cerbero/packages/disttarball.py +++ b/cerbero/packages/disttarball.py @@ -175,7 +175,7 @@ class DistTarball(PackagerBase): shell.new_call(compress_cmd) def _write_tar(self, filename, package_prefix, files): - tar_cmd = ['tar', '-C', self.prefix, '-cf', filename] + tar_cmd = ['tar', '-C', self.prefix] # ensure we provide a unique list of files to tar to avoid # it creating hard links/copies files = sorted(set(files)) @@ -192,6 +192,7 @@ class DistTarball(PackagerBase): tar_cmd += ['--use-compress-program=xz --threads=0'] elif self.compress != 'none': raise AssertionError("Unknown tar compression: {}".format(self.compress)) + tar_cmd += ['-cf', filename] try: shell.new_call(tar_cmd + files) except FatalError: -- cgit v1.2.3