diff --git a/autospec/tarball.py b/autospec/tarball.py index 650b8449..973c31d9 100644 --- a/autospec/tarball.py +++ b/autospec/tarball.py @@ -219,7 +219,7 @@ def process_autogenerated_source(self, url): autogenerated_src = None if url: src_path = self.check_or_get_file(url, os.path.basename(url)) - autogenerated_src = Source(url, '../autogenerated', src_path, self.config.default_pattern) + autogenerated_src = Source(url, '../autogenerated-tmp', src_path, self.config.default_pattern) return autogenerated_src def print_header(self): @@ -443,6 +443,8 @@ def process(self, filemanager): autogenerated_src = self.process_autogenerated_source(self.autogenerated_tarball) # Extract autogenerated source for comparison if autogenerated_src: - autogenerated_src.extract(os.path.join(self.base_path, 'autogenerated')) - call(f"diff -u -r autogenerated/{autogenerated_src.prefix} {main_src.prefix}", - logfile="archive.diff", check=False, cwd=self.base_path) + autogenerated_src.extract(os.path.join(self.base_path, 'autogenerated-tmp')) + # Move the autogenerated source to a non-version-named directory for consistent diffs + call(f"mv autogenerated-tmp/{autogenerated_src.prefix} autogenerated", check=True, cwd=self.base_path) + call(f"diff -u -r ../autogenerated ./", + logfile="archive.diff", check=False, cwd=os.path.join(self.base_path, main_src.prefix))