diff options
author | Michael Vogt <mvo@debian.org> | 2010-11-10 19:39:12 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2010-11-10 19:39:12 +0100 |
commit | 88b62c5b3d55fa2ac0c4e0f4f0a595c60101db59 (patch) | |
tree | 8ca43482d477b2a437d368e4ab1fa1c6ff6aaad8 | |
parent | c1c49795f4ba33e56b5b741f07bba362f4d54c2e (diff) | |
parent | edbda33bdef6a480fcfcb5d6b9a219c10cbeaaba (diff) | |
download | apt-88b62c5b3d55fa2ac0c4e0f4f0a595c60101db59.tar.gz |
merged from donkult
-rw-r--r-- | apt-pkg/algorithms.cc | 1 | ||||
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 81 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 7 | ||||
-rw-r--r-- | apt-pkg/orderlist.cc | 34 | ||||
-rw-r--r-- | debian/changelog | 16 | ||||
-rw-r--r-- | test/integration/Packages-xorg-break-providers | 52 | ||||
-rw-r--r-- | test/integration/status-xorg-break-providers | 22 | ||||
-rwxr-xr-x | test/integration/test-bug-590438-broken-provides-thanks-to-remove-order | 4 | ||||
-rwxr-xr-x | test/integration/test-xorg-break-providers | 43 | ||||
-rw-r--r-- | test/libapt/getlanguages_test.cc | 24 |
10 files changed, 233 insertions, 51 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 961f5c2f..9abb7a94 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1062,6 +1062,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) else if (TryFixByInstall == true && Start.TargetPkg()->CurrentVer == 0 && Cache[Start.TargetPkg()].Delete() == false && + (Flags[Start.TargetPkg()->ID] & ToRemove) != ToRemove && Cache.GetCandidateVer(Start.TargetPkg()).end() == false) { /* Before removing or keeping the package with the broken dependency diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 44f1f318..52f54073 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -166,17 +166,6 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All, string const envShort = envLong.substr(0,lenShort); bool envLongIncluded = true; - // first cornercase: LANG=C, so we use only "en" Translation - if (envLong == "C") { - codes.push_back("en"); - allCodes = codes; - allCodes.insert(allCodes.end(), builtin.begin(), builtin.end()); - if (All == true) - return allCodes; - else - return codes; - } - // to save the servers from unneeded queries, we only try also long codes // for languages it is realistic to have a long code translation file… // TODO: Improve translation acquire system to drop them dynamic @@ -217,37 +206,41 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All, // It is very likely we will need to environment codes later, // so let us generate them now from LC_MESSAGES and LANGUAGE std::vector<string> environment; - // take care of LC_MESSAGES - if (envLongIncluded == false) - environment.push_back(envLong); - environment.push_back(envShort); - // take care of LANGUAGE - const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE"); - string envLang = Locale == 0 ? language_env : *(Locale+1); - if (envLang.empty() == false) { - std::vector<string> env = VectorizeString(envLang,':'); - short addedLangs = 0; // add a maximum of 3 fallbacks from the environment - for (std::vector<string>::const_iterator e = env.begin(); - e != env.end() && addedLangs < 3; ++e) { - if (unlikely(e->empty() == true) || *e == "en") - continue; - if (*e == envLong || *e == envShort) - continue; - if (std::find(environment.begin(), environment.end(), *e) != environment.end()) - continue; - if (e->find('_') != string::npos) { - // Drop LongCodes here - ShortCodes are also included - string const shorty = e->substr(0, e->find('_')); - char const **n = needLong; - for (; *n != NULL; ++n) - if (shorty == *n) - break; - if (*n == NULL) + if (envShort != "C") { + // take care of LC_MESSAGES + if (envLongIncluded == false) + environment.push_back(envLong); + environment.push_back(envShort); + // take care of LANGUAGE + const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE"); + string envLang = Locale == 0 ? language_env : *(Locale+1); + if (envLang.empty() == false) { + std::vector<string> env = VectorizeString(envLang,':'); + short addedLangs = 0; // add a maximum of 3 fallbacks from the environment + for (std::vector<string>::const_iterator e = env.begin(); + e != env.end() && addedLangs < 3; ++e) { + if (unlikely(e->empty() == true) || *e == "en") + continue; + if (*e == envLong || *e == envShort) + continue; + if (std::find(environment.begin(), environment.end(), *e) != environment.end()) continue; + if (e->find('_') != string::npos) { + // Drop LongCodes here - ShortCodes are also included + string const shorty = e->substr(0, e->find('_')); + char const **n = needLong; + for (; *n != NULL; ++n) + if (shorty == *n) + break; + if (*n == NULL) + continue; + } + ++addedLangs; + environment.push_back(*e); } - ++addedLangs; - environment.push_back(*e); } + } else { + environment.push_back("en"); } // Support settings like Acquire::Translation=none on the command line to @@ -269,6 +262,16 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All, return codes; } + // cornercase: LANG=C, so we use only "en" Translation + if (envShort == "C") { + allCodes = codes = environment; + allCodes.insert(allCodes.end(), builtin.begin(), builtin.end()); + if (All == true) + return allCodes; + else + return codes; + } + std::vector<string> const lang = _config->FindVector("Acquire::Languages"); // the default setting -> "environment, en" if (lang.empty() == true) { diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 0b5d6d8e..23abc76c 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1444,8 +1444,11 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, VerIterator Ver(*this,*I); PkgIterator Pkg = Ver.ParentPkg(); - - + /* The List includes all packages providing this dependency, + even providers which are not installed, so skip them. */ + if (PkgState[Pkg->ID].InstallVer == 0) + continue; + if (PkgState[Pkg->ID].CandidateVer != *I && Start->Type == Dep::DpkgBreaks) MarkInstall(Pkg,true,Depth + 1, false, ForceImportantDeps); diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index 602b63d3..a53854a2 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -967,13 +967,33 @@ bool pkgOrderList::DepRemove(DepIterator D) // start again in the or group and find something which will serve as replacement for (; F.end() == false && F != S; ++F) { - if (F.TargetPkg() == D.TargetPkg() || - IsFlag(F.TargetPkg(), InList) == false || - VisitNode(F.TargetPkg()) == false) - continue; - Flag(F.TargetPkg(), Immediate); - tryFixDeps = false; - break; + if (IsFlag(F.TargetPkg(), InList) == true && + IsFlag(F.TargetPkg(), AddPending) == false && + Cache[F.TargetPkg()].InstallVer != 0 && + VisitNode(F.TargetPkg()) == true) + { + Flag(F.TargetPkg(), Immediate); + tryFixDeps = false; + break; + } + else if (F.TargetPkg()->ProvidesList != 0) + { + pkgCache::PrvIterator Prv = F.TargetPkg().ProvidesList(); + for (; Prv.end() == false; ++Prv) + { + if (IsFlag(Prv.OwnerPkg(), InList) == true && + IsFlag(Prv.OwnerPkg(), AddPending) == false && + Cache[Prv.OwnerPkg()].InstallVer != 0 && + VisitNode(Prv.OwnerPkg()) == true) + { + Flag(Prv.OwnerPkg(), Immediate); + tryFixDeps = false; + break; + } + } + if (Prv.end() == false) + break; + } } if (tryFixDeps == false) break; diff --git a/debian/changelog b/debian/changelog index 6e0ec713..52581d8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,24 @@ apt (0.8.9) UNRELEASED; urgency=low + [ Christian Perrier ] * Fix "typos" in French manpages translations. Thanks to Cyril Brulebois for bashing me. * Drop useless untranslatable sections from apt.8 - -- Christian Perrier <bubulle@debian.org> Sat, 30 Oct 2010 09:51:18 +0200 + [ David Kalnischkies ] + * apt-pkg/aptconfiguration.cc: + - evaluate Acquire::Languages= before LANG= (Closes: #602573) + * apt-pkg/orderlist.cc: + - try fixing before removing even if the fix is hidden in + a provides, hidden in the #590438 testcase + * apt-pkg/algorithms.cc: + - if the package was explicitly marked as ToRemove don't + consider it as a candidate for FixByInstall + * apt-pkg/depcache.cc: + - don't install previously not installed providers in a try + to statisfy a "Breaks: provides" dependency by upgrade + + -- David Kalnischkies <kalnischkies@gmail.com> Wed, 10 Nov 2010 13:22:39 +0100 apt (0.8.8) unstable; urgency=low diff --git a/test/integration/Packages-xorg-break-providers b/test/integration/Packages-xorg-break-providers new file mode 100644 index 00000000..f6e1d81f --- /dev/null +++ b/test/integration/Packages-xorg-break-providers @@ -0,0 +1,52 @@ +Package: xserver-xorg-video-intel +Priority: optional +Section: x11 +Installed-Size: 1292 +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Architecture: i386 +Version: 2:2.13.901-2 +Provides: xserver-xorg-video-8 +Filename: pool/main/x/xserver-xorg-video-intel/xserver-xorg-video-intel_2.13.901-2_i386.deb +Size: 586964 +MD5sum: 72527f4b2c9d734e53202736e3177865 +Description: X.Org X server -- Intel i8xx, i9xx display driver + +Package: xserver-xorg-video-vesa +Priority: optional +Section: x11 +Installed-Size: 104 +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Architecture: i386 +Version: 1:2.3.0-4 +Provides: xserver-xorg-video-8 +Filename: pool/main/x/xserver-xorg-video-vesa/xserver-xorg-video-vesa_2.3.0-4_i386.deb +Size: 27158 +MD5sum: 77bf2935c40b3b7739d431930e53d185 +Description: X.Org X server -- VESA display driver + +Package: xserver-xorg-video-vesa +Priority: optional +Section: x11 +Installed-Size: 104 +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Architecture: i386 +Version: 1:2.3.0-3 +Provides: xserver-xorg-video-6 +Filename: pool/main/x/xserver-xorg-video-vesa/xserver-xorg-video-vesa_2.3.0-3_i386.deb +Size: 27122 +MD5sum: 0cd97be927c7d75f2a7230739f8f866c +Description: X.Org X server -- VESA display driver + +Package: xserver-xorg-core +Priority: optional +Section: x11 +Installed-Size: 4436 +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Architecture: i386 +Source: xorg-server +Version: 2:1.7.7-8 +Breaks: xserver-xorg-video-6 +Filename: pool/main/x/xorg-server/xserver-xorg-core_1.7.7-8_i386.deb +Size: 2405050 +MD5sum: 976ddb13473e52903dd839d1f7ec390b +Description: Xorg X server - core server diff --git a/test/integration/status-xorg-break-providers b/test/integration/status-xorg-break-providers new file mode 100644 index 00000000..c6373518 --- /dev/null +++ b/test/integration/status-xorg-break-providers @@ -0,0 +1,22 @@ +Package: xserver-xorg-core +Status: install ok installed +Priority: optional +Section: x11 +Installed-Size: 4436 +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Architecture: i386 +Source: xorg-server +Version: 2:1.7.7-8 +Breaks: xserver-xorg-video-5 +Description: Xorg X server - core server + +Package: xserver-xorg-video-intel +Status: install ok installed +Priority: optional +Section: x11 +Installed-Size: 1268 +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Architecture: i386 +Version: 2:2.13.0-2 +Provides: xserver-xorg-video-6 +Description: X.Org X server -- Intel i8xx, i9xx display driver diff --git a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order index 3be0bec4..0f649394 100755 --- a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order +++ b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order @@ -25,7 +25,7 @@ MD5sum: 8489687ce10e656babd467c9ee389349 Description-de: Verschiedene Dateien für das Basis-System von Debian" predependsgawk() { -# rm rootdir/var/cache/apt/*.bin + rm rootdir/var/cache/apt/*.bin cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status echo "$pkgbasefile Pre-Depends: $1 @@ -57,7 +57,7 @@ predependsgawk "awk | aawk" predependsgawk "awk" predependsgawk2() { -# rm rootdir/var/cache/apt/*.bin + rm rootdir/var/cache/apt/*.bin cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status echo "$pkgbasefile Pre-Depends: $1 diff --git a/test/integration/test-xorg-break-providers b/test/integration/test-xorg-break-providers new file mode 100755 index 00000000..139d2c91 --- /dev/null +++ b/test/integration/test-xorg-break-providers @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +# the new xserver-xorg-core breaks xserver-xorg-video-6 +# which both -intel (installed) and -vesa (not installed) +# provided in their old version. +# The test ensures that only -intel will be upgraded +# (together with -core of course) and -vesa not touched. + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + xserver-xorg-video-intel +The following packages will be upgraded: + xserver-xorg-core xserver-xorg-video-intel +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/2992 kB of archives. +After this operation, 24.6 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget install xserver-xorg-core --trivial-only + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + xserver-xorg-core xserver-xorg-video-intel +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/2992 kB of archives. +After this operation, 24.6 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget upgrade --trivial-only + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + xserver-xorg-core xserver-xorg-video-intel +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/2992 kB of archives. +After this operation, 24.6 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index 9a8910b5..3559aae0 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -85,6 +85,30 @@ int main(int argc,char *argv[]) equals(vec.size(), 1); equals(vec[0], "en"); + _config->Set("Acquire::Languages", "none"); + env[0] = "C"; + vec = APT::Configuration::getLanguages(false, false, env); + equals(vec.size(), 0); + + _config->Set("Acquire::Languages", "environment"); + env[0] = "C"; + vec = APT::Configuration::getLanguages(false, false, env); + equals(vec.size(), 1); + equals(vec[0], "en"); + + _config->Set("Acquire::Languages", "de"); + env[0] = "C"; + vec = APT::Configuration::getLanguages(false, false, env); + equals(vec.size(), 1); + equals(vec[0], "de"); + + _config->Set("Acquire::Languages", "fr"); + env[0] = "ast_DE.UTF-8"; + vec = APT::Configuration::getLanguages(false, false, env); + equals(vec.size(), 1); + equals(vec[0], "fr"); + _config->Set("Acquire::Languages", ""); + _config->Set("Acquire::Languages::1", "environment"); _config->Set("Acquire::Languages::2", "en"); env[0] = "de_DE.UTF-8"; |