From b3887af24029cdc6179470fcb8587fff39a3eee9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 2 Mar 2012 22:01:51 +0100 Subject: * apt-pkg/packagemanager.cc: - when calculating pre-dependencies ensure that both unpack and configure are considered (instead of only configure) LP: #927993 --- apt-pkg/packagemanager.cc | 17 +++++++++++++---- debian/changelog | 3 +++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index a370f15a3..701b64af1 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -611,10 +611,19 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c 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 */ diff --git a/debian/changelog b/debian/changelog index 360fcf453..25563e811 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,9 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low (LP: #923807) * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode + * apt-pkg/packagemanager.cc: + - when calculating pre-dependencies ensure that both unpack and + configure are considered (instead of only configure) LP: #927993 -- David Kalnischkies Mon, 30 Jan 2012 19:17:09 +0100 -- cgit v1.2.3 From 945099df10a67c3c7f52fcfef165a2782e51809e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 5 Mar 2012 14:57:11 +0100 Subject: * apt-pkg/deb/deblistparser.cc: - Set the Essential flag on APT instead of only Important --- apt-pkg/deb/deblistparser.cc | 2 +- debian/changelog | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index bdb50f6bf..84e6c38c5 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -249,7 +249,7 @@ bool debListParser::UsePackage(pkgCache::PkgIterator &Pkg, return false; if (strcmp(Pkg.Name(),"apt") == 0) - Pkg->Flags |= pkgCache::Flag::Important; + Pkg->Flags |= pkgCache::Flag::Essential | pkgCache::Flag::Important; if (ParseStatus(Pkg,Ver) == false) return false; diff --git a/debian/changelog b/debian/changelog index db2085a6a..cd911d3dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,10 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode + [ Julian Andres Klode ] + * apt-pkg/deb/deblistparser.cc: + - Set the Essential flag on APT instead of only Important + -- David Kalnischkies Mon, 30 Jan 2012 19:17:09 +0100 apt (0.8.16~exp12) experimental; urgency=low -- cgit v1.2.3 From fb805d80bfc6027e2242796dbda306e712cfac09 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 5 Mar 2012 15:10:54 +0100 Subject: * apt-pkg/packagemanager.cc: - Do not use immediate configuration for packages with the Important flag --- apt-pkg/packagemanager.cc | 3 +-- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index a370f15a3..4eb539579 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -184,8 +184,7 @@ bool pkgPackageManager::CreateOrderList() 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) diff --git a/debian/changelog b/debian/changelog index cd911d3dd..9ecf363c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,6 +40,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low [ 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 -- David Kalnischkies Mon, 30 Jan 2012 19:17:09 +0100 -- cgit v1.2.3 From c520086906f0479d04946f926e3d2dd30df82945 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 5 Mar 2012 15:12:31 +0100 Subject: * Treat the Important flag like the Essential flag with two differences: - No Immediate configuration (see above) - Not automatically installed during dist-upgrade --- apt-pkg/algorithms.cc | 13 +++++++++++-- apt-pkg/depcache.cc | 8 ++++++++ apt-pkg/packagemanager.cc | 6 ++++-- debian/changelog | 3 +++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index c337ace87..ef9b5411d 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -556,7 +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 @@ void pkgProblemResolver::MakeScores() { 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 @@ static int PrioComp(const void *A,const void *B) 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 --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 9449c7306..1eea55560 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -963,6 +963,13 @@ struct CompareProviders { else if ((B->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) return true; } + if ((A->Flags & pkgCache::Flag::Important) != (B->Flags & pkgCache::Flag::Important)) + { + if ((A->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) + return false; + else if ((B->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) + return true; + } // higher priority seems like a good idea if (AV->Priority != BV->Priority) return AV->Priority < BV->Priority; @@ -1641,6 +1648,7 @@ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc) { if(!(PkgState[p->ID].Flags & Flag::Auto) || (p->Flags & Flag::Essential) || + (p->Flags & Flag::Important) || userFunc.InRootSet(p) || // be nice even then a required package violates the policy (#583517) // and do the full mark process also for required packages diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 4eb539579..d8e9621a4 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -486,7 +486,8 @@ bool pkgPackageManager::EarlyRemove(PkgIterator 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 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg) 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; } diff --git a/debian/changelog b/debian/changelog index 9ecf363c1..0b23e7a7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -42,6 +42,9 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - 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 two differences: + - No Immediate configuration (see above) + - Not automatically installed during dist-upgrade -- David Kalnischkies Mon, 30 Jan 2012 19:17:09 +0100 -- cgit v1.2.3 From 22d9031d52d2c96c1457346580050edf2814cdc9 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 5 Mar 2012 15:19:50 +0100 Subject: changelog: Document scoring difference for Important flag * Treat the Important flag like the Essential flag with those differences: - No higher score for installation ordering --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0b23e7a7e..c01c087a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -42,9 +42,10 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - 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 two differences: + * 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 -- cgit v1.2.3