summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-01-29 15:25:02 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-01-29 15:25:02 +0100
commit9535a4db891b629dc17354171bce0a0f41e48d4a (patch)
tree2129ab50ddeaefa70721d786ebca309c74518549
parentd0f2c87cd7e4c0457d83ada4f27c2442dff2ef5c (diff)
* apt-pkg/depcache.cc:
- if a M-A:same package is marked for reinstall, mark all it's installed silbings for reinstallation as well (LP: #859188)
-rw-r--r--apt-pkg/depcache.cc39
-rw-r--r--debian/changelog5
-rwxr-xr-xtest/integration/test-ubuntu-bug-859188-multiarch-reinstall28
3 files changed, 60 insertions, 12 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 085159711..9449c7306 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1240,19 +1240,36 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To)
if (unlikely(Pkg.end() == true))
return;
+ APT::PackageList pkglist;
+ if (Pkg->CurrentVer != 0 &&
+ (Pkg.CurrentVer()-> MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ pkgCache::GrpIterator Grp = Pkg.Group();
+ for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
+ {
+ if (P->CurrentVer != 0)
+ pkglist.insert(P);
+ }
+ }
+ else
+ pkglist.insert(Pkg);
+
ActionGroup group(*this);
- RemoveSizes(Pkg);
- RemoveStates(Pkg);
-
- StateCache &P = PkgState[Pkg->ID];
- if (To == true)
- P.iFlags |= ReInstall;
- else
- P.iFlags &= ~ReInstall;
-
- AddStates(Pkg);
- AddSizes(Pkg);
+ for (APT::PackageList::const_iterator Pkg = pkglist.begin(); Pkg != pkglist.end(); ++Pkg)
+ {
+ RemoveSizes(Pkg);
+ RemoveStates(Pkg);
+
+ StateCache &P = PkgState[Pkg->ID];
+ if (To == true)
+ P.iFlags |= ReInstall;
+ else
+ P.iFlags &= ~ReInstall;
+
+ AddStates(Pkg);
+ AddSizes(Pkg);
+ }
}
/*}}}*/
// DepCache::SetCandidateVersion - Change the candidate version /*{{{*/
diff --git a/debian/changelog b/debian/changelog
index 72916f0ed..f1ccaf403 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
* apt-pkg/deb/dpkgpm.cc:
- chroot if needed before dpkg --assert-multi-arch
- ensure that dpkg binary doesn't have the chroot-directory prefixed
+ * apt-pkg/depcache.cc:
+ - if a M-A:same package is marked for reinstall, mark all it's installed
+ silbings for reinstallation as well (LP: #859188)
[ Steve Langasek ]
* cmdline/apt-get.cc:
@@ -17,7 +20,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
- use a signed int instead of short for score calculation as upgrades
become so big now that it can overflow (Closes: #657732, LP: #917173)
- -- David Kalnischkies <kalnischkies@gmail.com> Sun, 29 Jan 2012 14:44:19 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com> Sun, 29 Jan 2012 15:22:50 +0100
apt (0.8.16~exp12) experimental; urgency=low
diff --git a/test/integration/test-ubuntu-bug-859188-multiarch-reinstall b/test/integration/test-ubuntu-bug-859188-multiarch-reinstall
new file mode 100755
index 000000000..0fdf97485
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-859188-multiarch-reinstall
@@ -0,0 +1,28 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386' 'armel'
+
+buildsimplenativepackage 'libsame' 'amd64,i386,armel' '1.0' 'unstable' 'Multi-Arch: same'
+
+# FIXME: hack around dpkg's current inability to handle multiarch, a clean install would be better…
+insertinstalledpackage 'libsame' 'amd64,i386' '1.0' 'Multi-Arch: same'
+sed -e 's#/installed#/unstable#' -e 's#Installed-Size: 42#Installed-Size: 1#' -i rootdir/var/lib/dpkg/status
+
+setupaptarchive
+
+REINSTALL='Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
+Inst libsame [1.0] (1.0 unstable [amd64])
+Inst libsame:i386 [1.0] (1.0 unstable [i386])
+Conf libsame (1.0 unstable [amd64])
+Conf libsame:i386 (1.0 unstable [i386])'
+
+testequal "$REINSTALL" aptget install --reinstall libsame -s
+testequal "$REINSTALL" aptget install --reinstall libsame:amd64 -s
+testequal "$REINSTALL" aptget install --reinstall libsame:i386 -s
+testequal "$REINSTALL" aptget install --reinstall libsame:amd64 libsame:i386 -s