Skip to content

Commit

Permalink
Merge pull request #7904 from cbbayburt/reposync-comps-bz2
Browse files Browse the repository at this point in the history
Fix bzip2 decompression of comps files in reposync
  • Loading branch information
cbbayburt authored Nov 21, 2023
2 parents cf3fd3b + 86a5dc8 commit 377d92e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/spacewalk/satellite_tools/reposync.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,11 @@ def copy_metadata_file(self, plug, filename, comps_type, relative_dir):
absdir = os.path.join(mount_point, relativedir)
if not os.path.exists(absdir):
os.makedirs(absdir)
compressed_suffixes = ['.gz', '.bz', '.xz']
if comps_type == 'comps' and not re.match('comps.xml(' + "|".join(compressed_suffixes) + ')*', basename):
compressed_suffixes = ['.gz', '.bz', '.xz', '.bz2']
if comps_type == 'comps' and not re.match('comps.xml(' + "|".join(compressed_suffixes) + ')?$', basename):
log(0, " Renaming non-standard filename %s to %s." % (basename, 'comps' + basename[basename.find('.'):]))
basename = 'comps' + basename[basename.find('.'):]
elif comps_type == 'modules' and re.match('modules.yaml(' + "|".join(compressed_suffixes) + ')*', basename):
elif comps_type == 'modules' and re.match('modules.yaml(' + "|".join(compressed_suffixes) + ')?$', basename):
# decompress only for getting the checksum
checksum = self._get_decompressed_file_checksum(filename, 'sha256')
basename = checksum + "-" + basename
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix decompressing and renaming bzip2 comps files in reposync

0 comments on commit 377d92e

Please sign in to comment.