]> git.saurik.com Git - apt.git/commitdiff
cherry pick from lp:~donkult/apt/sid branch
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 4 Oct 2010 10:17:32 +0000 (12:17 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 4 Oct 2010 10:17:32 +0000 (12:17 +0200)
apt-pkg/depcache.cc
debian/changelog
test/integration/Packages-bug-598669-install-postfix-gets-exim-heavy [new file with mode: 0644]
test/integration/status-bug-598669-install-postfix-gets-exim-heavy [new file with mode: 0644]
test/integration/test-bug-598669-install-postfix-gets-exim-heavy [new file with mode: 0755]

index 018b05e65a476da59ef8d9569ec7e36408e546b9..ff9233ef263adb1af742121758f5e75814a70aa1 100644 (file)
@@ -1192,6 +1192,16 @@ bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge,
         std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl;
       return false;
    }
+   else if (FromUser == false && Pkg->CurrentVer == 0)
+   {
+      StateCache &P = PkgState[Pkg->ID];
+      if (P.InstallVer != 0 && P.Status == 2 && (P.Flags & Flag::Auto) != Flag::Auto)
+      {
+        if (DebugMarker == true)
+           std::clog << OutputInDepth(Depth) << "Manual install request prevents MarkDelete of " << Pkg << std::endl;
+        return false;
+      }
+   }
    return true;
 }
                                                                        /*}}}*/
index 84548d899af154ee8dc842431d9ccb8135bf61dc..8a1f0948129405342ebf14119a0ff46d40f04d3f 100644 (file)
@@ -1,3 +1,14 @@
+apt (0.8.3ubuntu7) UNRELEASED; urgency=low
+
+  [ David Kalnischkies ]
+  * apt-pkg/depcache.cc:
+    - do not remove packages which the user requested for installation
+      explicitly while satisfying other install requests (Closes: #598669)
+    Test case: debootstrap, install exim4, run "apt-get install postfix"
+    This will result in exim4-heavy instead of postfix
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 04 Oct 2010 11:57:18 +0200
+
 apt (0.8.3ubuntu6) maverick; urgency=low
 
   [ Michael Vogt ]
diff --git a/test/integration/Packages-bug-598669-install-postfix-gets-exim-heavy b/test/integration/Packages-bug-598669-install-postfix-gets-exim-heavy
new file mode 100644 (file)
index 0000000..a249d6e
--- /dev/null
@@ -0,0 +1,30 @@
+Package: exim4-daemon-heavy
+Priority: optional
+Section: mail
+Installed-Size: 1060
+Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
+Architecture: i386
+Source: exim4
+Version: 4.72-1
+Replaces:  mail-transport-agent
+Provides:  mail-transport-agent
+Conflicts: mail-transport-agent
+Filename: pool/main/e/exim4/exim4-daemon-heavy_4.72-1_i386.deb
+Size: 508988
+MD5sum: 7adf3b0ef8f134e70d19ee216e6f4452
+Description: Exim MTA (v4) daemon with extended features, including exiscan-acl
+
+Package: postfix
+Priority: extra
+Section: mail
+Installed-Size: 3196
+Maintainer: LaMont Jones <lamont@debian.org>
+Architecture: i386
+Version: 2.7.1-1
+Replaces:  mail-transport-agent
+Provides:  mail-transport-agent
+Conflicts: mail-transport-agent
+Filename: pool/main/p/postfix/postfix_2.7.1-1_i386.deb
+Size: 1325662
+MD5sum: 1ef63b6a62b4be120a9cdc312b81a698
+Description: High-performance mail transport agent
diff --git a/test/integration/status-bug-598669-install-postfix-gets-exim-heavy b/test/integration/status-bug-598669-install-postfix-gets-exim-heavy
new file mode 100644 (file)
index 0000000..fcf21dc
--- /dev/null
@@ -0,0 +1,30 @@
+Package: exim4-daemon-light
+Status: install ok installed
+Priority: standard
+Section: mail
+Installed-Size: 952
+Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
+Architecture: i386
+Source: exim4
+Version: 4.72-1
+Replaces:  mail-transport-agent
+Provides:  mail-transport-agent
+Conflicts: mail-transport-agent
+Filename: pool/main/e/exim4/exim4-daemon-light_4.72-1_i386.deb
+Size: 459500
+MD5sum: f32ccafef44bed2efcd526cd6501307d
+Description: lightweight Exim MTA (v4) daemon
+
+Package: exim4
+Status: install ok installed
+Priority: standard
+Section: mail
+Installed-Size: 60
+Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
+Architecture: all
+Version: 4.72-1
+Depends: exim4-daemon-light | exim4-daemon-heavy
+Filename: pool/main/e/exim4/exim4_4.72-1_all.deb
+Size: 7738
+MD5sum: 2f473b82bbabac9718ff3e755eaf85c1
+Description: metapackage to ease Exim MTA (v4) installation
diff --git a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy
new file mode 100755 (executable)
index 0000000..3fee63b
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+local TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+setupaptarchive
+
+testequal "Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  exim4 exim4-daemon-light
+The following NEW packages will be installed:
+  postfix
+0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
+Need to get 0 B/1326 kB of archives.
+After this operation, 2236 kB of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation." aptget install postfix --trivial-only