From: David Kalnischkies Date: Tue, 6 Mar 2012 16:36:59 +0000 (+0100) Subject: merge with apt/experimental X-Git-Tag: 0.9.0~13^2~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/e8184cc38f673a3d86be9268525cf259120c2a9e?hp=-c merge with apt/experimental * apt-pkg/packagemanager.cc: - fix bug in predepends handling - ensure that packages that needs unpackaging are unpacked before they are configured (LP: #927993) [ Julian Andres Klode ] * apt-pkg/deb/deblistparser.cc: - Set the Essential flag on APT instead of only Important * apt-pkg/packagemanager.cc: - Do not use immediate configuration for packages with the Important flag * Treat the Important flag like the Essential flag with those differences: - No Immediate configuration (see above) - Not automatically installed during dist-upgrade - No higher score for installation ordering --- e8184cc38f673a3d86be9268525cf259120c2a9e diff --combined apt-pkg/algorithms.cc index ed3534f0d,ef9b5411d..8beb2d51c --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@@ -471,7 -471,7 +471,7 @@@ bool pkgMinimizeUpgrade(pkgDepCache &Ca // ProblemResolver::pkgProblemResolver - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : Cache(*pCache) +pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : d(NULL), Cache(*pCache) { // Allocate memory unsigned long Size = Cache.Head().PackageCount; @@@ -556,7 -556,8 +556,8 @@@ void pkgProblemResolver::MakeScores( essantial package above most other packages but low enough to allow an obsolete essential packages to be removed by a conflicts on a powerfull normal package (ie libc6) */ - if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) + if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential + || (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) Score += PrioEssentials; // We transform the priority @@@ -631,7 -632,8 +632,8 @@@ { if ((Flags[I->ID] & Protected) != 0) Scores[I->ID] += AddProtected; - if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) + if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential || + (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) Scores[I->ID] += AddEssential; } } @@@ -1430,6 -1432,13 +1432,13 @@@ static int PrioComp(const void *A,cons if ((L.ParentPkg()->Flags & pkgCache::Flag::Essential) != pkgCache::Flag::Essential && (R.ParentPkg()->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) return -1; + + if ((L.ParentPkg()->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important && + (R.ParentPkg()->Flags & pkgCache::Flag::Important) != pkgCache::Flag::Important) + return 1; + if ((L.ParentPkg()->Flags & pkgCache::Flag::Important) != pkgCache::Flag::Important && + (R.ParentPkg()->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) + return -1; if (L->Priority != R->Priority) return R->Priority - L->Priority; diff --combined apt-pkg/packagemanager.cc index 5b5961aca,0e4595735..382ee4383 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@@ -36,13 -36,11 +36,13 @@@ bool pkgPackageManager::SigINTStop = fa // PM::PackageManager - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache) +pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache), + List(NULL), Res(Incomplete) { FileNames = new string[Cache.Head().PackageCount]; - List = 0; Debug = _config->FindB("Debug::pkgPackageManager",false); + NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true); + ImmConfigureAll = _config->FindB("APT::Immediate-Configure-All",false); } /*}}}*/ // PM::PackageManager - Destructor /*{{{*/ @@@ -171,7 -169,10 +171,7 @@@ bool pkgPackageManager::CreateOrderList delete List; List = new pkgOrderList(&Cache); - - NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true); - ImmConfigureAll = _config->FindB("APT::Immediate-Configure-All",false); - + if (Debug && ImmConfigureAll) clog << "CreateOrderList(): Adding Immediate flag for all packages because of APT::Immediate-Configure-All" << endl; @@@ -183,8 -184,7 +183,7 @@@ continue; // Mark the package and its dependends for immediate configuration - if ((((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential || - (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) && + if ((((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) && NoImmConfigure == false) || ImmConfigureAll) { if(Debug && !ImmConfigureAll) @@@ -486,7 -486,8 +485,8 @@@ bool pkgPackageManager::EarlyRemove(Pkg // Essential packages get special treatment bool IsEssential = false; - if ((Pkg->Flags & pkgCache::Flag::Essential) != 0) + if ((Pkg->Flags & pkgCache::Flag::Essential) != 0 || + (Pkg->Flags & pkgCache::Flag::Important) != 0) IsEssential = true; /* Check for packages that are the dependents of essential packages and @@@ -496,7 -497,8 +496,8 @@@ for (DepIterator D = Pkg.RevDependsList(); D.end() == false && IsEssential == false; ++D) if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) - if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0) + if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0 || + (D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0) IsEssential = true; } @@@ -610,10 -612,19 +611,19 @@@ bool pkgPackageManager::SmartUnPack(Pkg continue; } - if (Debug) - clog << OutputInDepth(Depth) << "Trying to SmartConfigure " << Pkg.Name() << endl; - Bad = !SmartConfigure(Pkg, Depth + 1); - } + // check if it needs unpack or if if configure is enough + if (!List->IsFlag(Pkg,pkgOrderList::UnPacked)) + { + if (Debug) + clog << OutputInDepth(Depth) << "Trying to SmartUnpack " << Pkg.Name() << endl; + // SmartUnpack with the ImmediateFlag to ensure its really ready + Bad = !SmartUnPack(Pkg, true, Depth + 1); + } else { + if (Debug) + clog << OutputInDepth(Depth) << "Trying to SmartConfigure " << Pkg.Name() << endl; + Bad = !SmartConfigure(Pkg, Depth + 1); + } + } /* If this or element did not match then continue on to the next or element until a matching element is found */ @@@ -679,6 -690,7 +689,6 @@@ { VerIterator Ver(Cache,*I); PkgIterator BrokenPkg = Ver.ParentPkg(); - VerIterator InstallVer(Cache,Cache[BrokenPkg].InstallVer); if (BrokenPkg.CurrentVer() != Ver) { if (Debug) @@@ -687,64 -699,35 +697,64 @@@ } // Check if it needs to be unpacked - if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false && + if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false && List->IsNow(BrokenPkg)) { - if (List->IsFlag(BrokenPkg,pkgOrderList::Loop) && PkgLoop) { - // This dependancy has already been dealt with by another SmartUnPack on Pkg - break; - } else if (List->IsFlag(Pkg,pkgOrderList::Loop)) { - /* Found a break, so unpack the package, but dont remove loop as already set. - This means that there is another SmartUnPack call for this - package and it will remove the loop flag. */ - if (Debug) - cout << OutputInDepth(Depth) << " Unpacking " << BrokenPkg.Name() << " to avoid break" << endl; - - SmartUnPack(BrokenPkg, false, Depth + 1); - } else { - List->Flag(Pkg,pkgOrderList::Loop); - // Found a break, so unpack the package - if (Debug) - cout << OutputInDepth(Depth) << " Unpacking " << BrokenPkg.Name() << " to avoid break" << endl; - - SmartUnPack(BrokenPkg, false, Depth + 1); - List->RmFlag(Pkg,pkgOrderList::Loop); - } - } - - // Check if a package needs to be removed - if (Cache[BrokenPkg].Delete() == true && !List->IsFlag(BrokenPkg,pkgOrderList::Configured)) { - if (Debug) - cout << OutputInDepth(Depth) << " Removing " << BrokenPkg.Name() << " to avoid break" << endl; - SmartRemove(BrokenPkg); + if (List->IsFlag(BrokenPkg,pkgOrderList::Loop) && PkgLoop) { + // This dependancy has already been dealt with by another SmartUnPack on Pkg + break; + } else { + // Found a break, so see if we can unpack the package to avoid it + // but do not set loop if another SmartUnPack already deals with it + VerIterator InstallVer(Cache,Cache[BrokenPkg].InstallVer); + bool circle = false; + for (pkgCache::DepIterator D = InstallVer.DependsList(); D.end() == false; ++D) + { + if (D->Type != pkgCache::Dep::PreDepends) + continue; + SPtrArray VL = D.AllTargets(); + for (Version **I = VL; *I != 0; ++I) + { + VerIterator V(Cache,*I); + PkgIterator P = V.ParentPkg(); + // we are checking for installation as an easy 'protection' against or-groups and (unchosen) providers + if (P->CurrentVer == 0 || P != Pkg || (P.CurrentVer() != V && Cache[P].InstallVer != V)) + continue; + circle = true; + break; + } + if (circle == true) + break; + } + if (circle == true) + { + if (Debug) + cout << OutputInDepth(Depth) << " Avoiding " << End << " avoided as " << BrokenPkg.FullName() << " has a pre-depends on " << Pkg.FullName() << std::endl; + continue; + } + else + { + if (Debug) + { + cout << OutputInDepth(Depth) << " Unpacking " << BrokenPkg.FullName() << " to avoid " << End; + if (PkgLoop == true) + cout << " (Looping)"; + cout << std::endl; + } + if (PkgLoop == false) + List->Flag(Pkg,pkgOrderList::Loop); + SmartUnPack(BrokenPkg, false, Depth + 1); + if (PkgLoop == false) + List->RmFlag(Pkg,pkgOrderList::Loop); + } + } + } else { + // Check if a package needs to be removed + if (Cache[BrokenPkg].Delete() == true && !List->IsFlag(BrokenPkg,pkgOrderList::Configured)) + { + if (Debug) + cout << OutputInDepth(Depth) << " Removing " << BrokenPkg.Name() << " to avoid " << End << endl; + SmartRemove(BrokenPkg); + } } } } diff --combined debian/changelog index 1569098c1,8e4c05d7c..df89181a0 --- a/debian/changelog +++ b/debian/changelog @@@ -1,19 -1,9 +1,19 @@@ apt (0.8.16~exp13) UNRELEASED; urgency=low [ David Kalnischkies ] + * apt-pkg/acquire-item.cc: + - remove 'old' InRelease file if we can't get a new one before + proceeding with Release.gpg to avoid the false impression of a still + trusted repository by a (still present) old InRelease file. + Thanks to Simon Ruderich for reporting this issue! (CVE-2012-0214) * apt-pkg/deb/dpkgpm.cc: - chroot if needed before dpkg --assert-multi-arch - ensure that dpkg binary doesn't have the chroot-directory prefixed + - call dpkg --assert-multi-arch with execvp instead of execv + - save the universe by not printing messages about apport if a package + with this name is not installed (Closes: #619646) + - handle a SIGINT in all modes as a break after the currently running + dpkg transaction instead of ignoring it completely * 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) @@@ -23,35 -13,8 +23,35 @@@ - if a file without an extension is requested send an 'Accept: text/*' header to avoid that the server chooses unsupported compressed files in a content-negotation attempt (Closes: #657560) + - remove the arbitrary MAXLEN limit for response lines (Closes: #658346) * apt-pkg/aptconfiguration.cc: - chroot if needed before calling dpkg --print-foreign-architectures + - ensure that architectures are not added multiple times + * cmdline/apt-mark.cc: + - detect if dpkg has multiarch support before calling --set-selections + - correctly ignore already (un)hold packages + * apt-pkg/cachefile.cc: + - clean up lost atomic cachefiles with 'clean' (Closes: #650513) + * apt-pkg/indexrecords.cc: + - do not create empty Entries as a sideeffect of Lookup() + * apt-pkg/acquire-item.cc: + - drop support for i18n/Index file (introduced in 0.8.11) and use + the Release file instead to get the Translations (Closes: #649314) + - use pdiff for Translation-* files if available (Closes: #657902) + * ftparchive/writer.cc: + - add 'Translation-*' to the default patterns + * cmdline/apt-get.cc: + - if a package can't be removed as it is not installed, suggest to + the user an (installed) multiarch silbing with 'Did you mean?' + - improve 'error' message for packages which are only referenced + e.g. in a Depends line and are now requested for removal + * cmdline/apt-cache.cc: + - correct --pre-depends option by using dash consistently (LP: #940837) + * apt-pkg/packagemanager.cc: + - do not try to a void a breaks if the broken package pre-depends + on the breaker, but let dpkg auto-deconfigure it + * apt-pkg/contrib/fileutl.cc: + - do not warn about the ignoring of directories (Closes: #662762) [ Steve Langasek ] * cmdline/apt-get.cc: @@@ -66,15 -29,28 +66,28 @@@ become so big now that it can overflow (Closes: #657732, LP: #917173) * Fix IndexCopy::CopyPackages and TranslationsCopy::CopyTranslations to handle compressed files again (LP: #924182, closes: #658096) - + [ Michael Vogt ] * apt-pkg/deb/dpkgpm.cc: - fix crash when a package is in removed but residual config state (LP: #923807) * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode + * apt-pkg/packagemanager.cc: + - fix bug in predepends handling - ensure that packages that needs + unpackaging are unpacked before they are configured (LP: #927993) + + [ Julian Andres Klode ] + * apt-pkg/deb/deblistparser.cc: + - Set the Essential flag on APT instead of only Important + * apt-pkg/packagemanager.cc: + - Do not use immediate configuration for packages with the Important flag + * Treat the Important flag like the Essential flag with those differences: + - No Immediate configuration (see above) + - Not automatically installed during dist-upgrade + - No higher score for installation ordering - -- David Kalnischkies Mon, 30 Jan 2012 19:17:09 +0100 + -- David Kalnischkies Tue, 06 Mar 2012 10:52:00 +0100 apt (0.8.16~exp12) experimental; urgency=low