From 64ff167be1a2163c2ebebb1502a12d87944c6b8d Mon Sep 17 00:00:00 2001 From: Roland Rossgotterer Date: Thu, 10 Jan 2019 14:00:10 +0100 Subject: [PATCH] Add symbol files individually to tar file instead of symbol directory Summary: In the previous attempt, the parent directory was added to the tar file with it being renamed to ".". So it still had a directory and was not a flat tar file. Instead add all files from the symbol path individually. Reviewers: #swift_pilot_client Differential Revision: https://dev.swift-project.org/D86 --- scripts/symbolstore.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/symbolstore.py b/scripts/symbolstore.py index 048c74e75..93edda986 100644 --- a/scripts/symbolstore.py +++ b/scripts/symbolstore.py @@ -200,10 +200,13 @@ class Dumper: def pack(self, tar_path=None): if tar_path is None: - symbol_full_path = os.path.normpath(os.path.join(self.symbol_path, "..")) - tar_path = os.path.join(symbol_full_path, 'symbols.tar.gz') + tar_path = os.path.normpath(os.path.join(self.symbol_path, "..")) + tar_path = os.path.join(tar_path, 'symbols.tar.gz') tar = tarfile.open(tar_path, "w:gz") - tar.add(self.symbol_path, arcname='.') + for dirname, subdirs, files in os.walk(self.symbol_path): + for filename in files: + tar.add(os.path.join(dirname, filename), filename) + tar.close() def process(self, *args): """Process files recursively in args."""