Update yum-sync.py to match tools in dokcer image

Thanks to Hongren Zheng.

Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
Shengqi Chen 2023-12-02 17:42:55 +08:00
parent 6020ee70ba
commit 1d16b9da20
No known key found for this signature in database
GPG Key ID: 6EE389C0F18AF774

View File

@ -221,8 +221,11 @@ enabled=1
failed.append(('', arch)) failed.append(('', arch))
continue continue
cmd_args = ["reposync", "-a", arch, "-c", conf.name, "-d", "-p", str(args.working_dir.absolute()), "-e", cache_dir] cmd_args = [
print("Launching reposync", flush=True) "dnf", "reposync",
"-a", arch, "-c", conf.name,
"--delete", "-p", str(args.working_dir.absolute())]
print("Launching dnf reposync", flush=True)
# print(cmd_args) # print(cmd_args)
ret = sp.run(cmd_args) ret = sp.run(cmd_args)
if ret.returncode != 0: if ret.returncode != 0:
@ -234,7 +237,7 @@ enabled=1
if args.download_repodata: if args.download_repodata:
download_repodata(url, path) download_repodata(url, path)
else: else:
cmd_args = ["createrepo", "--update", "-v", "-c", cache_dir, "-o", str(path), str(path)] cmd_args = ["createrepo_c", "--update", "-v", "-c", cache_dir, "-o", str(path), str(path)]
# print(cmd_args) # print(cmd_args)
ret = sp.run(cmd_args) ret = sp.run(cmd_args)
calc_repo_size(path) calc_repo_size(path)