Skip to content

Commit 87274b4

Browse files
Merge pull request #4248 from ggiguash/fix_dnf_download
USHIFT-5086: Fix local package downloads after removing sudo
2 parents 199b9bb + c8eca41 commit 87274b4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

test/bin/build_images.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ extract_container_images() {
4545
dnf_options="--repofrompath ${repo_name},${repo_spec} --repo ${repo_name}"
4646
elif [[ "${repo_spec}" =~ ^/.* ]]; then
4747
# If the spec is a path, set up the arguments to point to that path.
48-
dnf_options="--repofrompath ${repo_name},${repo_spec} --repo ${repo_name}"
48+
# Disabling dnf strict option and refreshing cache are required because the
49+
# download command does not run elevated.
50+
dnf_options="--repofrompath ${repo_name},${repo_spec} --repo ${repo_name} --setopt=strict=False --refresh"
4951
elif [[ -n ${repo_spec} ]]; then
5052
# If the spec is a name, assume it is already known to the
5153
# system through normal configuration. The repo does not need

test/bin/pyutils/build_bootc_images.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ def extract_container_images(version, repo_spec, outfile, dry_run=False):
178178
dnf_options.extend(["--repofrompath", f"{repo_name},{repo_spec}", "--repo", repo_name])
179179
elif re.match(r'^/.*', repo_spec):
180180
# If the spec is a path, set up the arguments to point to that path.
181-
dnf_options.extend(["--repofrompath", f"{repo_name},{repo_spec}", "--repo", repo_name])
181+
# Disabling dnf strict option and refreshing cache are required because the
182+
# download command does not run elevated.
183+
dnf_options.extend(["--repofrompath", f"{repo_name},{repo_spec}", "--repo", repo_name,
184+
"--setopt=strict=False", "--refresh"])
182185
elif repo_spec:
183186
# If the spec is a name, assume it is already known to the
184187
# system through normal configuration. The repo does not need

0 commit comments

Comments
 (0)