Skip to content

Commit b81f09f

Browse files
committed
cmdlib.sh: fix repoquery when building overrides lockfile
Fallout from the move to f41 and dnf5. A few issues: first, looks like Looks like dnf5 repoquery's `--qf` acts differently. Not only it no longer implicitly emits a newline, but also it doesn't interpret `\t` anymore. This is tracked at: rpm-software-management/dnf5#709 Second, `--quiet` is broken and still includes output from progress bar: rpm-software-management/dnf5#1915 Work around this by using spaces instead of `\t`, adding `\n`, and prefixing pkg entries with `pkg:`.
1 parent 49ce2cb commit b81f09f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cmdlib.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,17 @@ EOF
450450
# the same RPMs: the `dnf repoquery` below is to pick the latest one
451451
dnf repoquery --repofrompath=tmp,"file://${overridesdir}/rpm" \
452452
--disablerepo '*' --enablerepo tmp --refresh --latest-limit 1 \
453-
--exclude '*.src' --qf '%{name}\t%{evr}\t%{arch}' \
453+
--exclude '*.src' --qf 'pkg: %{name} %{evr} %{arch}\n' \
454454
--quiet > "${tmp_overridesdir}/pkgs.txt"
455455

456456
# shellcheck disable=SC2002
457457
cat "${tmp_overridesdir}/pkgs.txt" | python3 -c '
458458
import sys, json
459459
lockfile = {"packages": {}}
460460
for line in sys.stdin:
461-
name, evr, arch = line.strip().split("\t")
461+
if not line.startswith("pkg: "):
462+
continue
463+
_, name, evr, arch = line.strip().split()
462464
lockfile["packages"][name] = {"evra": f"{evr}.{arch}"}
463465
json.dump(lockfile, sys.stdout)' > "${local_overrides_lockfile}"
464466

0 commit comments

Comments
 (0)