From 7ea7ac9efa88b73fc6ff30483a928ef49b95c015 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 8 Apr 2011 13:57:04 +0200 Subject: * apt-pkg/acquire-item.cc: - Use Release files even if they cannot be verified (LP: #704595) --- apt-pkg/acquire-item.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 39b9feff2..1d651ba69 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1502,6 +1502,26 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) ReportMirrorFailure("GPGFailure"); } + /* Always move the meta index, even if gpgv failed. This ensures + * that PackageFile objects are correctly filled in */ + { + string FinalFile = _config->FindDir("Dir::State::lists"); + FinalFile += URItoFileName(RealURI); + /* InRelease files become Release files, otherwise + * they would be considered as trusted later on */ + if (SigFile == DestFile) { + RealURI = RealURI.replace(RealURI.rfind("InRelease"), 9, + "Release"); + FinalFile = FinalFile.replace(FinalFile.rfind("InRelease"), 9, + "Release"); + SigFile = FinalFile; + } + Rename(DestFile,FinalFile); + chmod(FinalFile.c_str(),0644); + + DestFile = FinalFile; + } + // No Release file was present, or verification failed, so fall // back to queueing Packages files without verification QueueIndexes(false); -- cgit v1.2.3 From 90cf90b254e5dbe8194dc93fa8f57f891b3ea518 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 14 Apr 2011 12:28:00 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - Handle no space before "[" in build-dependencies (LP: #72344) --- apt-pkg/deb/deblistparser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 4be626741..b59ae8896 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -487,7 +487,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, // Parse off the package name const char *I = Start; for (;I != Stop && isspace(*I) == 0 && *I != '(' && *I != ')' && - *I != ',' && *I != '|'; I++); + *I != ',' && *I != '|' && *I != '[' && *I != ']'; I++); // Malformed, no '(' if (I != Stop && *I == ')') -- cgit v1.2.3 From 1a4c9766e0b31795b5d9869c6a98c1bba8380faa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 15 Apr 2011 12:52:45 +0200 Subject: * apt-pkg/policy.cc: - Allow pinning by glob() expressions, and regular expressions surrounded by slashes (the "/" character). --- apt-pkg/policy.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 94c7fd4af..3d6ec1cdc 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -216,6 +216,21 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, P->Data = Data; return; } + + // Allow pinning by wildcards + // TODO: Maybe we should always prefer specific pins over non- + // specific ones. + if (Name.find("*") != string::npos || Name.find("[") != string::npos + || Name.find("?") != string::npos || Name[0] == '/') { + pkgVersionMatch match(Data, Type); + for (pkgCache::PkgIterator P = Cache->PkgBegin(); + P != Cache->PkgEnd(); P++) { + if (match.ExpressionMatches(Name, P.Name())) { + CreatePin(Type, P.Name(), Data, Priority); + } + } + return; + } // Get a spot to put the pin pkgCache::GrpIterator Grp = Cache->FindGrp(Name); -- cgit v1.2.3 From a235ddf86a9cc5c3a8fade9084044229ff51a77f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 16 Apr 2011 11:02:47 +0200 Subject: apt-pkg/acquire-item.cc: Only try to rename existing Release files (Closes: #622912) --- apt-pkg/acquire-item.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 1d651ba69..7b120d3ce 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1504,7 +1504,7 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /* Always move the meta index, even if gpgv failed. This ensures * that PackageFile objects are correctly filled in */ - { + if (FileExists(DestFile)) { string FinalFile = _config->FindDir("Dir::State::lists"); FinalFile += URItoFileName(RealURI); /* InRelease files become Release files, otherwise -- cgit v1.2.3 From ab60fb67a9917bfb8cb96576d6452f1ec9d34e0d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 18 Apr 2011 10:56:37 +0200 Subject: apt-pkg/depcache.cc: Really release action groups only once (Closes: #622744) --- apt-pkg/depcache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 07803d7bf..9dad7e240 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -70,7 +70,7 @@ void pkgDepCache::ActionGroup::release() cache.MarkAndSweep(); } - released = false; + released = true; } } -- cgit v1.2.3 From 884cb8a574144ce47564911b97b62a269f82481e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 21 Apr 2011 12:18:05 +0200 Subject: Make purge work again for config-files (LP: #244598) (Closes: #150831) --- apt-pkg/depcache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 9dad7e240..bef977532 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -550,7 +550,7 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg,int Add) if (Pkg->CurrentVer == 0) { if (State.Mode == ModeDelete && - (State.iFlags | Purge) == Purge && Pkg.Purge() == false) + (State.iFlags & Purge) == Purge && Pkg.Purge() == false) iDelCount += Add; if (State.Mode == ModeInstall) -- cgit v1.2.3