Hello community, here is the log from the commit of package dpkg for openSUSE:Factory checked in at 2016-04-12 18:57:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dpkg (Old) and /work/SRC/openSUSE:Factory/.dpkg.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dpkg" Changes: -------- --- /work/SRC/openSUSE:Factory/dpkg/dpkg.changes 2016-03-29 09:51:33.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.dpkg.new/dpkg.changes 2016-04-12 18:58:00.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Apr 6 18:20:13 UTC 2016 - tchva...@suse.com + +- Fix bnc#969171 by updating even with equal priority + * 0001-In-case-of-equal-priority-rather-update.patch + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/dpkg/update-alternatives.changes 2016-03-29 09:51:33.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.dpkg.new/update-alternatives.changes 2016-04-12 18:58:00.000000000 +0200 @@ -1,0 +2,14 @@ +Wed Apr 6 18:20:13 UTC 2016 - tchva...@suse.com + +- Fix bnc#969171 by updating even with equal priority + * 0001-In-case-of-equal-priority-rather-update.patch +- Try to autorefresh all the alternatives in post in case some of + them were broken + +------------------------------------------------------------------- +Wed Apr 6 12:05:23 UTC 2016 - tchva...@suse.com + +- The logfile for update-alternatives is /var/log/alternatives.log + so stop using update-alternatives.log file which is empty + +------------------------------------------------------------------- New: ---- 0001-In-case-of-equal-priority-rather-update.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dpkg.spec ++++++ --- /var/tmp/diff_new_pack.Y3qJvn/_old 2016-04-12 18:58:01.000000000 +0200 +++ /var/tmp/diff_new_pack.Y3qJvn/_new 2016-04-12 18:58:01.000000000 +0200 @@ -30,6 +30,8 @@ Patch1: update-alternatives-suse.patch # PATCH-FIX-UPSTREAM remove --utf8 since we only build En manpages. Patch6: dpkg-sparc.diff +# PATCH-FIX-SUSE: update if two alternatives have same priority bnc#969171 +Patch7: 0001-In-case-of-equal-priority-rather-update.patch BuildRequires: gcc-c++ BuildRequires: libbz2-devel BuildRequires: libselinux-devel @@ -78,6 +80,7 @@ %setup -q %patch1 -p1 %patch6 -p1 +%patch7 -p1 %build export CFLAGS="%{optflags}" ++++++ update-alternatives.spec ++++++ --- /var/tmp/diff_new_pack.Y3qJvn/_old 2016-04-12 18:58:01.000000000 +0200 +++ /var/tmp/diff_new_pack.Y3qJvn/_new 2016-04-12 18:58:01.000000000 +0200 @@ -28,8 +28,11 @@ Source3: sensible-editor Patch0: update-alternatives-suse.patch Patch6: dpkg-sparc.diff +# PATCH-FIX-SUSE: update if two alternatives have same priority bnc#969171 +Patch7: 0001-In-case-of-equal-priority-rather-update.patch BuildRequires: ncurses-devel BuildRequires: xz +Requires(post): update-alternatives BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -47,6 +50,7 @@ %setup -q -n dpkg-%{version} %patch0 -p1 %patch6 -p1 +%patch7 -p1 %build %configure \ @@ -67,7 +71,13 @@ install -m 0644 man/%{name}.1 %{buildroot}/%{_mandir}/man1/ %post -touch %{_localstatedir}/log/%{name}.log +touch %{_localstatedir}/log/alternatives.log +# Fix broken alternatives list bnc#969171 +cd %{_sysconfdir}/alternatives/ +for i in * ; do + # continue on errors but still print them out + update-alternatives --auto $i || : +done %files %defattr(-,root,root,-) @@ -76,6 +86,6 @@ %dir %{_localstatedir}/lib/rpm/alternatives %{_sbindir}/update-alternatives %{_mandir}/man1/update-alternatives.1* -%ghost %{_localstatedir}/log/update-alternatives.log +%ghost %{_localstatedir}/log/alternatives.log %changelog ++++++ 0001-In-case-of-equal-priority-rather-update.patch ++++++ >From 9f73659ce9b9194ce2f0219afbfb77d27e90508b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tchva...@suse.com> Date: Wed, 6 Apr 2016 20:06:15 +0200 Subject: [PATCH] In case of equal priority rather update This is needed because in some cases priorities in openSUSE python packages were equal in priority yet pointing to different files. With forced refresh we unfortunately update in some un-needed cases but are safe against this kind of errors. --- utils/update-alternatives.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c index 5dc3213..1af65a4 100644 --- a/utils/update-alternatives.c +++ b/utils/update-alternatives.c @@ -1437,7 +1437,8 @@ alternative_get_best(struct alternative *a) best = a->choices; for (fs = a->choices; fs; fs = fs->next) - if (fs->priority > best->priority) + /* In case of equal priority rather use the new alternative */ + if (fs->priority >= best->priority) best = fs; return best; -- 2.7.4