From c427b1e218e61bd1aacbddf9013e58b8aa445a7c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 29 Nov 2010 21:43:07 +0100 Subject: * apt-pkg/algorithms.cc: - mark all installed packages first without auto installation in a dist-upgrade to prefer upgrading packages instead of installing new packages in versioned or-groups (Closes: #605394) --- apt-pkg/algorithms.cc | 7 +++ debian/changelog | 8 ++- .../Packages-bug-605394-versioned-or-groups | 71 ++++++++++++++++++++++ .../status-bug-605394-versioned-or-groups | 34 +++++++++++ .../test-bug-605394-versioned-or-groups | 25 ++++++++ 5 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 test/integration/Packages-bug-605394-versioned-or-groups create mode 100644 test/integration/status-bug-605394-versioned-or-groups create mode 100755 test/integration/test-bug-605394-versioned-or-groups diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 9abb7a947..0fbce3c2a 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -374,6 +374,13 @@ bool pkgDistUpgrade(pkgDepCache &Cache) { pkgDepCache::ActionGroup group(Cache); + /* Upgrade all installed packages first without autoinst to help the resolver + in versioned or-groups to upgrade the old solver instead of installing + a new one (if the old solver is not the first one [anymore]) */ + for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I) + if (I->CurrentVer != 0) + Cache.MarkInstall(I, false, 0, false); + /* Auto upgrade all installed packages, this provides the basis for the installation */ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) diff --git a/debian/changelog b/debian/changelog index 1aac5ec7e..bc3af9251 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,13 @@ apt (0.8.10) UNRELEASED; urgency=low will actually test uncompressed indexes regardless of the internal default value of Acquire::GzipIndexes. - -- Michael Vogt Thu, 25 Nov 2010 16:08:01 +0100 + [ David Kalnischkies ] + * apt-pkg/algorithms.cc: + - mark all installed packages first without auto installation in + a dist-upgrade to prefer upgrading packages instead of installing + new packages in versioned or-groups (Closes: #605394) + + -- David Kalnischkies Mon, 29 Nov 2010 21:41:56 +0100 apt (0.8.9) unstable; urgency=low diff --git a/test/integration/Packages-bug-605394-versioned-or-groups b/test/integration/Packages-bug-605394-versioned-or-groups new file mode 100644 index 000000000..60327364b --- /dev/null +++ b/test/integration/Packages-bug-605394-versioned-or-groups @@ -0,0 +1,71 @@ +Package: apache2-mpm-prefork +Priority: optional +Section: httpd +Installed-Size: 68 +Maintainer: Debian Apache Maintainers +Architecture: i386 +Source: apache2 +Version: 2.2.16-4 +Provides: apache2-mpm +Conflicts: apache2-mpm +Filename: pool/main/a/apache2/apache2-mpm-prefork_2.2.16-4_i386.deb +Size: 2276 +MD5Sum: c0db3e637052e59dbdb2fa08f4cdcea4 +Description: Apache HTTP Server - traditional non-threaded model +Task: web-server + +Package: apache2-mpm-worker +Priority: optional +Section: httpd +Installed-Size: 68 +Maintainer: Debian Apache Maintainers +Architecture: i386 +Source: apache2 +Version: 2.2.16-4 +Provides: apache2-mpm +Conflicts: apache2-mpm +Filename: pool/main/a/apache2/apache2-mpm-worker_2.2.16-4_i386.deb +Size: 2220 +MD5Sum: 71bccda875aa0afac700410b951370ba +Description: Apache HTTP Server - high speed threaded model + +Package: libapache2-mod-php5 +Priority: optional +Section: httpd +Installed-Size: 7588 +Maintainer: Debian PHP Maintainers +Architecture: i386 +Source: php5 +Version: 5.3.3-4 +Depends: apache2-mpm-prefork (>> 2.0.52) +Filename: pool/main/p/php5/libapache2-mod-php5_5.3.3-4_i386.deb +Size: 2886980 +MD5Sum: b41ec4b98aa08966288570e07cd864ab +Description: server-side, HTML-embedded scripting language (Apache 2 module) +Task: web-server + +Package: php5-cgi +Priority: optional +Section: php +Installed-Size: 14672 +Maintainer: Debian PHP Maintainers +Architecture: i386 +Source: php5 +Version: 5.3.3-4 +Filename: pool/main/p/php5/php5-cgi_5.3.3-4_i386.deb +Size: 5713726 +MD5Sum: 9e579982032c7bb98508e16e314f45e9 +Description: server-side, HTML-embedded scripting language (CGI binary) + +Package: php5 +Priority: optional +Section: php +Installed-Size: 20 +Maintainer: Debian PHP Maintainers +Architecture: all +Version: 5.3.3-4 +Depends: libapache2-mod-php5 (>= 5.3.3-4) | php5-cgi (>= 5.3.3-4) +Filename: pool/main/p/php5/php5_5.3.3-4_all.deb +Size: 1050 +MD5Sum: cbedd95ed5b868ba1ffd10747abc0ee3 +Description: server-side, HTML-embedded scripting language (metapackage) diff --git a/test/integration/status-bug-605394-versioned-or-groups b/test/integration/status-bug-605394-versioned-or-groups new file mode 100644 index 000000000..3ac9c3054 --- /dev/null +++ b/test/integration/status-bug-605394-versioned-or-groups @@ -0,0 +1,34 @@ +Package: apache2-mpm-worker +Status: install ok installed +Priority: optional +Section: httpd +Installed-Size: 68 +Maintainer: Debian Apache Maintainers +Architecture: i386 +Source: apache2 +Version: 2.2.16-4 +Provides: apache2-mpm +Conflicts: apache2-mpm +Description: Apache HTTP Server - high speed threaded model + +Package: php5-cgi +Status: install ok installed +Priority: optional +Section: php +Installed-Size: 14672 +Maintainer: Debian PHP Maintainers +Architecture: i386 +Source: php5 +Version: 5.3.3-3 +Description: server-side, HTML-embedded scripting language (CGI binary) + +Package: php5 +Status: install ok installed +Priority: optional +Section: php +Installed-Size: 20 +Maintainer: Debian PHP Maintainers +Architecture: all +Version: 5.3.3-3 +Depends: libapache2-mod-php5 (>= 5.3.3-3) | libapache2-mod-php5filter (>= 5.3.3-3) | php5-cgi (>= 5.3.3-3) +Description: server-side, HTML-embedded scripting language (metapackage) diff --git a/test/integration/test-bug-605394-versioned-or-groups b/test/integration/test-bug-605394-versioned-or-groups new file mode 100755 index 000000000..0d7ad77f6 --- /dev/null +++ b/test/integration/test-bug-605394-versioned-or-groups @@ -0,0 +1,25 @@ +#!/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 upgraded: + php5 php5-cgi +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/5715 kB of archives. +After this operation, 0 B of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget dist-upgrade --trivial-only + +msgtest "Solution process doesn't involve" 'apache2-mpm-prefork' + +if aptget dist-upgrade --trivial-only -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 2>&1 | grep apache2-mpm-prefork > /dev/null; then + msgfail +else + msgpass +fi -- cgit v1.2.3 From 6affe4a851ba5c78ecee350c279250eb6ab018d5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 29 Nov 2010 21:44:25 +0100 Subject: fix changelog as the czech translation was by accident added to 0.8.9 --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bc3af9251..23d7ff8e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,8 @@ apt (0.8.10) UNRELEASED; urgency=low + [ Programs translations ] + * Czech by Miroslav Kure. Closes: #605107 + [ Martin Pitt ] * test/integration/test-compressed-indexes, test/test-indexes.sh: - Explicitly disable compressed indexes at the start. This ensures that we @@ -24,7 +27,6 @@ apt (0.8.9) unstable; urgency=low [ Programs translations ] * Slovenian update by Andrej Žnidaršič and Rosetta Slovenian team * German update by Holger Wansing. Closes: #603619 - * Czech by Miroslav Kure. Closes: #605107 [ David Kalnischkies ] * apt-pkg/aptconfiguration.cc: -- cgit v1.2.3