diff --git a/update-alternatives.changes b/update-alternatives.changes index 99a0559..77f4958 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -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 diff --git a/update-alternatives.spec b/update-alternatives.spec index 6af80d0..228e2d0 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -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