SHA256
3
0
forked from pool/dpkg

Accepting request 544381 from home:dimstar:Factory

- Migrate u-a data from /var/lib/rpm instead of relying on dbpath:
  no u-a version ever installed files explicitly into dbpath, but
  always hard specified /var/lib/rpm. The fact that RPM moved its
  database is irrelevant to update-alternatives. In case RPM moved
  it's database, our files are still accessible via the
  /var/lib/rpm symlink being put in place.
- Drop the arbitrary depenency on a specific rpm version: the idea
  was to ensure to have an rpm with the new dbpath location in
  place. For one, the dependency does not work as intended, and
  2nd, as the migration now happens explicitly from the old u-a
  admindir without relying on dbpath, is no longer needed.

OBS-URL: https://build.opensuse.org/request/show/544381
OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=55
This commit is contained in:
Tomáš Chvátal 2017-11-22 11:15:53 +00:00 committed by Git OBS Bridge
parent 8fd2b11c37
commit 5cf1016a45
2 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Wed Nov 22 11:06:33 UTC 2017 - dimstar@opensuse.org
- Migrate u-a data from /var/lib/rpm instead of relying on dbpath:
no u-a version ever installed files explicitly into dbpath, but
always hard specified /var/lib/rpm. The fact that RPM moved its
database is irrelevant to update-alternatives. In case RPM moved
it's database, our files are still accessible via the
/var/lib/rpm symlink being put in place.
- Drop the arbitrary depenency on a specific rpm version: the idea
was to ensure to have an rpm with the new dbpath location in
place. For one, the dependency does not work as intended, and
2nd, as the migration now happens explicitly from the old u-a
admindir without relying on dbpath, is no longer needed.
-------------------------------------------------------------------
Mon Nov 20 14:50:53 UTC 2017 - mpluskal@suse.com

View File

@ -33,8 +33,6 @@ BuildRequires: automake
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
# We want to make sure to have rpm with new dbpath used
Requires(post): rpm >= 4.13
Requires(post): coreutils
Requires(post): update-alternatives
Provides: alternatives = %{version}
@ -78,13 +76,13 @@ install -pm 0644 man/%{name}.1 %{buildroot}/%{_mandir}/man1/
%post
# Migrate to new location
if [ -d %{_dbpath}/alternatives ]; then
if [ -d var/lib/rpm/alternatives ]; then
echo "migrating update alternatives database to new location"
# We proceed even if no alternatives directory exists, such situation
# occurs in buildroot environment (we can't buildrequire package
# itself).
mv -f %{_dbpath}/alternatives/* /var/lib/alternatives/ || :
rmdir %{_dbpath}/alternatives ||:
mv -f var/lib/rpm/alternatives/* /var/lib/alternatives/ || :
rmdir var/lib/rpm/alternatives ||:
fi
touch %{_localstatedir}/log/alternatives.log