Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpmdb: Also detect rpmdb.sqlite in /usr/share/rpm #386

Merged
merged 1 commit into from
May 26, 2020

Conversation

cgwalters
Copy link
Contributor

See: https://bugzilla.redhat.com/show_bug.cgi?id=1838691

This is obviously adding to a tower of hacks; what we really
want is for this logic to live in librpm and be standardized.
But in order to fix the immediate issue of detecting the rpmdb
on rpm-ostree based systems (and any others that use /usr/share/rpm),
add the sqlite path to detection.

See also http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html

See: https://bugzilla.redhat.com/show_bug.cgi?id=1838691

This is obviously adding to a tower of hacks; what we really
want is for this logic to live in librpm and be standardized.
But in order to fix the immediate issue of detecting the rpmdb
on rpm-ostree based systems (and any others that use `/usr/share/rpm`),
add the sqlite path to detection.

See also http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html
@ignatenkobrain
Copy link
Collaborator

FWIW, the bug is private…

@cgwalters
Copy link
Contributor Author

cgwalters commented May 26, 2020

FWIW, the bug is private…

Something must have changed in BZ to more aggressively default to private bugs. That one was marked fedora_contrib_private - what the heck? Just doesn't make any sense at all.

Anyways, fixed, thanks!

@mlschroe mlschroe merged commit d51e02f into openSUSE:master May 26, 2020
@mlschroe
Copy link
Member

I wonder if we should just check for the /usr/share/rpm directory...

@cgwalters
Copy link
Contributor Author

Is there no way in the libsolv API to override the dbpath? I thought OpenSUSE switched to /usr/lib/sysimage/rpm per http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html - but AFAICS there are no patches to do that in https://build.opensuse.org/package/show/zypp:Head/libsolv ?

@Conan-Kudo
Copy link
Member

@cgwalters They maintain a symlink in /var/lib/rpm pointing back to /usr/lib/sysimage/rpm because Zypper is hardwired to that path.

@cgwalters
Copy link
Contributor Author

Doing it that way is gross though in --destdir style installs, because then we need to have that symlink set up very early just so our own process can find it. But, I guess we can do it that way.

I think the cleanest fix though per the above BZ is to get the "find the rpmdb location" in rpm itself and have it support the sysimage dir, now that libsolv uses librpm.

@Conan-Kudo
Copy link
Member

Right, it should just pull the information from %_dbpath, since that is set early enough. The only issue is when the %_dbpath differs between host and guest/installroot.

cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Jul 3, 2020
Following on to:

- http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html
- coreos#1142
- openSUSE/libsolv#386

Write a symlink in `/usr/lib/sysimage/rpm` pointing to our current
`/usr/share/rpm` - this way clients can start looking for it there,
and then at some point we'll flip the symlink around and
have `/usr/share/rpm` pointing to the new location.

(Doing a hard swap now has upgrade implications)
cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Jul 4, 2020
Following on to:

- http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html
- coreos#1142
- openSUSE/libsolv#386

Write a symlink in `/usr/lib/sysimage/rpm` pointing to our current
`/usr/share/rpm` - this way clients can start looking for it there,
and then at some point we'll flip the symlink around and
have `/usr/share/rpm` pointing to the new location.

(Doing a hard swap now has upgrade implications)
openshift-merge-robot pushed a commit to coreos/rpm-ostree that referenced this pull request Jul 8, 2020
Following on to:

- http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html
- #1142
- openSUSE/libsolv#386

Write a symlink in `/usr/lib/sysimage/rpm` pointing to our current
`/usr/share/rpm` - this way clients can start looking for it there,
and then at some point we'll flip the symlink around and
have `/usr/share/rpm` pointing to the new location.

(Doing a hard swap now has upgrade implications)
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.

4 participants