diff --git a/dpkg.spec b/dpkg.spec index ce76baa..2973b94 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -1,7 +1,7 @@ # # spec file for package dpkg # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/update-alternatives-slavetomaster.patch b/update-alternatives-slavetomaster.patch new file mode 100644 index 0000000..aaf40b4 --- /dev/null +++ b/update-alternatives-slavetomaster.patch @@ -0,0 +1,16 @@ +Index: dpkg-1.19.0.5/utils/update-alternatives.c +=================================================================== +--- dpkg-1.19.0.5.orig/utils/update-alternatives.c ++++ dpkg-1.19.0.5/utils/update-alternatives.c +@@ -1796,7 +1796,10 @@ alternative_prepare_install(struct alter + /* Drop unused slave. */ + fn = xasprintf("%s/%s", altdir, sl->name); + if (alternative_path_can_remove(sl->link)) +- alternative_add_commit_op(a, OPCODE_RM, sl->link, NULL); ++ if (strcmp(sl->link, a->master_link)) ++ alternative_add_commit_op(a, OPCODE_RM, sl->link, NULL); ++ else ++ warning("not removing %s, now master", a->master_link); + else + warning(_("not removing %s since it's not a symlink"), + sl->link); diff --git a/update-alternatives.changes b/update-alternatives.changes index 47efb05..7462228 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 14 09:33:00 UTC 2021 - Ludwig Nussel + +- don't remove slave links that turned into master. Happens on usrmerge + (boo#1180939, update-alternatives-slavetomaster.patch) + ------------------------------------------------------------------- Tue Apr 2 20:04:25 UTC 2019 - Andreas Schwab diff --git a/update-alternatives.spec b/update-alternatives.spec index 273f71c..c491de5 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -1,7 +1,7 @@ # # spec file for package update-alternatives # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,7 @@ 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 +Patch1: update-alternatives-slavetomaster.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -45,8 +46,7 @@ make a good choice of editor to invoke if the user has not specified a particular preference. %prep -%setup -q -n dpkg-%{version} -%patch0 -p1 +%autosetup -p1 -n dpkg-%{version} %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects