Skip to content

Commit

Permalink
backend: enforce createrepo_c gzip compression
Browse files Browse the repository at this point in the history
Fedora 39+ changed the default compression to ZSTD, but this is not
supported on EPEL7 and older hosts.  We need to implement some better
"if EL7 or older" logic, but this is a quick pre-release fix that will
keep our deployment with GZIP after the F37 => F39 move.

Relates: #3021
  • Loading branch information
praiskup committed Nov 23, 2023
1 parent 44aa094 commit cd3df5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/run/copr-repo
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ def _database_option(chroot: str) -> str:


def run_createrepo(opts):
compression = "--general-compress-type=gz"
createrepo_cmd = ['/usr/bin/createrepo_c', opts.directory, _database_option(opts.chroot), '--ignore-lock',
'--local-sqlite', '--cachedir', '/tmp/', '--workers', '8']
'--local-sqlite', '--cachedir', '/tmp/', '--workers', '8', compression]

if "epel-5" in opts.directory or "rhel-5" in opts.directory:
# this is because rhel-5 doesn't know sha256
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_modifyrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def test_copr_repo_run_createrepo(self, popen, do_stat, chroot, database_option)
assert popen.call_args_list[0][0][0] == \
["/usr/bin/createrepo_c", repodir, database_option,
"--ignore-lock", "--local-sqlite", "--cachedir", "/tmp/",
"--workers", "8", "--update"] + additional_args
"--workers", "8", "--general-compress-type=gz", "--update"] + additional_args

@pytest.mark.skipif(
distro.id() == 'fedora' and int(distro.version()) >= 36,
Expand Down

0 comments on commit cd3df5d

Please sign in to comment.