save_y2logs: rpm-qa was missing because we used an old RPM DB path (bsc#1254914)#1328
Merged
Conversation
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.
lslezak
approved these changes
Jan 6, 2026
|
✅ Autosubmission job #20750303068 successfully finished |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On recent Tumbleweed,
save_y2logsmisses therpm -qalist.It's because the compatibility symlink to the RPM database dir (
/var/lib/rpm->../../usr/lib/sysimage/rpm/) is added later thansave_y2logsmay 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
bash -x ./save_y2logson both Leap 15.6 (Packages) and TW (Packages.db). Also with the.../rpmdir temporarily removed.Screenshots
No