Skip to content

save_y2logs: rpm-qa was missing because we used an old RPM DB path (bsc#1254914)#1328

Merged
mvidner merged 3 commits into
masterfrom
sysimage-rpm-path
Jan 6, 2026
Merged

save_y2logs: rpm-qa was missing because we used an old RPM DB path (bsc#1254914)#1328
mvidner merged 3 commits into
masterfrom
sysimage-rpm-path

Conversation

@mvidner

@mvidner mvidner commented Jan 6, 2026

Copy link
Copy Markdown
Member

Problem

On recent Tumbleweed, save_y2logs misses the rpm -qa list.

It's because the compatibility symlink to the RPM database dir (/var/lib/rpm -> ../../usr/lib/sysimage/rpm/) is added later than save_y2logs may run.

Also, we should have switched to the new path sooner.

Solution

Rather than updating the hardcoded path, query RPM for %{_dbpath}, yay.

Also, remove the unnecessary hiding of all other RPM errors.

Testing

  • Tested manually with bash -x ./save_y2logs on both Leap 15.6 (Packages) and TW (Packages.db). Also with the .../rpm dir temporarily removed.

Screenshots

No

Because recent Tumbleweed only creates the symlink during the first boot
which may be too late for us.

Ask RPM for the database path
(see https://rpm.org/user_doc/db_recovery.html )

Do not hide the rpm errors: it was a duplicate attempt to solve the
problem of the database being absent in inst-sys (bsc#278790 and bsc#270321)

Remove the leading slash from $TMPDIR, a bug which happened to be
harmless.
"Prefer [ p ] && [ q ] as [ p -a q ] is not well-defined."
https://www.shellcheck.net/wiki/SC2166

test A -o B and test A -a B have been removed from POSIX,
but bash continues to support them, and our usage was safe anyway...
but it's better to strive for shellcheck-cleanliness. Gradually.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 41.883%. remained the same
when pulling 6bccd91 on sysimage-rpm-path
into 94119f8 on master.

@mvidner mvidner merged commit 730f9c3 into master Jan 6, 2026
12 checks passed
@mvidner mvidner deleted the sysimage-rpm-path branch January 6, 2026 13:50
@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown

✅ Autosubmission job #20750303068 successfully finished
✅ Created submit request #1325637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants