From 1e7382397f0aaf5f51ff6d3ef927f15812e2015dd097404ef0d458af24490e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 8 Nov 2017 06:57:40 +0000 Subject: [PATCH 1/8] Accepting request 539675 from home:pluskalm:branches:system:packagemanager - Update location of rpm state directory - Update location of rpm state directory OBS-URL: https://build.opensuse.org/request/show/539675 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=48 --- dpkg.changes | 5 +++++ dpkg.spec | 6 +----- update-alternatives.changes | 5 +++++ update-alternatives.spec | 13 +++++-------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dpkg.changes b/dpkg.changes index d2ba77c..cbb60e7 100644 --- a/dpkg.changes +++ b/dpkg.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 7 19:57:04 UTC 2017 - mpluskal@suse.com + +- Update location of rpm state directory + ------------------------------------------------------------------- Mon Mar 27 12:31:08 UTC 2017 - tchvatal@suse.com diff --git a/dpkg.spec b/dpkg.spec index bf2ce19..09e1016 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -16,7 +16,7 @@ # -%define admindir %{_localstatedir}/lib/rpm/ +%define admindir %{_libexecdir}/sysimage/rpm Name: dpkg Version: 1.18.23 Release: 0 @@ -55,7 +55,6 @@ Obsoletes: deb < %{version} Provides: dpkg-dev = %{version} Provides: dpkg-doc = %{version} Provides: dselect = %{version} -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This package contains tools for working with Debian packages. It makes @@ -144,10 +143,8 @@ done exit 0 %files lang -f %{name}.lang -%defattr(-,root,root) %files -%defattr(-,root,root) %doc ABOUT-NLS AUTHORS COPYING doc/triggers.txt NEWS README* THANKS TODO debian/changelog %{_mandir}/man*/* %exclude %{_mandir}/man*/update-alternatives* @@ -164,7 +161,6 @@ exit 0 %{perl_vendorlib}/Dselect/Ftp.pm %files devel -%defattr(-,root,root) %{_libdir}/libdpkg.a %{_libdir}/libdpkg.la %{_libdir}/pkgconfig/libdpkg.pc diff --git a/update-alternatives.changes b/update-alternatives.changes index beeb4e1..d93736f 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 7 19:57:49 UTC 2017 - mpluskal@suse.com + +- Update location of rpm state directory + ------------------------------------------------------------------- Wed Aug 9 10:43:10 UTC 2017 - tchvatal@suse.com diff --git a/update-alternatives.spec b/update-alternatives.spec index 0ac2cd3..c35abeb 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -16,7 +16,7 @@ # -%define admindir %{_localstatedir}/lib/rpm/ +%define admindir %{_libexecdir}/sysimage/rpm Name: update-alternatives Version: 1.18.23 Release: 0 @@ -34,11 +34,9 @@ BuildRequires: automake BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: pkgconfig -BuildRequires: xz Requires(post): coreutils Requires(post): update-alternatives Provides: alternatives = %{version} -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description update-alternatives creates, removes, maintains and displays @@ -71,11 +69,11 @@ install -d -m 0755 %{buildroot}/%{_sbindir}/ install -d -m 0755 %{buildroot}/%{_mandir}/man1/ install -d -m 0755 %{buildroot}/%{_sysconfdir}/alternatives install -d -m 0755 %{buildroot}/%{admindir}/alternatives -install -d -m 0755 %{buildroot}/%{_localstatedir}/log +install -d -m 0755 %{buildroot}/%{_admindir} -install -m 0755 utils/%{name} %{buildroot}/%{_sbindir} +install -pm 0755 utils/%{name} %{buildroot}/%{_sbindir} ln -s %{name} %{buildroot}/%{_sbindir}/alternatives -install -m 0644 man/%{name}.1 %{buildroot}/%{_mandir}/man1/ +install -pm 0644 man/%{name}.1 %{buildroot}/%{_mandir}/man1/ %post touch %{_localstatedir}/log/alternatives.log @@ -87,10 +85,9 @@ for i in $(ls .) ; do done %files -%defattr(-,root,root,-) %doc COPYING %dir %{_sysconfdir}/alternatives -%dir %{_localstatedir}/lib/rpm/alternatives +%dir %{admindir}/alternatives %{_sbindir}/alternatives %{_sbindir}/update-alternatives %{_mandir}/man1/update-alternatives.1%{ext_man} From 872cac8901ade3b8253714f5c3ea72ee16b9b9622c480b867247e1e13b5b01d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 8 Nov 2017 08:48:08 +0000 Subject: [PATCH 2/8] Accepting request 539790 from home:pluskalm:branches:system:packagemanager - Use dbpath macro for locationg rpm state directory - Use dbpath macro for locationg rpm state directory OBS-URL: https://build.opensuse.org/request/show/539790 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=49 --- dpkg.changes | 2 +- dpkg.spec | 3 +-- update-alternatives.changes | 2 +- update-alternatives.spec | 7 +++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dpkg.changes b/dpkg.changes index cbb60e7..72c9db3 100644 --- a/dpkg.changes +++ b/dpkg.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Tue Nov 7 19:57:04 UTC 2017 - mpluskal@suse.com -- Update location of rpm state directory +- Use dbpath macro for locationg rpm state directory ------------------------------------------------------------------- Mon Mar 27 12:31:08 UTC 2017 - tchvatal@suse.com diff --git a/dpkg.spec b/dpkg.spec index 09e1016..33efbdd 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -16,7 +16,6 @@ # -%define admindir %{_libexecdir}/sysimage/rpm Name: dpkg Version: 1.18.23 Release: 0 @@ -89,7 +88,7 @@ export SELINUX_LIBS="-lselinux" --disable-silent-rules \ --with-selinux \ --localstatedir=%{_localstatedir}/lib \ - --with-admindir=%{_localstatedir}/lib/dpkg + --with-admindir=%{_dbpath} # configure somehow does not detect architecture correctly in OBS (bnc#469337), so # let's do an awful hack and fix it in config.h diff --git a/update-alternatives.changes b/update-alternatives.changes index d93736f..1ad69b2 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Tue Nov 7 19:57:49 UTC 2017 - mpluskal@suse.com -- Update location of rpm state directory +- Use dbpath macro for locationg rpm state directory ------------------------------------------------------------------- Wed Aug 9 10:43:10 UTC 2017 - tchvatal@suse.com diff --git a/update-alternatives.spec b/update-alternatives.spec index c35abeb..1337437 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -16,7 +16,6 @@ # -%define admindir %{_libexecdir}/sysimage/rpm Name: update-alternatives Version: 1.18.23 Release: 0 @@ -58,7 +57,7 @@ particular preference. autoreconf -fvi %configure \ --disable-silent-rules \ - --with-admindir=%{admindir} + --with-admindir=%{_dbpath} make -C lib/compat %{?_smp_mflags} make -C utils/ %{?_smp_mflags} @@ -68,7 +67,7 @@ make -C man/ %{?_smp_mflags} install -d -m 0755 %{buildroot}/%{_sbindir}/ install -d -m 0755 %{buildroot}/%{_mandir}/man1/ install -d -m 0755 %{buildroot}/%{_sysconfdir}/alternatives -install -d -m 0755 %{buildroot}/%{admindir}/alternatives +install -d -m 0755 %{buildroot}/%{_dbpath}/alternatives install -d -m 0755 %{buildroot}/%{_admindir} install -pm 0755 utils/%{name} %{buildroot}/%{_sbindir} @@ -87,7 +86,7 @@ done %files %doc COPYING %dir %{_sysconfdir}/alternatives -%dir %{admindir}/alternatives +%dir %{_dbpath}/alternatives %{_sbindir}/alternatives %{_sbindir}/update-alternatives %{_mandir}/man1/update-alternatives.1%{ext_man} From 40daab70725a6a603d147fad1bcfe641138d4c1ba6defe4b34b0afce7e3f8bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 8 Nov 2017 08:53:04 +0000 Subject: [PATCH 3/8] Accepting request 539792 from home:pluskalm:branches:system:packagemanager - Require exactly same version of rpm we had when building to make sure dbpath matches OBS-URL: https://build.opensuse.org/request/show/539792 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=50 --- update-alternatives.changes | 2 ++ update-alternatives.spec | 1 + 2 files changed, 3 insertions(+) diff --git a/update-alternatives.changes b/update-alternatives.changes index 1ad69b2..62a6b3c 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -2,6 +2,8 @@ Tue Nov 7 19:57:49 UTC 2017 - mpluskal@suse.com - Use dbpath macro for locationg rpm state directory +- Require exactly same version of rpm we had when building to make + sure dbpath matches ------------------------------------------------------------------- Wed Aug 9 10:43:10 UTC 2017 - tchvatal@suse.com diff --git a/update-alternatives.spec b/update-alternatives.spec index 1337437..c662e34 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -33,6 +33,7 @@ BuildRequires: automake BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: pkgconfig +%requires_eq rpm Requires(post): coreutils Requires(post): update-alternatives Provides: alternatives = %{version} From 798bb709e00b8dcea8668e6364610b3a4fbf879eb588d19bcd6d99f2fe5b2863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 8 Nov 2017 15:54:17 +0000 Subject: [PATCH 4/8] Accepting request 539795 from home:pluskalm:branches:system:packagemanager - Small cleanup with spec-cleaner OBS-URL: https://build.opensuse.org/request/show/539795 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=51 --- dpkg.changes | 2 +- dpkg.spec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dpkg.changes b/dpkg.changes index 72c9db3..9155f45 100644 --- a/dpkg.changes +++ b/dpkg.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Tue Nov 7 19:57:04 UTC 2017 - mpluskal@suse.com -- Use dbpath macro for locationg rpm state directory +- Small cleanup with spec-cleaner ------------------------------------------------------------------- Mon Mar 27 12:31:08 UTC 2017 - tchvatal@suse.com diff --git a/dpkg.spec b/dpkg.spec index 33efbdd..1ed2838 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -44,9 +44,9 @@ BuildRequires: perl(IO::String) Requires: cpio Requires: make Requires: patch -Requires: perl = %{perl_version} Requires: update-alternatives Requires: perl(Date::Parse) +%{perl_requires} Requires(post): coreutils Recommends: perl(File::FcntlLock) Provides: deb = %{version} @@ -88,7 +88,7 @@ export SELINUX_LIBS="-lselinux" --disable-silent-rules \ --with-selinux \ --localstatedir=%{_localstatedir}/lib \ - --with-admindir=%{_dbpath} + --with-admindir=%{_localstatedir}/lib/dpkg # configure somehow does not detect architecture correctly in OBS (bnc#469337), so # let's do an awful hack and fix it in config.h From 0af91d4729ce484269dcfa986994b44a1d698007e19f1bf7f777dba44136f71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 8 Nov 2017 16:27:49 +0000 Subject: [PATCH 5/8] Accepting request 539941 from home:pluskalm:branches:system:packagemanager - Update dependencies OBS-URL: https://build.opensuse.org/request/show/539941 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=52 --- dpkg.changes | 3 ++- dpkg.spec | 4 +++- update-alternatives.spec | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dpkg.changes b/dpkg.changes index 9155f45..9c19474 100644 --- a/dpkg.changes +++ b/dpkg.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- -Tue Nov 7 19:57:04 UTC 2017 - mpluskal@suse.com +Wed Nov 8 16:15:47 UTC 2017 - mpluskal@suse.com - Small cleanup with spec-cleaner +- Update dependencies ------------------------------------------------------------------- Mon Mar 27 12:31:08 UTC 2017 - tchvatal@suse.com diff --git a/dpkg.spec b/dpkg.spec index 1ed2838..487d5ee 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -33,11 +33,12 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ BuildRequires: libbz2-devel +BuildRequires: libmd-devel BuildRequires: libselinux-devel BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: update-alternatives -BuildRequires: xz +BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: perl(Date::Parse) BuildRequires: perl(IO::String) @@ -67,6 +68,7 @@ dpkg-doc, dpkg-dev. Summary: Development files for dpkg Group: Development/Libraries/C and C++ Requires: %{name} = %{version} +Requires: libmd-devel Provides: deb-devel = %{version} Obsoletes: deb-devel < %{version} diff --git a/update-alternatives.spec b/update-alternatives.spec index c662e34..db14694 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -69,7 +69,7 @@ install -d -m 0755 %{buildroot}/%{_sbindir}/ install -d -m 0755 %{buildroot}/%{_mandir}/man1/ install -d -m 0755 %{buildroot}/%{_sysconfdir}/alternatives install -d -m 0755 %{buildroot}/%{_dbpath}/alternatives -install -d -m 0755 %{buildroot}/%{_admindir} +install -d -m 0755 %{buildroot}/%{_localstatedir}/log install -pm 0755 utils/%{name} %{buildroot}/%{_sbindir} ln -s %{name} %{buildroot}/%{_sbindir}/alternatives From a6e5a745966a6748d356ca10ddefe42f26ea9fd3617dec828bd4cb4dd02a0489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 20 Nov 2017 12:45:54 +0000 Subject: [PATCH 6/8] Accepting request 543853 from home:pluskalm:branches:system:packagemanager - Move update alternatives database to new location OBS-URL: https://build.opensuse.org/request/show/543853 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=53 --- update-alternatives.changes | 5 +++++ update-alternatives.spec | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/update-alternatives.changes b/update-alternatives.changes index 62a6b3c..2ec7ff6 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 20 09:13:55 UTC 2017 - mpluskal@suse.com + +- Move update alternatives database to new location + ------------------------------------------------------------------- Tue Nov 7 19:57:49 UTC 2017 - mpluskal@suse.com diff --git a/update-alternatives.spec b/update-alternatives.spec index db14694..a56f2ad 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -22,7 +22,7 @@ Release: 0 Summary: Maintain symbolic links determining default commands License: GPL-2.0+ Group: System/Management -Url: http://ftp.de.debian.org/debian/pool/main/d/dpkg/ +URL: http://ftp.de.debian.org/debian/pool/main/d/dpkg/ Source0: http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_%{version}.tar.xz Source3: sensible-editor Patch0: update-alternatives-suse.patch @@ -33,7 +33,9 @@ BuildRequires: automake BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: pkgconfig -%requires_eq rpm +# As we are using macros from rpm for location we need to have same rpm as +# one used during build of this package +Requires: %(rpm -q --queryformat '%{NAME} = %{VERSION}-%{RELEASE}\n' rpm) Requires(post): coreutils Requires(post): update-alternatives Provides: alternatives = %{version} @@ -57,8 +59,8 @@ particular preference. %build autoreconf -fvi %configure \ - --disable-silent-rules \ - --with-admindir=%{_dbpath} + --disable-silent-rules \ + --with-admindir=%{_localstatedir}/lib make -C lib/compat %{?_smp_mflags} make -C utils/ %{?_smp_mflags} @@ -68,7 +70,7 @@ make -C man/ %{?_smp_mflags} install -d -m 0755 %{buildroot}/%{_sbindir}/ install -d -m 0755 %{buildroot}/%{_mandir}/man1/ install -d -m 0755 %{buildroot}/%{_sysconfdir}/alternatives -install -d -m 0755 %{buildroot}/%{_dbpath}/alternatives +install -d -m 0755 %{buildroot}%{_localstatedir}/lib/alternatives install -d -m 0755 %{buildroot}/%{_localstatedir}/log install -pm 0755 utils/%{name} %{buildroot}/%{_sbindir} @@ -76,6 +78,16 @@ ln -s %{name} %{buildroot}/%{_sbindir}/alternatives install -pm 0644 man/%{name}.1 %{buildroot}/%{_mandir}/man1/ %post +# Migrate to new location +if [ -d %{_dbpath}/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 ||: +fi + touch %{_localstatedir}/log/alternatives.log # Fix broken alternatives list bnc#969171 cd %{_sysconfdir}/alternatives/ @@ -87,7 +99,7 @@ done %files %doc COPYING %dir %{_sysconfdir}/alternatives -%dir %{_dbpath}/alternatives +%dir %{_localstatedir}/lib/alternatives %{_sbindir}/alternatives %{_sbindir}/update-alternatives %{_mandir}/man1/update-alternatives.1%{ext_man} From 8fd2b11c37fff5f5e536c29ff85f980ddb0756c340cd42323141529fe876a0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 20 Nov 2017 14:53:02 +0000 Subject: [PATCH 7/8] Accepting request 543913 from home:pluskalm:branches:system:packagemanager - Update rpm requirements to avoid unnecessary builds OBS-URL: https://build.opensuse.org/request/show/543913 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=54 --- update-alternatives.changes | 3 ++- update-alternatives.spec | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/update-alternatives.changes b/update-alternatives.changes index 2ec7ff6..99a0559 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- -Mon Nov 20 09:13:55 UTC 2017 - mpluskal@suse.com +Mon Nov 20 14:50:53 UTC 2017 - mpluskal@suse.com - Move update alternatives database to new location +- Update rpm requirements to avoid unnecessary builds ------------------------------------------------------------------- Tue Nov 7 19:57:49 UTC 2017 - mpluskal@suse.com diff --git a/update-alternatives.spec b/update-alternatives.spec index a56f2ad..6af80d0 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -33,9 +33,8 @@ BuildRequires: automake BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: pkgconfig -# As we are using macros from rpm for location we need to have same rpm as -# one used during build of this package -Requires: %(rpm -q --queryformat '%{NAME} = %{VERSION}-%{RELEASE}\n' rpm) +# 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} From 5cf1016a45f10c98972764bd1357cdbfc6e45c890747e0bb1416a4f839ebe7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 22 Nov 2017 11:15:53 +0000 Subject: [PATCH 8/8] 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 --- update-alternatives.changes | 15 +++++++++++++++ update-alternatives.spec | 8 +++----- 2 files changed, 18 insertions(+), 5 deletions(-) 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