]> git.saurik.com Git - apt.git/commitdiff
* cherry pick revision 2173 from lp:~donkult/apt/sid
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 13 Sep 2011 07:03:14 +0000 (09:03 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 13 Sep 2011 07:03:14 +0000 (09:03 +0200)
- M-A:same lockstep unpack should operate on installed
  packages first (LP: #835625)

apt-pkg/packagemanager.cc
debian/changelog
test/integration/test-bug-618288-multiarch-same-lockstep
test/integration/test-bug-632221-cross-dependency-satisfaction
test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first [new file with mode: 0755]

index db18c5521ec3e265721c000a0133b09d5499444e..c6815658b500daf5ed305daa5b9f3326c5543752 100644 (file)
@@ -603,18 +603,39 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
 
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
 
-   if ((instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+   if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same)
+   {
+      /* Do lockstep M-A:same unpacking in two phases:
+        First unpack all installed architectures, then the not installed.
+        This way we avoid that M-A: enabled packages are installed before
+        their older non-M-A enabled packages are replaced by newer versions */
+      bool const installed = Pkg->CurrentVer != 0;
+      if (installed == true && Install(Pkg,FileNames[Pkg->ID]) == false)
+        return false;
       for (PkgIterator P = Pkg.Group().PackageList();
           P.end() == false; P = Pkg.Group().NextPkg(P))
       {
-        if (Pkg == P || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
+        if (P->CurrentVer == 0 || P == Pkg || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
             Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
              (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
            continue;
-        SmartUnPack(P, false);
+        if (SmartUnPack(P, false) == false)
+           return false;
       }
-
-   if(Install(Pkg,FileNames[Pkg->ID]) == false)
+      if (installed == false && Install(Pkg,FileNames[Pkg->ID]) == false)
+        return false;
+      for (PkgIterator P = Pkg.Group().PackageList();
+          P.end() == false; P = Pkg.Group().NextPkg(P))
+      {
+        if (P->CurrentVer != 0 || P == Pkg || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
+            Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
+             (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
+           continue;
+        if (SmartUnPack(P, false) == false)
+           return false;
+      }
+   }
+   else if (Install(Pkg,FileNames[Pkg->ID]) == false)
       return false;
 
    // Perform immedate configuration of the package.
index 1cbdcd8bae2a05a57af377220b9ec18fc0742632..9d7c04cdc7547e0d1225fb03508a88af3b3ee522 100644 (file)
@@ -1,3 +1,14 @@
+apt (0.8.16~exp5ubuntu7) oneiric; urgency=low
+
+  [ Michael Vogt ]
+  * cherry pick revision 2173 from lp:~donkult/apt/sid
+  
+  [ David Kalnischkies ]
+  - M-A:same lockstep unpack should operate on installed
+    packages first (LP: #835625)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 12 Sep 2011 16:04:31 +0200
+
 apt (0.8.16~exp5ubuntu6) oneiric; urgency=low
 
   [ Michael Vogt 
index 7e384e428c2b055e67b7dd25a4dc39e4d23e71fe..a05f03df4c39b76d8915aafa0adf2dfd792cb881 100755 (executable)
@@ -22,8 +22,8 @@ Building dependency tree...
 The following packages will be upgraded:
   apt:i386 apt2 libsame libsame:i386
 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-Inst libsame [1] (2 unstable [amd64]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:i386 apt2:amd64 ]
-Inst libsame:i386 [1] (2 unstable [i386]) [apt2:amd64 apt:i386 ]
+Inst libsame:i386 [1] (2 unstable [i386]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:amd64 apt:i386 ]
+Inst libsame [1] (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
 Conf libsame:i386 (2 unstable [i386]) [apt2:amd64 apt:i386 ]
 Conf libsame (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
 Inst apt2 [1] (2 unstable [amd64]) [apt:i386 ]
index 58de448434ea60df582c1d1e8ae6dbd2635e4ef0..4299f052fd6f3bd7254ab256ad1cb843487f28d5 100755 (executable)
@@ -47,10 +47,10 @@ Inst amdboot (1.0 unstable [amd64])
 Inst cool (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst foreigner (1.0 unstable [amd64])
-Inst libc6:armel (1.0 unstable [armel])
 Inst libc6 (1.0 unstable [amd64])
-Inst libc6-dev:armel (1.0 unstable [armel])
+Inst libc6:armel (1.0 unstable [armel])
 Inst libc6-dev (1.0 unstable [amd64])
+Inst libc6-dev:armel (1.0 unstable [armel])
 Conf amdboot (1.0 unstable [amd64])
 Conf cool (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
@@ -90,10 +90,10 @@ Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst cool (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst foreigner (1.0 unstable [armel])
-Inst libc6 (1.0 unstable [armel])
 Inst libc6:amd64 (1.0 unstable [amd64])
-Inst libc6-dev (1.0 unstable [armel])
+Inst libc6 (1.0 unstable [armel])
 Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [armel])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf cool (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
@@ -129,10 +129,10 @@ The following NEW packages will be installed:
 0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
-Inst libc6:armel (1.0 unstable [armel])
 Inst libc6 (1.0 unstable [amd64])
-Inst libc6-dev:armel (1.0 unstable [armel])
+Inst libc6:armel (1.0 unstable [armel])
 Inst libc6-dev (1.0 unstable [amd64])
+Inst libc6-dev:armel (1.0 unstable [armel])
 Conf amdboot (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
@@ -169,10 +169,10 @@ The following NEW packages will be installed:
 0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [armel])
-Inst libc6 (1.0 unstable [armel])
 Inst libc6:amd64 (1.0 unstable [amd64])
-Inst libc6-dev (1.0 unstable [armel])
+Inst libc6 (1.0 unstable [armel])
 Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [armel])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [armel])
 Conf libc6:amd64 (1.0 unstable [amd64])
diff --git a/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first
new file mode 100755 (executable)
index 0000000..a9a4069
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'libsame' 'i386' '1'
+insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)'
+
+insertpackage 'unstable' 'libsame' 'i386,amd64' '2' 'Multi-Arch: same'
+insertpackage 'unstable' 'apt' 'i386' '2' 'Depends: libsame (= 2)'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  apt:i386 libsame:i386
+The following NEW packages will be installed:
+  libsame
+The following packages will be upgraded:
+  apt:i386 libsame:i386
+2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libsame:i386 [1] (2 unstable [i386]) [apt:i386 ]
+Inst libsame (2 unstable [amd64]) [apt:i386 ]
+Conf libsame:i386 (2 unstable [i386]) [apt:i386 ]
+Conf libsame (2 unstable [amd64]) [apt:i386 ]
+Inst apt:i386 [1] (2 unstable [i386])
+Conf apt:i386 (2 unstable [i386])' aptget install libsame:amd64 -s