diff options
-rw-r--r-- | apt-pkg/acquire-item.cc | 20 | ||||
-rw-r--r-- | apt-pkg/acquire-item.h | 3 | ||||
-rw-r--r-- | apt-pkg/acquire-worker.cc | 7 | ||||
-rw-r--r-- | apt-pkg/algorithms.cc | 91 | ||||
-rw-r--r-- | apt-pkg/deb/dpkgpm.h | 2 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 444 | ||||
-rw-r--r-- | apt-pkg/depcache.h | 219 | ||||
-rw-r--r-- | apt-pkg/init.h | 2 | ||||
-rw-r--r-- | apt-pkg/makefile | 2 | ||||
-rw-r--r-- | apt-pkg/packagemanager.cc | 15 | ||||
-rw-r--r-- | apt-pkg/packagemanager.h | 32 | ||||
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 4 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 340 | ||||
-rwxr-xr-x | cmdline/apt-key | 6 | ||||
-rwxr-xr-x | cmdline/apt-mark | 63 | ||||
-rw-r--r-- | debian/apt.cron.daily | 16 | ||||
-rw-r--r-- | debian/apt.postinst | 2 | ||||
-rw-r--r-- | debian/changelog | 293 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | debian/rules | 9 | ||||
-rw-r--r-- | doc/apt_preferences.5.xml | 2 | ||||
-rw-r--r-- | doc/examples/configure-index | 9 | ||||
-rw-r--r-- | doc/examples/sources.list | 13 | ||||
-rw-r--r-- | methods/http.cc | 2 | ||||
-rw-r--r-- | methods/makefile | 2 | ||||
-rw-r--r-- | po/apt-all.pot | 326 | ||||
-rw-r--r-- | po/makefile | 3 | ||||
-rw-r--r-- | share/debian-archive.gpg | bin | 4171 -> 2717 bytes |
28 files changed, 1538 insertions, 391 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 421288007..18ce1076f 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -75,7 +75,7 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Dequeue(); return; } - + Status = StatError; Dequeue(); } @@ -321,8 +321,9 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner, DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(URI); - // remove any partial downloaded sig-file. it may confuse proxies - // and is too small to warrant a partial download anyway + // remove any partial downloaded sig-file in partial/. + // it may confuse proxies and is too small to warrant a + // partial download anyway unlink(DestFile.c_str()); // Create the item @@ -389,17 +390,22 @@ void pkgAcqMetaSig::Done(string Message,unsigned long Size,string MD5, /*}}}*/ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) { + string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); // if we get a network error we fail gracefully - if(LookupTag(Message,"FailReason") == "Timeout" || - LookupTag(Message,"FailReason") == "TmpResolveFailure" || - LookupTag(Message,"FailReason") == "ConnectionRefused") { + if(Status == StatTransientNetworkError) + { Item::Failed(Message,Cnf); + // move the sigfile back on network failures (and re-authenticated?) + if(FileExists(DestFile)) + Rename(DestFile,Final); + + // set the status back to , Item::Failed likes to reset it + Status = pkgAcquire::Item::StatTransientNetworkError; return; } // Delete any existing sigfile when the acquire failed - string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); unlink(Final.c_str()); // queue a pkgAcqMetaIndex with no sigfile diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index da1bea801..1c83f8d2e 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -48,7 +48,8 @@ class pkgAcquire::Item public: // State of the item - enum {StatIdle, StatFetching, StatDone, StatError, StatAuthError} Status; + enum {StatIdle, StatFetching, StatDone, StatError, + StatAuthError, StatTransientNetworkError} Status; string ErrorText; unsigned long FileSize; unsigned long PartialSize; diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index d06024178..8ab67778b 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -307,6 +307,13 @@ bool pkgAcquire::Worker::RunMessages() pkgAcquire::Item *Owner = Itm->Owner; pkgAcquire::ItemDesc Desc = *Itm; OwnerQ->ItemDone(Itm); + + // set some status + if(LookupTag(Message,"FailReason") == "Timeout" || + LookupTag(Message,"FailReason") == "TmpResolveFailure" || + LookupTag(Message,"FailReason") == "ConnectionRefused") + Owner->Status = pkgAcquire::Item::StatTransientNetworkError; + Owner->Failed(Message,Config); ItemDone(); diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 479927d65..ac9d3be0b 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -20,10 +20,12 @@ #include <apt-pkg/algorithms.h> #include <apt-pkg/error.h> #include <apt-pkg/configuration.h> +#include <apt-pkg/version.h> #include <apt-pkg/sptr.h> + #include <apti18n.h> - +#include <sys/types.h> #include <iostream> /*}}}*/ using namespace std; @@ -220,6 +222,8 @@ void pkgSimulate::ShortBreaks() the necessary calculations to deal with the problems. */ bool pkgApplyStatus(pkgDepCache &Cache) { + pkgDepCache::ActionGroup group(Cache); + for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) { if (I->VersionList == 0) @@ -230,13 +234,13 @@ bool pkgApplyStatus(pkgDepCache &Cache) I->InstState == pkgCache::State::HoldReInstReq) { if (I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true) - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); else { // Is this right? Will dpkg choke on an upgrade? if (Cache[I].CandidateVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable() == true) - Cache.MarkInstall(I); + Cache.MarkInstall(I, false, 0, false); else return _error->Error(_("The package %s needs to be reinstalled, " "but I can't find an archive for it."),I.Name()); @@ -253,12 +257,12 @@ bool pkgApplyStatus(pkgDepCache &Cache) case pkgCache::State::HalfConfigured: if ((I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true) || I.State() != pkgCache::PkgIterator::NeedsUnpack) - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); else { if (Cache[I].CandidateVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable() == true) - Cache.MarkInstall(I); + Cache.MarkInstall(I, true, 0, false); else Cache.MarkDelete(I); } @@ -284,10 +288,12 @@ bool pkgApplyStatus(pkgDepCache &Cache) on the result. */ bool pkgFixBroken(pkgDepCache &Cache) { + pkgDepCache::ActionGroup group(Cache); + // Auto upgrade all broken packages for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) if (Cache[I].NowBroken() == true) - Cache.MarkInstall(I,true); + Cache.MarkInstall(I, true, 0, false); /* Fix packages that are in a NeedArchive state but don't have a downloadable install version */ @@ -300,7 +306,7 @@ bool pkgFixBroken(pkgDepCache &Cache) if (Cache[I].InstVerIter(Cache).Downloadable() == false) continue; - Cache.MarkInstall(I,true); + Cache.MarkInstall(I, true, 0, false); } pkgProblemResolver Fix(&Cache); @@ -317,23 +323,25 @@ bool pkgFixBroken(pkgDepCache &Cache) */ bool pkgDistUpgrade(pkgDepCache &Cache) { + pkgDepCache::ActionGroup group(Cache); + /* Auto upgrade all installed packages, this provides the basis for the installation */ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) if (I->CurrentVer != 0) - Cache.MarkInstall(I,true); + Cache.MarkInstall(I, true, 0, false); /* Now, auto upgrade all essential packages - this ensures that the essential packages are present and working */ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) - Cache.MarkInstall(I,true); + Cache.MarkInstall(I, true, 0, false); /* We do it again over all previously installed packages to force conflict resolution on them all. */ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) if (I->CurrentVer != 0) - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); pkgProblemResolver Fix(&Cache); @@ -345,7 +353,7 @@ bool pkgDistUpgrade(pkgDepCache &Cache) if (I->SelectedState == pkgCache::State::Hold) { Fix.Protect(I); - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); } } } @@ -360,6 +368,8 @@ bool pkgDistUpgrade(pkgDepCache &Cache) to install packages not marked for install */ bool pkgAllUpgrade(pkgDepCache &Cache) { + pkgDepCache::ActionGroup group(Cache); + pkgProblemResolver Fix(&Cache); if (Cache.BrokenCount() != 0) @@ -376,7 +386,7 @@ bool pkgAllUpgrade(pkgDepCache &Cache) continue; if (I->CurrentVer != 0 && Cache[I].InstallVer != 0) - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); } return Fix.ResolveByKeep(); @@ -389,6 +399,8 @@ bool pkgAllUpgrade(pkgDepCache &Cache) the package is restored. */ bool pkgMinimizeUpgrade(pkgDepCache &Cache) { + pkgDepCache::ActionGroup group(Cache); + if (Cache.BrokenCount() != 0) return false; @@ -405,9 +417,9 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache) continue; // Keep it and see if that is OK - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); if (Cache.BrokenCount() != 0) - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); else { // If keep didnt actually do anything then there was no change.. @@ -565,6 +577,8 @@ void pkgProblemResolver::MakeScores() installable */ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) { + pkgDepCache::ActionGroup group(Cache); + if ((Flags[Pkg->ID] & Upgradable) == 0 || Cache[Pkg].Upgradable() == false) return false; if ((Flags[Pkg->ID] & Protected) == Protected) @@ -573,7 +587,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) Flags[Pkg->ID] &= ~Upgradable; bool WasKept = Cache[Pkg].Keep(); - Cache.MarkInstall(Pkg,false); + Cache.MarkInstall(Pkg, false, 0, false); // This must be a virtual package or something like that. if (Cache[Pkg].InstVerIter(Cache).end() == true) @@ -658,7 +672,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) if (Fail == true) { if (WasKept == true) - Cache.MarkKeep(Pkg); + Cache.MarkKeep(Pkg, false, false); else Cache.MarkDelete(Pkg); return false; @@ -685,6 +699,8 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) upgrade packages to advoid problems. */ bool pkgProblemResolver::Resolve(bool BrokenFix) { + pkgDepCache::ActionGroup group(Cache); + unsigned long Size = Cache.Head().PackageCount; // Record which packages are marked for install @@ -700,7 +716,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) { if (Cache[I].InstBroken() == true && BrokenFix == true) { - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); if (Cache[I].Install() == true) Again = true; } @@ -766,14 +782,14 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) pkgCache::Version *OldVer = Cache[I].InstallVer; Flags[I->ID] &= ReInstateTried; - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); if (Cache[I].InstBroken() == true || OldBreaks < Cache.BrokenCount()) { if (OldVer == 0) Cache.MarkDelete(I); else - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); } else if (Debug == true) @@ -818,7 +834,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) { if (Debug == true) clog << " Or group keep for " << I.Name() << endl; - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); Change = true; } } @@ -868,7 +884,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) } Change = true; - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); break; } @@ -905,7 +921,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) /* See if a keep will do, unless the package is protected, then installing it will be necessary */ bool Installed = Cache[I].Install(); - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); if (Cache[I].InstBroken() == false) { // Unwind operation will be keep now @@ -914,7 +930,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) // Restore if (InOr == true && Installed == true) - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); if (Debug == true) clog << " Holding Back " << I.Name() << " rather than change " << Start.TargetPkg().Name() << endl; @@ -986,7 +1002,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) // Restore if (InOr == true && Installed == true) - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); if (Debug == true) clog << " Holding Back " << I.Name() << " because I can't find " << Start.TargetPkg().Name() << endl; @@ -1031,7 +1047,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) { if (Debug == true) clog << " Fixing " << I.Name() << " via keep of " << J->Pkg.Name() << endl; - Cache.MarkKeep(J->Pkg); + Cache.MarkKeep(J->Pkg, false, false); } if (Counter > 1) @@ -1061,6 +1077,20 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) return _error->Error(_("Unable to correct problems, you have held broken packages.")); } + // set the auto-flags (mvo: I'm not sure if we _really_ need this, but + // I didn't managed + pkgCache::PkgIterator I = Cache.PkgBegin(); + for (;I.end() != true; I++) { + if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) { + if(_config->FindI("Debug::pkgAutoRemove",false)) { + std::clog << "Resolve installed new pkg: " << I.Name() + << " (now marking it as auto)" << std::endl; + } + Cache[I].Flags |= pkgCache::Flag::Auto; + } + } + + return true; } /*}}}*/ @@ -1071,6 +1101,8 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) system was non-broken previously. */ bool pkgProblemResolver::ResolveByKeep() { + pkgDepCache::ActionGroup group(Cache); + unsigned long Size = Cache.Head().PackageCount; if (Debug == true) @@ -1104,7 +1136,7 @@ bool pkgProblemResolver::ResolveByKeep() { if (Debug == true) clog << "Keeping package " << I.Name() << endl; - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); if (Cache[I].InstBroken() == false) { K = PList - 1; @@ -1152,7 +1184,7 @@ bool pkgProblemResolver::ResolveByKeep() { if (Debug == true) clog << " Keeping Package " << Pkg.Name() << " due to dep" << endl; - Cache.MarkKeep(Pkg); + Cache.MarkKeep(Pkg, false, false); } if (Cache[I].InstBroken() == false) @@ -1189,6 +1221,8 @@ bool pkgProblemResolver::ResolveByKeep() /* This is used to make sure protected packages are installed */ void pkgProblemResolver::InstallProtect() { + pkgDepCache::ActionGroup group(Cache); + for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) { if ((Flags[I->ID] & Protected) == Protected) @@ -1196,7 +1230,7 @@ void pkgProblemResolver::InstallProtect() if ((Flags[I->ID] & ToRemove) == ToRemove) Cache.MarkDelete(I); else - Cache.MarkInstall(I,false); + Cache.MarkInstall(I, false, 0, false); } } } @@ -1232,3 +1266,4 @@ void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List) qsort(List,Count,sizeof(*List),PrioComp); } /*}}}*/ + diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index 2ff8a9ac7..0b181dc43 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -47,7 +47,7 @@ class pkgDPkgPM : public pkgPackageManager bool RunScripts(const char *Cnf); bool RunScriptsWithPkgs(const char *Cnf); bool SendV2Pkgs(FILE *F); - + // The Actuall installation implementation virtual bool Install(PkgIterator Pkg,string File); virtual bool Configure(PkgIterator Pkg); diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 58d1d25e5..369eae70b 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -16,16 +16,52 @@ #include <apt-pkg/error.h> #include <apt-pkg/sptr.h> #include <apt-pkg/algorithms.h> + +#include <apt-pkg/fileutl.h> #include <apt-pkg/configuration.h> +#include <apt-pkg/pkgsystem.h> +#include <apt-pkg/tagfile.h> + +#include <iostream> +#include <sstream> +#include <set> #include <apti18n.h> - /*}}}*/ + +pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) : + cache(cache), released(false) +{ + ++cache.group_level; +} + +void pkgDepCache::ActionGroup::release() +{ + if(!released) + { + if(cache.group_level == 0) + std::cerr << "W: Unbalanced action groups, expect badness" << std::endl; + else + { + --cache.group_level; + + if(cache.group_level == 0) + cache.MarkAndSweep(); + } + + released = false; + } +} + +pkgDepCache::ActionGroup::~ActionGroup() +{ + release(); +} // DepCache::pkgDepCache - Constructors /*{{{*/ // --------------------------------------------------------------------- /* */ pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) : - Cache(pCache), PkgState(0), DepState(0) + group_level(0), Cache(pCache), PkgState(0), DepState(0) { delLocalPolicy = 0; LocalPolicy = Plcy; @@ -48,6 +84,10 @@ pkgDepCache::~pkgDepCache() /* This allocats the extension buffers and initializes them. */ bool pkgDepCache::Init(OpProgress *Prog) { + // Suppress mark updates during this operation (just in case) and + // run a mark operation when Init terminates. + ActionGroup actions(*this); + delete [] PkgState; delete [] DepState; PkgState = new StateCache[Head().PackageCount]; @@ -73,7 +113,7 @@ bool pkgDepCache::Init(OpProgress *Prog) // Find the proper cache slot StateCache &State = PkgState[I->ID]; State.iFlags = 0; - + // Figure out the install version State.CandidateVer = GetCandidateVer(I); State.InstallVer = I.CurrentVer(); @@ -95,11 +135,130 @@ bool pkgDepCache::Init(OpProgress *Prog) if(Prog != 0) Prog->Done(); - + return true; } /*}}}*/ +bool pkgDepCache::readStateFile(OpProgress *Prog) +{ + FileFd state_file; + string state = _config->FindDir("Dir::State") + "extended_states"; + if(FileExists(state)) { + state_file.Open(state, FileFd::ReadOnly); + int file_size = state_file.Size(); + if(Prog != NULL) + Prog->OverallProgress(0, file_size, 1, + _("Reading state information")); + + pkgTagFile tagfile(&state_file); + pkgTagSection section; + int amt=0; + while(tagfile.Step(section)) { + string pkgname = section.FindS("Package"); + pkgCache::PkgIterator pkg=Cache->FindPkg(pkgname); + // Silently ignore unknown packages and packages with no actual + // version. + if(!pkg.end() && !pkg.VersionList().end()) { + short reason = section.FindI("Auto-Installed", 0); + if(reason > 0) + PkgState[pkg->ID].Flags |= Flag::Auto; + if(_config->FindB("Debug::pkgAutoRemove",false)) + std::cout << "Auto-Installed : " << pkgname << std::endl; + amt+=section.size(); + if(Prog != NULL) + Prog->OverallProgress(amt, file_size, 1, + _("Reading state information")); + } + if(Prog != NULL) + Prog->OverallProgress(file_size, file_size, 1, + _("Reading state information")); + } + } + + return true; +} + +bool pkgDepCache::writeStateFile(OpProgress *prog) +{ + if(_config->FindB("Debug::pkgAutoRemove",false)) + std::clog << "pkgDepCache::writeStateFile()" << std::endl; + + FileFd StateFile; + string state = _config->FindDir("Dir::State") + "extended_states"; + + // if it does not exist, create a empty one + if(!FileExists(state)) + { + StateFile.Open(state, FileFd::WriteEmpty); + StateFile.Close(); + } + + // open it + if(!StateFile.Open(state, FileFd::ReadOnly)) + return _error->Error(_("Failed to open StateFile %s"), + state.c_str()); + + FILE *OutFile; + string outfile = state + ".tmp"; + if((OutFile = fopen(outfile.c_str(),"w")) == NULL) + return _error->Error(_("Failed to write temporary StateFile %s"), + outfile.c_str()); + + // first merge with the existing sections + pkgTagFile tagfile(&StateFile); + pkgTagSection section; + std::set<string> pkgs_seen; + const char *nullreorderlist[] = {0}; + while(tagfile.Step(section)) { + string pkgname = section.FindS("Package"); + // Silently ignore unknown packages and packages with no actual + // version. + pkgCache::PkgIterator pkg=Cache->FindPkg(pkgname); + if(pkg.end() || pkg.VersionList().end()) + continue; + bool oldAuto = section.FindI("Auto-Installed"); + bool newAuto = (PkgState[pkg->ID].Flags & Flag::Auto); + if(_config->FindB("Debug::pkgAutoRemove",false)) + std::clog << "Update exisiting AutoInstall info: " + << pkg.Name() << std::endl; + TFRewriteData rewrite[2]; + rewrite[0].Tag = "Auto-Installed"; + rewrite[0].Rewrite = newAuto ? "1" : "0"; + rewrite[0].NewTag = 0; + rewrite[1].Tag = 0; + TFRewrite(OutFile, section, nullreorderlist, rewrite); + fprintf(OutFile,"\n"); + pkgs_seen.insert(pkgname); + } + + // then write the ones we have not seen yet + std::ostringstream ostr; + for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); pkg++) { + if(PkgState[pkg->ID].Flags & Flag::Auto) { + if (pkgs_seen.find(pkg.Name()) != pkgs_seen.end()) { + if(_config->FindB("Debug::pkgAutoRemove",false)) + std::clog << "Skipping already written " << pkg.Name() << std::endl; + continue; + } + if(_config->FindB("Debug::pkgAutoRemove",false)) + std::clog << "Writing new AutoInstall: " + << pkg.Name() << std::endl; + ostr.str(string("")); + ostr << "Package: " << pkg.Name() + << "\nAuto-Installed: 1\n\n"; + fprintf(OutFile,ostr.str().c_str()); + fprintf(OutFile,"\n"); + } + } + fclose(OutFile); + + // move the outfile over the real file + rename(outfile.c_str(), state.c_str()); + + return true; +} + // DepCache::CheckDep - Checks a single dependency /*{{{*/ // --------------------------------------------------------------------- /* This first checks the dependency against the main target package and @@ -453,12 +612,14 @@ void pkgDepCache::Update(OpProgress *Prog) if (Prog != 0) Prog->Progress(Done); + + readStateFile(Prog); } /*}}}*/ // DepCache::Update - Update the deps list of a package /*{{{*/ // --------------------------------------------------------------------- /* This is a helper for update that only does the dep portion of the scan. - It is mainly ment to scan reverse dependencies. */ + It is mainly meant to scan reverse dependencies. */ void pkgDepCache::Update(DepIterator D) { // Update the reverse deps @@ -510,7 +671,7 @@ void pkgDepCache::Update(PkgIterator const &Pkg) // DepCache::MarkKeep - Put the package in the keep state /*{{{*/ // --------------------------------------------------------------------- /* */ -void pkgDepCache::MarkKeep(PkgIterator const &Pkg,bool Soft) +void pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser) { // Simplifies other routines. if (Pkg.end() == true) @@ -522,6 +683,9 @@ void pkgDepCache::MarkKeep(PkgIterator const &Pkg,bool Soft) Pkg.CurrentVer().Downloadable() == false) return; + /** \todo Can this be moved later in the method? */ + ActionGroup group(*this); + /* We changed the soft state all the time so the UI is a bit nicer to use */ StateCache &P = PkgState[Pkg->ID]; @@ -538,7 +702,8 @@ void pkgDepCache::MarkKeep(PkgIterator const &Pkg,bool Soft) if (Pkg->VersionList == 0) return; - P.Flags &= ~Flag::Auto; + if(FromUser && !P.Marked) + P.Flags &= ~Flag::Auto; RemoveSizes(Pkg); RemoveStates(Pkg); @@ -564,6 +729,8 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge) if (Pkg.end() == true) return; + ActionGroup group(*this); + // Check that it is not already marked for delete StateCache &P = PkgState[Pkg->ID]; P.iFlags &= ~(AutoKept | Purge); @@ -586,7 +753,6 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge) else P.Mode = ModeDelete; P.InstallVer = 0; - P.Flags &= Flag::Auto; AddStates(Pkg); Update(Pkg); @@ -597,7 +763,7 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge) // --------------------------------------------------------------------- /* */ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, - unsigned long Depth) + unsigned long Depth, bool FromUser) { if (Depth > 100) return; @@ -606,6 +772,8 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, if (Pkg.end() == true) return; + ActionGroup group(*this); + /* Check that it is not already marked for install and that it can be installed */ StateCache &P = PkgState[Pkg->ID]; @@ -614,7 +782,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, P.CandidateVer == (Version *)Pkg.CurrentVer())) { if (P.CandidateVer == (Version *)Pkg.CurrentVer() && P.InstallVer == 0) - MarkKeep(Pkg); + MarkKeep(Pkg, false, FromUser); return; } @@ -634,7 +802,20 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, P.Mode = ModeInstall; P.InstallVer = P.CandidateVer; - P.Flags &= ~Flag::Auto; + + if(FromUser) + { + // Set it to manual if it's a new install or cancelling the + // removal of a garbage package. + if(P.Status == 2 || (!Pkg.CurrentVer().end() && !P.Marked)) + P.Flags &= ~Flag::Auto; + } + else + { + // Set it to auto if this is a new install. + if(P.Status == 2) + P.Flags |= Flag::Auto; + } if (P.CandidateVer == (Version *)Pkg.CurrentVer()) P.Mode = ModeKeep; @@ -711,19 +892,14 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, } } - if (InstPkg.end() == false) + if (InstPkg.end() == false) { if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true) std::clog << "Installing " << InstPkg.Name() << " as dep of " << Pkg.Name() << std::endl; - MarkInstall(InstPkg,true,Depth + 1); - - // Set the autoflag, after MarkInstall because MarkInstall unsets it - if (P->CurrentVer == 0) - PkgState[InstPkg->ID].Flags |= Flag::Auto; + MarkInstall(InstPkg, true, Depth + 1, false); } - continue; } @@ -737,7 +913,6 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, PkgIterator Pkg = Ver.ParentPkg(); MarkDelete(Pkg); - PkgState[Pkg->ID].Flags |= Flag::Auto; } continue; } @@ -749,6 +924,8 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, /* */ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) { + ActionGroup group(*this); + RemoveSizes(Pkg); RemoveStates(Pkg); @@ -767,9 +944,11 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) /* */ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer) { + ActionGroup group(*this); + pkgCache::PkgIterator Pkg = TargetVer.ParentPkg(); StateCache &P = PkgState[Pkg->ID]; - + RemoveSizes(Pkg); RemoveStates(Pkg); @@ -782,6 +961,18 @@ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer) Update(Pkg); AddSizes(Pkg); } + +void pkgDepCache::MarkAuto(const PkgIterator &Pkg, bool Auto) +{ + StateCache &state = PkgState[Pkg->ID]; + + ActionGroup group(*this); + + if(Auto) + state.Flags |= Flag::Auto; + else + state.Flags &= ~Flag::Auto; +} /*}}}*/ // StateCache::Update - Compute the various static display things /*{{{*/ // --------------------------------------------------------------------- @@ -872,3 +1063,216 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep) return Dep.IsCritical(); } /*}}}*/ + +pkgDepCache::DefaultRootSetFunc::DefaultRootSetFunc() + : constructedSuccessfully(false) +{ + Configuration::Item const *Opts; + Opts = _config->Tree("APT::NeverAutoRemove"); + if (Opts != 0 && Opts->Child != 0) + { + Opts = Opts->Child; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Value.empty() == true) + continue; + + regex_t *p = new regex_t; + if(regcomp(p,Opts->Value.c_str(), + REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0) + { + regfree(p); + delete p; + _error->Error("Regex compilation error for APT::NeverAutoRemove"); + return; + } + + rootSetRegexp.push_back(p); + } + } + + constructedSuccessfully = true; +} + +pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc() +{ + for(unsigned int i = 0; i < rootSetRegexp.size(); i++) + { + regfree(rootSetRegexp[i]); + delete rootSetRegexp[i]; + } +} + + +bool pkgDepCache::DefaultRootSetFunc::InRootSet(const pkgCache::PkgIterator &pkg) +{ + for(unsigned int i = 0; i < rootSetRegexp.size(); i++) + if (regexec(rootSetRegexp[i], pkg.Name(), 0, 0, 0) == 0) + return true; + + return false; +} + +pkgDepCache::InRootSetFunc *pkgDepCache::GetRootSetFunc() +{ + DefaultRootSetFunc *f = new DefaultRootSetFunc; + if(f->wasConstructedSuccessfully()) + return f; + else + { + delete f; + return NULL; + } +} + +bool pkgDepCache::MarkFollowsRecommends() +{ + return _config->FindB("APT::AutoRemove::RecommendsImportant", true); +} + +bool pkgDepCache::MarkFollowsSuggests() +{ + return _config->FindB("APT::AutoRemove::SuggestsImportant", false); +} + +// the main mark algorithm +bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc) +{ + bool follow_recommends; + bool follow_suggests; + + // init the states + for(PkgIterator p = PkgBegin(); !p.end(); ++p) + { + PkgState[p->ID].Marked = false; + PkgState[p->ID].Garbage = false; + + // debug output + if(_config->FindB("Debug::pkgAutoRemove",false) + && PkgState[p->ID].Flags & Flag::Auto) + std::clog << "AutoDep: " << p.Name() << std::endl; + } + + // init vars + follow_recommends = MarkFollowsRecommends(); + follow_suggests = MarkFollowsSuggests(); + + + + // do the mark part, this is the core bit of the algorithm + for(PkgIterator p = PkgBegin(); !p.end(); ++p) + { + if(!(PkgState[p->ID].Flags & Flag::Auto) || + (p->Flags & Flag::Essential) || + userFunc.InRootSet(p)) + + { + // the package is installed (and set to keep) + if(PkgState[p->ID].Keep() && !p.CurrentVer().end()) + MarkPackage(p, p.CurrentVer(), + follow_recommends, follow_suggests); + // the package is to be installed + else if(PkgState[p->ID].Install()) + MarkPackage(p, PkgState[p->ID].InstVerIter(*this), + follow_recommends, follow_suggests); + } + } + + return true; +} + +// mark a single package in Mark-and-Sweep +void pkgDepCache::MarkPackage(const pkgCache::PkgIterator &pkg, + const pkgCache::VerIterator &ver, + bool follow_recommends, + bool follow_suggests) +{ + pkgDepCache::StateCache &state = PkgState[pkg->ID]; + VerIterator candver = state.CandidateVerIter(*this); + VerIterator instver = state.InstVerIter(*this); + +#if 0 + // If a package was garbage-collected but is now being marked, we + // should re-select it + // For cases when a pkg is set to upgrade and this trigger the + // removal of a no-longer used dependency. if the pkg is set to + // keep again later it will result in broken deps + if(state.Delete() && state.RemoveReason = Unused) + { + if(ver==candver) + mark_install(pkg, false, false, NULL); + else if(ver==pkg.CurrentVer()) + MarkKeep(pkg, false, false); + + instver=state.InstVerIter(*this); + } +#endif + + // Ignore versions other than the InstVer, and ignore packages + // that are already going to be removed or just left uninstalled. + if(!(ver == instver && !instver.end())) + return; + + // if we are marked already we are done + if(state.Marked) + return; + + //std::cout << "Setting Marked for: " << pkg.Name() << std::endl; + state.Marked=true; + + if(!ver.end()) + { + for(DepIterator d = ver.DependsList(); !d.end(); ++d) + { + if(d->Type == Dep::Depends || + d->Type == Dep::PreDepends || + (follow_recommends && + d->Type == Dep::Recommends) || + (follow_suggests && + d->Type == Dep::Suggests)) + { + // Try all versions of this package. + for(VerIterator V = d.TargetPkg().VersionList(); + !V.end(); ++V) + { + if(_system->VS->CheckDep(V.VerStr(), d->CompareOp, d.TargetVer())) + { + MarkPackage(V.ParentPkg(), V, + follow_recommends, follow_suggests); + } + } + // Now try virtual packages + for(PrvIterator prv=d.TargetPkg().ProvidesList(); + !prv.end(); ++prv) + { + if(_system->VS->CheckDep(prv.ProvideVersion(), d->CompareOp, + d.TargetVer())) + { + MarkPackage(prv.OwnerPkg(), prv.OwnerVer(), + follow_recommends, follow_suggests); + } + } + } + } + } +} + +bool pkgDepCache::Sweep() +{ + // do the sweep + for(PkgIterator p=PkgBegin(); !p.end(); ++p) + { + StateCache &state=PkgState[p->ID]; + + // if it is not marked and it is installed, it's garbage + if(!state.Marked && (!p.CurrentVer().end() || state.Install()) && + !state.Delete()) + { + state.Garbage=true; + if(_config->FindB("Debug::pkgAutoRemove",false)) + std::cout << "Garbage: " << p.Name() << std::endl; + } + } + + return true; +} diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 6d51920e9..fd935c268 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -1,4 +1,4 @@ -// -*- mode: cpp; mode: fold -*- +// -*- mode: c++; mode: fold -*- // Description /*{{{*/ // $Id: depcache.h,v 1.14 2001/02/20 07:03:17 jgg Exp $ /* ###################################################################### @@ -45,9 +45,71 @@ #include <apt-pkg/pkgcache.h> #include <apt-pkg/progress.h> +#include <regex.h> + +#include <vector> + class pkgDepCache : protected pkgCache::Namespace { public: + + /** \brief An arbitrary predicate on packages. */ + class InRootSetFunc + { + public: + virtual bool InRootSet(const pkgCache::PkgIterator &pkg) {return false;}; + virtual ~InRootSetFunc() {}; + }; + + private: + /** \brief Mark a single package and all its unmarked important + * dependencies during mark-and-sweep. + * + * Recursively invokes itself to mark all dependencies of the + * package. + * + * \param pkg The package to mark. + * + * \param ver The version of the package that is to be marked. + * + * \param follow_recommends If \b true, recommendations of the + * package will be recursively marked. + * + * \param follow_suggests If \b true, suggestions of the package + * will be recursively marked. + */ + void MarkPackage(const pkgCache::PkgIterator &pkg, + const pkgCache::VerIterator &ver, + bool follow_recommends, + bool follow_suggests); + + /** \brief Update the Marked field of all packages. + * + * Each package's StateCache::Marked field will be set to \b true + * if and only if it can be reached from the root set. By + * default, the root set consists of the set of manually installed + * or essential packages, but it can be extended using the + * parameter #rootFunc. + * + * \param rootFunc A callback that can be used to add extra + * packages to the root set. + * + * \return \b false if an error occured. + */ + bool MarkRequired(InRootSetFunc &rootFunc); + + /** \brief Set the StateCache::Garbage flag on all packages that + * should be removed. + * + * Packages that were not marked by the last call to #MarkRequired + * are tested to see whether they are actually garbage. If so, + * they are marked as such. + * + * \return \b false if an error occured. + */ + bool Sweep(); + + public: // These flags are used in DepState enum DepFlags {DepNow = (1 << 0),DepInstall = (1 << 1),DepCVer = (1 << 2), @@ -63,6 +125,84 @@ class pkgDepCache : protected pkgCache::Namespace enum VersionTypes {NowVersion, InstallVersion, CandidateVersion}; enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2}; + + /** \brief Represents an active action group. + * + * An action group is a group of actions that are currently being + * performed. While an active group is active, certain routine + * clean-up actions that would normally be performed after every + * cache operation are delayed until the action group is + * completed. This is necessary primarily to avoid inefficiencies + * when modifying a large number of packages at once. + * + * This class represents an active action group. Creating an + * instance will create an action group; destroying one will + * destroy the corresponding action group. + * + * The following operations are suppressed by this class: + * + * - Keeping the Marked and Garbage flags up to date. + * + * \note This can be used in the future to easily accumulate + * atomic actions for undo or to display "what apt did anyway"; + * e.g., change the counter of how many action groups are active + * to a std::set of pointers to them and use those to store + * information about what happened in a group in the group. + */ + class ActionGroup + { + pkgDepCache &cache; + + bool released; + + /** Action groups are noncopyable. */ + ActionGroup(const ActionGroup &other); + public: + /** \brief Create a new ActionGroup. + * + * \param cache The cache that this ActionGroup should + * manipulate. + * + * As long as this object exists, no automatic cleanup + * operations will be undertaken. + */ + ActionGroup(pkgDepCache &cache); + + /** \brief Clean up the action group before it is destroyed. + * + * If it is destroyed later, no second cleanup wil be run. + */ + void release(); + + /** \brief Destroy the action group. + * + * If this is the last action group, the automatic cache + * cleanup operations will be undertaken. + */ + ~ActionGroup(); + }; + + /** \brief Returns \b true for packages matching a regular + * expression in APT::NeverAutoRemove. + */ + class DefaultRootSetFunc : public InRootSetFunc + { + std::vector<regex_t *> rootSetRegexp; + bool constructedSuccessfully; + + public: + DefaultRootSetFunc(); + ~DefaultRootSetFunc(); + + /** \return \b true if the class initialized successfully, \b + * false otherwise. Used to avoid throwing an exception, since + * APT classes generally don't. + */ + bool wasConstructedSuccessfully() const { return constructedSuccessfully; } + + bool InRootSet(const pkgCache::PkgIterator &pkg); + }; + struct StateCache { // Epoch stripped text versions of the two version fields @@ -79,6 +219,17 @@ class pkgDepCache : protected pkgCache::Namespace unsigned short Flags; unsigned short iFlags; // Internal flags + /** \brief \b true if this package can be reached from the root set. */ + bool Marked; + + /** \brief \b true if this package is unused and should be removed. + * + * This differs from !#Marked, because it is possible that some + * unreachable packages will be protected from becoming + * garbage. + */ + bool Garbage; + // Various tree indicators signed char Status; // -1,0,1,2 unsigned char Mode; // ModeList @@ -119,6 +270,14 @@ class pkgDepCache : protected pkgCache::Namespace virtual ~Policy() {}; }; + + private: + /** The number of open "action groups"; certain post-action + * operations are suppressed if this number is > 0. + */ + int group_level; + + friend class ActionGroup; protected: @@ -182,16 +341,68 @@ class pkgDepCache : protected pkgCache::Namespace inline StateCache &operator [](PkgIterator const &I) {return PkgState[I->ID];}; inline unsigned char &operator [](DepIterator const &I) {return DepState[I->ID];}; - // Manipulators - void MarkKeep(PkgIterator const &Pkg,bool Soft = false); + /** \return A function identifying packages in the root set other + * than manually installed packages and essential packages, or \b + * NULL if an error occurs. + * + * \todo Is this the best place for this function? Perhaps the + * settings for mark-and-sweep should be stored in a single + * external class? + */ + virtual InRootSetFunc *GetRootSetFunc(); + + /** \return \b true if the garbage collector should follow recommendations. + */ + virtual bool MarkFollowsRecommends(); + + /** \return \b true if the garbage collector should follow suggestions. + */ + virtual bool MarkFollowsSuggests(); + + /** \brief Update the Marked and Garbage fields of all packages. + * + * This routine is implicitly invoked after all state manipulators + * and when an ActionGroup is destroyed. It invokes #MarkRequired + * and #Sweep to do its dirty work. + * + * \param rootFunc A predicate that returns \b true for packages + * that should be added to the root set. + */ + bool MarkAndSweep(InRootSetFunc &rootFunc) + { + return MarkRequired(rootFunc) && Sweep(); + } + + bool MarkAndSweep() + { + std::auto_ptr<InRootSetFunc> f(GetRootSetFunc()); + if(f.get() != NULL) + return MarkAndSweep(*f.get()); + else + return false; + } + + /** \name State Manipulators + */ + // @{ + void MarkKeep(PkgIterator const &Pkg, bool Soft = false, + bool FromUser = true); void MarkDelete(PkgIterator const &Pkg,bool Purge = false); void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true, - unsigned long Depth = 0); + unsigned long Depth = 0, bool FromUser = true); void SetReInstall(PkgIterator const &Pkg,bool To); void SetCandidateVersion(VerIterator TargetVer); + + /** Set the "is automatically installed" flag of Pkg. */ + void MarkAuto(const PkgIterator &Pkg, bool Auto); + // @} // This is for debuging void Update(OpProgress *Prog = 0); + + // read persistent states + bool readStateFile(OpProgress *prog); + bool writeStateFile(OpProgress *prog); // Size queries inline double UsrSize() {return iUsrSize;}; diff --git a/apt-pkg/init.h b/apt-pkg/init.h index 8255b406a..0c6260c2f 100644 --- a/apt-pkg/init.h +++ b/apt-pkg/init.h @@ -18,7 +18,7 @@ // See the makefile #define APT_PKG_MAJOR 3 -#define APT_PKG_MINOR 11 +#define APT_PKG_MINOR 50 #define APT_PKG_RELEASE 0 extern const char *pkgVersion; diff --git a/apt-pkg/makefile b/apt-pkg/makefile index 7e5feae53..d03a19182 100644 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@ -13,7 +13,7 @@ include ../buildlib/defaults.mak # methods/makefile - FIXME LIBRARY=apt-pkg LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER) -MAJOR=3.11 +MAJOR=3.50 MINOR=0 SLIBS=$(PTHREADLIB) $(INTLLIBS) APT_DOMAIN:=libapt-pkg$(MAJOR) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 4b3dd8be2..b0dd43629 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -106,7 +106,7 @@ bool pkgPackageManager::FixMissing() // Okay, this file is missing and we need it. Mark it for keep Bad = true; - Cache.MarkKeep(I); + Cache.MarkKeep(I, false, false); } // We have to empty the list otherwise it will not have the new changes @@ -631,14 +631,11 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() // --------------------------------------------------------------------- /* This uses the filenames in FileNames and the information in the DepCache to perform the installation of packages.*/ -pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int status_fd) +pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int statusFd) { - OrderResult Res = OrderInstall(); - if(Debug) - std::clog << "OrderInstall() returned: " << Res << std::endl; - if (Res != Failed) - if (Go(status_fd) == false) - return Failed; - return Res; + if(DoInstallPreFork() == Failed) + return Failed; + + return DoInstallPostFork(statusFd); } /*}}}*/ diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index f64637d03..48f53576c 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -28,7 +28,9 @@ #endif #include <string> +#include <iostream> #include <apt-pkg/pkgcache.h> +#include <apt-pkg/depcache.h> using std::string; @@ -70,13 +72,39 @@ class pkgPackageManager : protected pkgCache::Namespace virtual bool Remove(PkgIterator /*Pkg*/,bool /*Purge*/=false) {return false;}; virtual bool Go(int statusFd=-1) {return true;}; virtual void Reset() {}; - + + // the result of the operation + OrderResult Res; + public: // Main action members bool GetArchives(pkgAcquire *Owner,pkgSourceList *Sources, pkgRecords *Recs); - OrderResult DoInstall(int statusFd=-1); + + // Do the installation + OrderResult DoInstall(int statusFd=-1); + + // stuff that needs to be done before the fork() of a library that + // uses apt + OrderResult DoInstallPreFork() { + Res = OrderInstall(); + return Res; + }; + + // stuff that needs to be done after the fork + OrderResult DoInstallPostFork(int statusFd=-1) { + bool goResult = Go(statusFd); + if(goResult == false) + return Failed; + + // if all was fine update the state file + if(Res == Completed) { + Cache.writeStateFile(NULL); + } + return Res; + }; + bool FixMissing(); pkgPackageManager(pkgDepCache *Cache); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index de854bee5..4ac4d1d1c 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -26,6 +26,8 @@ #include <apt-pkg/sptr.h> #include <apt-pkg/pkgsystem.h> +#include <apt-pkg/tagfile.h> + #include <apti18n.h> #include <vector> @@ -571,8 +573,10 @@ static bool CheckValidity(const string &CacheFile, FileIterator Start, if ((*Start)->Exists() == false) { +#if 0 // mvo: we no longer give a message here (Default Sources spec) _error->WarningE("stat",_("Couldn't stat source package list %s"), (*Start)->Describe().c_str()); +#endif continue; } diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d4a6bee32..a723174ab 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -60,6 +60,7 @@ #include <errno.h> #include <regex.h> #include <sys/wait.h> +#include <sstream> /*}}}*/ using namespace std; @@ -995,7 +996,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, cerr << _("Unable to correct missing packages.") << endl; return _error->Error(_("Aborting install.")); } - + _system->UnLock(); int status_fd = _config->FindI("APT::Status-Fd",-1); pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd); @@ -1355,20 +1356,29 @@ bool DoUpdate(CommandLine &CmdL) return false; bool Failed = false; + bool TransientNetworkFailure = false; for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++) { if ((*I)->Status == pkgAcquire::Item::StatDone) continue; (*I)->Finished(); - + fprintf(stderr,_("Failed to fetch %s %s\n"),(*I)->DescURI().c_str(), (*I)->ErrorText.c_str()); + + if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError) + { + TransientNetworkFailure = true; + continue; + } + Failed = true; } // Clean out any old list files - if (!Failed && _config->FindB("APT::Get::List-Cleanup",true) == true) + if (!TransientNetworkFailure && + _config->FindB("APT::Get::List-Cleanup",true) == true) { if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false || Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false) @@ -1380,12 +1390,60 @@ bool DoUpdate(CommandLine &CmdL) if (Cache.BuildCaches() == false) return false; - if (Failed == true) + if (TransientNetworkFailure == true) + _error->Warning(_("Some index files failed to download, they have been ignored, or old ones used instead.")); + else if (Failed == true) return _error->Error(_("Some index files failed to download, they have been ignored, or old ones used instead.")); - + return true; } /*}}}*/ +// DoAutomaticRemove - Remove all automatic unused packages /*{{{*/ +// --------------------------------------------------------------------- +/* Remove unused automatic packages */ +bool DoAutomaticRemove(CacheFile &Cache) +{ + if(_config->FindI("Debug::pkgAutoRemove",false)) + std::cout << "DoAutomaticRemove()" << std::endl; + + if (_config->FindB("APT::Get::Remove",true) == false) + return _error->Error(_("We are not supposed to delete stuff, can't " + "start AutoRemover")); + + { + pkgDepCache::ActionGroup group(*Cache); + + // look over the cache to see what can be removed + for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg) + { + if (Cache[Pkg].Garbage) + { + if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install()) + fprintf(stdout,"We could delete %s\n", Pkg.Name()); + + if(Pkg.CurrentVer() != 0 && Pkg->CurrentState != pkgCache::State::ConfigFiles) + Cache->MarkDelete(Pkg, _config->FindB("APT::Get::Purge", false)); + else + Cache->MarkKeep(Pkg, false, false); + } + } + } + + // Now see if we destroyed anything + if (Cache->BrokenCount() != 0) + { + c1out << _("Hmm, seems like the AutoRemover destroyed something which really\n" + "shouldn't happen. Please file a bug report against apt.") << endl; + c1out << endl; + c1out << _("The following information may help to resolve the situation:") << endl; + c1out << endl; + ShowBroken(c1out,Cache,false); + + return _error->Error(_("Internal Error, AutoRemover broke stuff")); + } + return true; +} + // DoUpgrade - Upgrade all packages /*{{{*/ // --------------------------------------------------------------------- /* Upgrade all packages without installing new packages or erasing old @@ -1428,155 +1486,168 @@ bool DoInstall(CommandLine &CmdL) bool DefRemove = false; if (strcasecmp(CmdL.FileList[0],"remove") == 0) DefRemove = true; + else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0) + { + _config->Set("APT::Get::AutomaticRemove", "true"); + DefRemove = true; + } - for (const char **I = CmdL.FileList + 1; *I != 0; I++) + // new scope for the ActionGroup { - // Duplicate the string - unsigned int Length = strlen(*I); - char S[300]; - if (Length >= sizeof(S)) - continue; - strcpy(S,*I); - - // See if we are removing and special indicators.. - bool Remove = DefRemove; - char *VerTag = 0; - bool VerIsRel = false; - while (Cache->FindPkg(S).end() == true) + pkgDepCache::ActionGroup group(Cache); + for (const char **I = CmdL.FileList + 1; *I != 0; I++) { - // Handle an optional end tag indicating what to do - if (Length >= 1 && S[Length - 1] == '-') - { - Remove = true; - S[--Length] = 0; + // Duplicate the string + unsigned int Length = strlen(*I); + char S[300]; + if (Length >= sizeof(S)) continue; - } - - if (Length >= 1 && S[Length - 1] == '+') + strcpy(S,*I); + + // See if we are removing and special indicators.. + bool Remove = DefRemove; + char *VerTag = 0; + bool VerIsRel = false; + while (Cache->FindPkg(S).end() == true) { - Remove = false; - S[--Length] = 0; - continue; - } + // Handle an optional end tag indicating what to do + if (Length >= 1 && S[Length - 1] == '-') + { + Remove = true; + S[--Length] = 0; + continue; + } - char *Slash = strchr(S,'='); - if (Slash != 0) - { - VerIsRel = false; - *Slash = 0; - VerTag = Slash + 1; - } + if (Length >= 1 && S[Length - 1] == '+') + { + Remove = false; + S[--Length] = 0; + continue; + } - Slash = strchr(S,'/'); - if (Slash != 0) - { - VerIsRel = true; - *Slash = 0; - VerTag = Slash + 1; - } + char *Slash = strchr(S,'='); + if (Slash != 0) + { + VerIsRel = false; + *Slash = 0; + VerTag = Slash + 1; + } - break; - } - - // Locate the package - pkgCache::PkgIterator Pkg = Cache->FindPkg(S); - Packages++; - if (Pkg.end() == true) - { - // Check if the name is a regex - const char *I; - for (I = S; *I != 0; I++) - if (*I == '?' || *I == '*' || *I == '|' || - *I == '[' || *I == '^' || *I == '$') - break; - if (*I == 0) - return _error->Error(_("Couldn't find package %s"),S); - - // Regexs must always be confirmed - ExpectedInst += 1000; + Slash = strchr(S,'/'); + if (Slash != 0) + { + VerIsRel = true; + *Slash = 0; + VerTag = Slash + 1; + } - // Compile the regex pattern - regex_t Pattern; - int Res; - if ((Res = regcomp(&Pattern,S,REG_EXTENDED | REG_ICASE | - REG_NOSUB)) != 0) - { - char Error[300]; - regerror(Res,&Pattern,Error,sizeof(Error)); - return _error->Error(_("Regex compilation error - %s"),Error); + break; } - - // Run over the matches - bool Hit = false; - for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++) + + // Locate the package + pkgCache::PkgIterator Pkg = Cache->FindPkg(S); + Packages++; + if (Pkg.end() == true) { - if (regexec(&Pattern,Pkg.Name(),0,0,0) != 0) - continue; + // Check if the name is a regex + const char *I; + for (I = S; *I != 0; I++) + if (*I == '?' || *I == '*' || *I == '|' || + *I == '[' || *I == '^' || *I == '$') + break; + if (*I == 0) + return _error->Error(_("Couldn't find package %s"),S); + + // Regexs must always be confirmed + ExpectedInst += 1000; + + // Compile the regex pattern + regex_t Pattern; + int Res; + if ((Res = regcomp(&Pattern,S,REG_EXTENDED | REG_ICASE | + REG_NOSUB)) != 0) + { + char Error[300]; + regerror(Res,&Pattern,Error,sizeof(Error)); + return _error->Error(_("Regex compilation error - %s"),Error); + } + + // Run over the matches + bool Hit = false; + for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++) + { + if (regexec(&Pattern,Pkg.Name(),0,0,0) != 0) + continue; - ioprintf(c1out,_("Note, selecting %s for regex '%s'\n"), - Pkg.Name(),S); + ioprintf(c1out,_("Note, selecting %s for regex '%s'\n"), + Pkg.Name(),S); + if (VerTag != 0) + if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false) + return false; + + Hit |= TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix, + ExpectedInst,false); + } + regfree(&Pattern); + + if (Hit == false) + return _error->Error(_("Couldn't find package %s"),S); + } + else + { if (VerTag != 0) if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false) return false; - - Hit |= TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix, - ExpectedInst,false); - } - regfree(&Pattern); - - if (Hit == false) - return _error->Error(_("Couldn't find package %s"),S); - } - else - { - if (VerTag != 0) - if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false) + if (TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,ExpectedInst) == false) return false; - if (TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,ExpectedInst) == false) - return false; - } - } + } + } - /* If we are in the Broken fixing mode we do not attempt to fix the - problems. This is if the user invoked install without -f and gave - packages */ - if (BrokenFix == true && Cache->BrokenCount() != 0) - { - c1out << _("You might want to run `apt-get -f install' to correct these:") << endl; - ShowBroken(c1out,Cache,false); + /* If we are in the Broken fixing mode we do not attempt to fix the + problems. This is if the user invoked install without -f and gave + packages */ + if (BrokenFix == true && Cache->BrokenCount() != 0) + { + c1out << _("You might want to run `apt-get -f install' to correct these:") << endl; + ShowBroken(c1out,Cache,false); - return _error->Error(_("Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).")); - } + return _error->Error(_("Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).")); + } - // Call the scored problem resolver - Fix.InstallProtect(); - if (Fix.Resolve(true) == false) - _error->Discard(); + // Call the scored problem resolver + Fix.InstallProtect(); + if (Fix.Resolve(true) == false) + _error->Discard(); - // Now we check the state of the packages, - if (Cache->BrokenCount() != 0) - { - c1out << - _("Some packages could not be installed. This may mean that you have\n" - "requested an impossible situation or if you are using the unstable\n" - "distribution that some required packages have not yet been created\n" - "or been moved out of Incoming.") << endl; - if (Packages == 1) + // Now we check the state of the packages, + if (Cache->BrokenCount() != 0) { - c1out << endl; c1out << - _("Since you only requested a single operation it is extremely likely that\n" - "the package is simply not installable and a bug report against\n" - "that package should be filed.") << endl; - } + _("Some packages could not be installed. This may mean that you have\n" + "requested an impossible situation or if you are using the unstable\n" + "distribution that some required packages have not yet been created\n" + "or been moved out of Incoming.") << endl; + if (Packages == 1) + { + c1out << endl; + c1out << + _("Since you only requested a single operation it is extremely likely that\n" + "the package is simply not installable and a bug report against\n" + "that package should be filed.") << endl; + } + + c1out << _("The following information may help to resolve the situation:") << endl; + c1out << endl; + ShowBroken(c1out,Cache,false); + return _error->Error(_("Broken packages")); + } + } + if (_config->FindB("APT::Get::AutomaticRemove")) { + if (!DoAutomaticRemove(Cache)) + return false; + } - c1out << _("The following information may help to resolve the situation:") << endl; - c1out << endl; - ShowBroken(c1out,Cache,false); - return _error->Error(_("Broken packages")); - } - /* Print out a list of packages that are going to be installed extra to what the user asked */ if (Cache->InstCount() != ExpectedInst) @@ -1596,8 +1667,8 @@ bool DoInstall(CommandLine &CmdL) if (*J == 0) { List += string(I.Name()) + " "; - VersionsList += string(Cache[I].CandVersion) + "\n"; - } + VersionsList += string(Cache[I].CandVersion) + "\n"; + } } ShowList(c1out,_("The following extra packages will be installed:"),List,VersionsList); @@ -1714,6 +1785,8 @@ bool DoDSelectUpgrade(CommandLine &CmdL) if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) return false; + pkgDepCache::ActionGroup group(Cache); + // Install everything with the install flag set pkgCache::PkgIterator I = Cache->PkgBegin(); for (;I.end() != true; I++) @@ -2466,6 +2539,7 @@ void GetInitialize() _config->Set("APT::Get::Fix-Broken",false); _config->Set("APT::Get::Force-Yes",false); _config->Set("APT::Get::List-Cleanup",true); + _config->Set("APT::Get::AutomaticRemove",false); } /*}}}*/ // SigWinch - Window size change signal handler /*{{{*/ @@ -2521,6 +2595,7 @@ int main(int argc,const char *argv[]) {0,"remove","APT::Get::Remove",0}, {0,"only-source","APT::Get::Only-Source",0}, {0,"arch-only","APT::Get::Arch-Only",0}, + {0,"auto-remove","APT::Get::AutomaticRemove",0}, {0,"allow-unauthenticated","APT::Get::AllowUnauthenticated",0}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, @@ -2529,6 +2604,7 @@ int main(int argc,const char *argv[]) {"upgrade",&DoUpgrade}, {"install",&DoInstall}, {"remove",&DoInstall}, + {"autoremove",&DoInstall}, {"dist-upgrade",&DoDistUpgrade}, {"dselect-upgrade",&DoDSelectUpgrade}, {"build-dep",&DoBuildDep}, diff --git a/cmdline/apt-key b/cmdline/apt-key index 7460a24be..be2b19a1a 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -9,14 +9,14 @@ GPG_CMD="gpg --no-options --no-default-keyring --secret-keyring /etc/apt/secring GPG="$GPG_CMD --keyring /etc/apt/trusted.gpg" -ARCHIVE_KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg -REMOVED_KEYS=/usr/share/keyrings/debian-archive-removed-keys.gpg +ARCHIVE_KEYRING=/usr/share/keyrings/ubuntu-archive-keyring.gpg +REMOVED_KEYS=/usr/share/keyrings/ubuntu-archive-removed-keys.gpg update() { if [ ! -f $ARCHIVE_KEYRING ]; then echo >&2 "ERROR: Can't find the archive-keyring" - echo >&2 "Is the debian-archive-keyring package installed?" + echo >&2 "Is the ubuntu-keyring package installed?" exit 1 fi diff --git a/cmdline/apt-mark b/cmdline/apt-mark new file mode 100755 index 000000000..533ed8715 --- /dev/null +++ b/cmdline/apt-mark @@ -0,0 +1,63 @@ +#!/usr/bin/python + +from optparse import OptionParser + +try: + import apt_pkg +except ImportError: + print "Error importing apt_pkg, is python-apt installed?" + +import sys +import os.path + +actions = { "markauto" : 1, + "unmarkauto": 0 + } + +if __name__ == "__main__": + apt_pkg.init() + + # option parsing + parser = OptionParser() + parser.usage = "%prog [options] {markauto|unmarkauto} packages..." + parser.add_option("-f", "--file", action="store", type="string", + dest="filename", + help="read/write a different file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose", default=False, + help="print verbose status messages to stdout") + (options, args) = parser.parse_args() + if len(args) < 2: + parser.error("not enough argument") + + # get pkgs to change + if args[0] not in actions.keys(): + parser.error("first argument must be 'markauto' or 'unmarkauto'") + pkgs = args[1:] + action = actions[args[0]] + + # get the state-file + if not options.filename: + STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states" + else: + STATE_FILE=options.state_file + + # open the statefile + if os.path.exists(STATE_FILE): + tagfile = apt_pkg.ParseTagFile(open(STATE_FILE)) + outfile = open(STATE_FILE+".tmp","w") + while tagfile.Step(): + pkgname = tagfile.Section.get("Package") + autoInst = tagfile.Section.get("Auto-Installed") + if pkgname in pkgs: + if options.verbose: + print "changing %s to %s" % (pkgname,action) + newsec = apt_pkg.RewriteSection(tagfile.Section, + [], + [ ("Auto-Installed",str(action)) ] + ) + outfile.write(newsec+"\n") + else: + outfile.write(str(tagfile.Section)+"\n") + # all done, rename the tmpfile + os.rename(outfile.name, STATE_FILE) diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index 26dfa2530..b4cbf1c8a 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -14,6 +14,12 @@ # "APT::Periodic::AutocleanInterval" # - Do "apt-get autoclean" every n-days (0=disable) # +# "APT::Periodic::Unattended-Upgrade" +# - Run the "unattended-upgrade" security upgrade script +# every n-days (0=disabled) +# Requires the package "unattended-upgrades" and will write +# a log in /var/log/unattended-upgrades +# # "APT::Archives::MaxAge", # - Set maximum allowed age of a cache package file. If a cache # package file is older it is deleted (0=disable) @@ -148,6 +154,10 @@ eval $(apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists Downl AutocleanInterval=$DownloadUpgradeableInterval eval $(apt-config shell AutocleanInterval APT::Periodic::Autoclean) +UnattendedUpgradeInterval=0 +eval $(apt-config shell UnattendedUpgradeInterval APT::Periodic::Unattended-Upgrade) + + # laptop check, on_ac_power returns: # 0 (true) System is on mains power # 1 (false) System is not on mains power @@ -182,5 +192,11 @@ if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then update_stamp $AUTOCLEAN_STAMP fi +UPGRADE_STAMP=/var/lib/apt/periodic/upgrade-stamp +if check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then + unattended-upgrade + update_stamp $UPGRADE_STAMP +fi + # check cache size check_size_constraints diff --git a/debian/apt.postinst b/debian/apt.postinst index ae1801198..df0433057 100644 --- a/debian/apt.postinst +++ b/debian/apt.postinst @@ -17,7 +17,7 @@ case "$1" in configure) if ! test -f /etc/apt/trusted.gpg; then - cp /usr/share/apt/debian-archive.gpg /etc/apt/trusted.gpg + cp /usr/share/apt/ubuntu-archive.gpg /etc/apt/trusted.gpg fi ;; diff --git a/debian/changelog b/debian/changelog index 047cf908c..fb63f424b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +apt (0.6.45ubuntu1) edgy; urgency=low + + * merged with debian/unstable + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 1 Aug 2006 15:43:22 +0200 + apt (0.6.45) unstable; urgency=low * apt-pkg/contrib/sha256.cc: @@ -37,7 +43,38 @@ apt (0.6.45) unstable; urgency=low -- Michael Vogt <mvo@debian.org> Thu, 27 Jul 2006 00:52:05 +0200 -apt (0.6.44.2) unstable; urgency=low +apt (0.6.44.2ubuntu4) edgy; urgency=low + + * Make apt-get dselect-upgrade happy again + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 21 Jul 2006 11:03:02 +0200 + +apt (0.6.44.2ubuntu3) edgy; urgency=low + + * Close extended_states file after writing it. + + -- Colin Watson <cjwatson@ubuntu.com> Tue, 18 Jul 2006 00:12:13 +0100 + +apt (0.6.44.2ubuntu2) edgy; urgency=low + + * create a empty extended_states file if none exists already + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 4 Jul 2006 09:23:03 +0200 + +apt (0.6.44.2ubuntu1) edgy; urgency=low + + * merged with debian/unstable + * merged the "auto-mark" branch to support aptitude like + marking of automatically installed dependencies and added + "apt-get remove --auto-remove" to remove unused auto-installed + packages again + * changed library version from 3.11 to 3.50 to make it clearly + different from the debian version (we are ABI incompatible because + of the auto-mark patch) + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 3 Jul 2006 18:30:46 +0200 + +apt (0.6.44.2) unstable; urgency=low * apt-pkg/depcache.cc: - added Debug::pkgDepCache::AutoInstall (thanks to infinity) @@ -105,6 +142,26 @@ apt (0.6.44) unstable; urgency=low -- Michael Vogt <mvo@debian.org> Mon, 8 May 2006 22:28:53 +0200 +apt (0.6.43.3ubuntu3) dapper; urgency=low + + * methods/http.cc: + - fix the user-agent string + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 26 May 2006 18:09:32 +0200 + +apt (0.6.43.3ubuntu2) dapper; urgency=low + + * apt-pkg/deb/dpkgpm.cc: wording fixes (thanks to Matt Zimmerman) + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 18 Apr 2006 13:24:40 +0200 + +apt (0.6.43.3ubuntu1) dapper; urgency=low + + * apt-pkg/acquire.cc: don't show ETA if it is 0 or absurdely large in + the status-fd (ubuntu #28954) + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 28 Mar 2006 20:34:46 +0200 + apt (0.6.43.3) unstable; urgency=low * Merge bubulle@debian.org--2005/apt--main--0 up to patch-186: @@ -114,16 +171,46 @@ apt (0.6.43.3) unstable; urgency=low * pl.po: Completed to 512t. Closes: #349514 * sk.po: Completed to 512t. Closes: #349474 * gl.po: Completed to 512 strings Closes: #349407 + * vi.po: Completed to 512 strings * sv.po: Completed to 512 strings Closes: #349210 * ru.po: Completed to 512 strings Closes: #349154 * da.po: Completed to 512 strings Closes: #349084 * fr.po: Completed to 512 strings + * LINGUAS: Add Welsh + * *.po: Updated from sources (512 strings) * vi.po: Completed to 511 strings Closes: #348968 - * zh_CN.po: Completed to 512t. Closes: #353936 - * it.po: Completed to 512t. Closes: #352803 - * pt_BR.po: Completed to 512t. Closes: #352419 + * apt-pkg/deb/deblistparser.cc: + - don't explode on a DepCompareOp in a Provides line, but warn about + it and ignore it otherwise (thanks to James Troup for reporting it) + * cmdline/apt-get.cc: + - don't lock the lists directory in DoInstall, breaks --print-uri + (thanks to James Troup for reporting it) + * debian/apt.dirs: create /etc/apt/sources.list.d + * make apt-cache madison work without deb-src entries (#352583) + * cmdline/apt-get.cc: only run the list-cleaner if a update was + successfull + * apt-get update errors are only warnings nowdays + * be more careful with the signature file on network failures + + -- Michael Vogt <mvo@debian.org> Wed, 22 Feb 2006 10:13:04 +0100 + +apt (0.6.43.2ubuntu1) dapper; urgency=low + + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-182: + * ca.po: Completed to 512t. Closes: #351592 + * eu.po: Completed to 512t. Closes: #350483 + * ja.po: Completed to 512t. Closes: #349806 + * pl.po: Completed to 512t. Closes: #349514 + * sk.po: Completed to 512t. Closes: #349474 + * gl.po: Completed to 512 strings Closes: #349407 + * vi.po: Completed to 512 strings + * sv.po: Completed to 512 strings Closes: #349210 + * ru.po: Completed to 512 strings Closes: #349154 + * da.po: Completed to 512 strings Closes: #349084 + * fr.po: Completed to 512 strings * LINGUAS: Add Welsh * *.po: Updated from sources (512 strings) + * vi.po: Completed to 511 strings Closes: #348968 * apt-pkg/deb/deblistparser.cc: - don't explode on a DepCompareOp in a Provides line, but warn about it and ignore it otherwise (thanks to James Troup for reporting it) @@ -134,8 +221,10 @@ apt (0.6.43.3) unstable; urgency=low * make apt-cache madison work without deb-src entries (#352583) * cmdline/apt-get.cc: only run the list-cleaner if a update was successfull + * apt-get update errors are only warnings nowdays + * be more careful with the signature file on network failures - -- Michael Vogt <mvo@debian.org> Wed, 22 Feb 2006 10:13:04 +0100 + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 20 Feb 2006 22:27:48 +0100 apt (0.6.43.2) unstable; urgency=low @@ -160,8 +249,26 @@ apt (0.6.43.2) unstable; urgency=low -- Michael Vogt <mvo@debian.org> Thu, 19 Jan 2006 00:06:33 +0100 -apt (0.6.43.1) unstable; urgency=low +apt (0.6.43.1ubuntu1) dapper; urgency=low + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-159: + - en_GB.po, de.po: fix spaces errors in "Ign " translations + Closes: #347258 + - makefile: make update-po a pre-requisite of clean target so + that POT and PO files are always up-to-date + - sv.po: Completed to 511t. Closes: #346450 + - sk.po: Completed to 511t. Closes: #346369 + - fr.po: Completed to 511t + - *.po: Updated from sources (511 strings) + * add patch to fix http download corruption problem (thanks to + Petr Vandrovec, closes: #280844, #290694) + * added APT::Periodic::Unattended-Upgrade (requires the package + "unattended-upgrade") + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 10 Jan 2006 17:09:31 +0100 + +apt (0.6.43.1) unstable; urgency=low + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-148: * fr.po: Completed to 510 strings * it.po: Completed to 510t @@ -183,6 +290,19 @@ apt (0.6.43.1) unstable; urgency=low -- Michael Vogt <mvo@debian.org> Fri, 6 Jan 2006 01:17:08 +0100 +apt (0.6.43ubuntu2) dapper; urgency=low + + * merged some missing bits that wheren't merged by baz in the previous + upload (*grumble*) + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 8 Dec 2005 18:35:58 +0100 + +apt (0.6.43ubuntu1) dapper; urgency=low + + * merged with debian + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 25 Nov 2005 11:36:29 +0100 + apt (0.6.43) unstable; urgency=medium * Merge bubulle@debian.org--2005/apt--main--0 up to patch-132: @@ -203,6 +323,22 @@ apt (0.6.43) unstable; urgency=medium -- Michael Vogt <mvo@debian.org> Tue, 29 Nov 2005 00:17:07 +0100 +apt (0.6.42.3ubuntu2) dapper; urgency=low + + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-131: + * zh_CN.po: Completed to 507 strings(Closes: #338267) + * gl.po: Completed to 510 strings (Closes: #338356) + * added support for "/etc/apt/sources.list.d" directory + (closes: #66325) + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 14 Nov 2005 15:30:12 +0100 + +apt (0.6.42.3ubuntu1) dapper; urgency=low + + * synced with debian + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 10 Nov 2005 05:05:56 +0100 + apt (0.6.42.3) unstable; urgency=low * Merge bubulle@debian.org--2005/apt--main--0 up to patch-129: @@ -250,13 +386,13 @@ apt (0.6.42) unstable; urgency=low - unmount the cdrom when apt failed to locate any package files * allow cdrom failures and fallback to other sources in that case (closes: #44135) - * better error text when dpkg-source fails + * better error text when dpkg-source fails * Merge bubulle@debian.org--2005/apt--main--0 up to patch-115: - patch-99: Added Galician translation - patch-100: Completed Danish translation (Closes: #325686) - patch-104: French translation completed - patch-109: Italian translation completed - - patch-112: Swedish translation update + - patch-112: Swedish translation update - patch-115: Basque translation completed (Closes: #333299) * applied french man-page update (thanks to Philippe Batailler) (closes: #316638, #327456) @@ -270,12 +406,12 @@ apt (0.6.42) unstable; urgency=low * apt-pkg/contrib/md5.cc: - fix a alignment problem on sparc64 that gives random bus errors (thanks to Fabbione for providing a test-case) - * init the default ScreenWidth to 79 columns by default + * init the default ScreenWidth to 79 columns by default (Closes: #324921) - * cmdline/apt-cdrom.cc: + * cmdline/apt-cdrom.cc: - fix some missing gettext() calls (closes: #334539) * doc/apt-cache.8.xml: fix typo (closes: #334714) - + -- Michael Vogt <mvo@debian.org> Wed, 19 Oct 2005 22:02:09 +0200 apt (0.6.41) unstable; urgency=low @@ -283,8 +419,8 @@ apt (0.6.41) unstable; urgency=low * improved the support for "error" and "conffile" reporting from dpkg, added the format to README.progress-reporting * added README.progress-reporting to the apt-doc package - * improved the network timeout handling, if a index file from a - sources.list times out or EAI_AGAIN is returned from getaddrinfo, + * improved the network timeout handling, if a index file from a + sources.list times out or EAI_AGAIN is returned from getaddrinfo, don't try to get the other files from that entry * Support architecture-specific extra overrides (closes: #225947). Thanks to Anthony Towns for idea and @@ -292,10 +428,10 @@ apt (0.6.41) unstable; urgency=low * Javier Fernandez-Sanguino Pen~a: - Added a first version of an apt-secure.8 manpage, and modified apt-key and apt.end accordingly. Also added the 'update' - argument to apt-key which was previously not documented + argument to apt-key which was previously not documented (Closes: #322120) * Andreas Pakulat: - - added example apt-ftparchive.conf file to doc/examples + - added example apt-ftparchive.conf file to doc/examples (closes: #322483) * Fix a incorrect example in the man-page (closes: #282918) * Fix a bug for very long lines in the apt-cdrom code (closes: #280356) @@ -304,10 +440,84 @@ apt (0.6.41) unstable; urgency=low * Change pkgPolicy::Pin from private to protected to let subclasses access it too (closes: #321799) * add default constructor for PrvIterator (closes: #322267) - * Reread status configuration on debSystem::Initialize() + * Reread status configuration on debSystem::Initialize() (needed for apt-proxy, thanks to Otavio for this patch) - + -- Michael Vogt <mvo@debian.org> Mon, 5 Sep 2005 22:59:03 +0200 + +apt (0.6.40.1ubuntu8) breezy; urgency=low + + * Cherry picked michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-62: + - fix for a bad memory/file leak in the mmap code (ubuntu #15603) + * po/de.po, po/fr.po: + - updated the translations + * po/makefile: + - create a single pot file in each domain dir to make rosetta happy + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 28 Sep 2005 10:16:06 +0200 + +apt (0.6.40.1ubuntu7) breezy; urgency=low + + * updated the pot/po files , no code changes + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 27 Sep 2005 18:38:16 +0200 + +apt (0.6.40.1ubuntu6) breezy; urgency=low + + * Cherry picked michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-56: + - make it possible for apt to handle a failed MediaChange event and + fall back to other sources (ubuntu #13713) + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 13 Sep 2005 22:09:50 +0200 + +apt (0.6.40.1ubuntu5) breezy; urgency=low + + * Cherry picked michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-{50,51}. + This adds media-change reporting to the apt status-fd (ubuntu #15213) + * Cherry picked michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-55: + apt-pkg/cdrom.cc: + - unmount the cdrom when apt failed to locate any package files + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 12 Sep 2005 15:44:26 +0200 + +apt (0.6.40.1ubuntu4) breezy; urgency=low + + * debian/apt.cron.daily: + - fix a embarrassing typo + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 7 Sep 2005 10:10:37 +0200 + +apt (0.6.40.1ubuntu3) breezy; urgency=low + + * debian/apt.cron.daily: + - use the ctime as well when figuring what packages need to + be removed. This fixes the problem that packages copied with + "cp -a" (e.g. from the installer) have old mtimes (ubuntu #14504) + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 6 Sep 2005 18:30:46 +0200 + +apt (0.6.40.1ubuntu2) breezy; urgency=low + + * improved the support for "error" and "conffile" reporting from + dpkg, added the format to README.progress-reporting + * added README.progress-reporting to the apt-doc package + * Do md5sum checking for file and cdrom method (closes: #319142) + * Change pkgPolicy::Pin from private to protected to let subclasses + access it too (closes: #321799) + * methods/connect.cc: + - send failure reason for EAI_AGAIN (TmpResolveFailure) to acuire-item + * apt-pkg/acquire-item.cc: + - fail early if a FailReason is TmpResolveFailure (avoids hangs during + the install when no network is available) + * merged michael.vogt@ubuntu.com--2005/apt--trust-cdrom--0 + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 23 Aug 2005 19:44:55 +0200 + +apt (0.6.40.1ubuntu1) breezy; urgency=low + + * Synchronize with Debian + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 5 Aug 2005 14:20:56 +0200 apt (0.6.40.1) unstable; urgency=low @@ -318,6 +528,12 @@ apt (0.6.40.1) unstable; urgency=low -- Michael Vogt <mvo@debian.org> Fri, 5 Aug 2005 13:24:58 +0200 +apt (0.6.40ubuntu1) breezy; urgency=low + + * Synchronize with Debian + + -- Matt Zimmerman <mdz@ubuntu.com> Thu, 4 Aug 2005 15:53:22 -0700 + apt (0.6.40) unstable; urgency=low * Patch from Jordi Mallach to mark some additional strings for translation @@ -333,6 +549,39 @@ apt (0.6.40) unstable; urgency=low -- Matt Zimmerman <mdz@debian.org> Thu, 28 Jul 2005 11:57:32 -0700 +apt (0.6.39ubuntu4) breezy; urgency=low + + * Fix keyring paths in apt-key, apt.postinst (I swear I remember doing this + before...) + + -- Matt Zimmerman <mdz@ubuntu.com> Wed, 29 Jun 2005 08:39:17 -0700 + +apt (0.6.39ubuntu3) breezy; urgency=low + + * Fix keyring locations for Ubuntu in apt-key too. + + -- Colin Watson <cjwatson@ubuntu.com> Wed, 29 Jun 2005 14:45:36 +0100 + +apt (0.6.39ubuntu2) breezy; urgency=low + + * Install ubuntu-archive.gpg rather than debian-archive.gpg as + /etc/apt/trusted.gpg. + + -- Colin Watson <cjwatson@ubuntu.com> Wed, 29 Jun 2005 11:53:34 +0100 + +apt (0.6.39ubuntu1) breezy; urgency=low + + * Michael Vogt + - Change debian/bugscript to use #!/bin/bash (Closes: #313402) + - Fix a incorrect example in the man-page (closes: #282918) + - Support architecture-specific extra overrides + (closes: #225947). Thanks to Anthony Towns for idea and + the patch, thanks to Colin Watson for testing it. + - better report network timeouts from the methods to the acuire code, + only timeout once per sources.list line + + -- Matt Zimmerman <mdz@ubuntu.com> Tue, 28 Jun 2005 11:52:24 -0700 + apt (0.6.39) unstable; urgency=low * Welsh translation update: daf@muse.19inch.net--2005/apt--main--0--patch-6 @@ -343,7 +592,14 @@ apt (0.6.39) unstable; urgency=low * Update priority of apt-utils to important, to match the override file * Install only one keyring on each branch (Closes: #316119) - -- Matt Zimmerman <mdz@debian.org> Tue, 28 Jun 2005 11:51:09 -0700 + -- Matt Zimmerman <mdz@debian.org> Tue, 28 Jun 2005 11:35:21 -0700 + +apt (0.6.38ubuntu1) breezy; urgency=low + + * First release from Ubuntu branch + * Merge with --main--0, switch back to Ubuntu keyring + + -- Matt Zimmerman <mdz@ubuntu.com> Sat, 25 Jun 2005 16:52:41 -0700 apt (0.6.38) unstable; urgency=low @@ -375,6 +631,7 @@ apt (0.6.37) breezy; urgency=low * Add Welsh translation from Dafydd Harries (daf@muse.19inch.net--2005/apt--main--0--patch-1) * Change debian/bugscript to use #!/bin/bash (Closes: #313402) + * Fix a incorrect example in the man-page (closes: #282918) -- Matt Zimmerman <mdz@ubuntu.com> Tue, 24 May 2005 14:38:25 -0700 diff --git a/debian/control b/debian/control index 53ce851f6..a206373ae 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,7 @@ Depends: ${shlibs:Depends} Priority: important Replaces: libapt-pkg-doc (<< 0.3.7), libapt-pkg-dev (<< 0.3.7) Provides: ${libapt-pkg:provides} -Recommends: debian-archive-keyring +Recommends: ubuntu-keyring Suggests: aptitude | synaptic | gnome-apt | wajig, dpkg-dev, apt-doc, bzip2, gnupg Section: admin Description: Advanced front-end for dpkg diff --git a/debian/rules b/debian/rules index a8bf88762..333d4ad5b 100755 --- a/debian/rules +++ b/debian/rules @@ -210,10 +210,15 @@ apt: build debian/shlibs.local cp debian/bugscript debian/$@/usr/share/bug/apt/script - cp share/debian-archive.gpg debian/$@/usr/share/$@ + cp share/ubuntu-archive.gpg debian/$@/usr/share/$@ # head -n 500 ChangeLog > debian/ChangeLog + # make rosetta happy and remove pot files in po/ (but leave stuff + # in po/domains/* untouched) and cp *.po into each domain dir + rm -f build/po/*.pot + rm -f po/*.pot + dh_installexamples -p$@ $(BLD)/docs/examples/* dh_installman -p$@ dh_installcron -p$@ @@ -338,4 +343,4 @@ arch-build: mkdir -p debian/arch-build/apt-$(APT_DEBVER) tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/$(PKG)-$(APT_DEBVER);tar xf -) $(MAKE) -C debian/arch-build/apt-$(APT_DEBVER) startup doc - (cd debian/arch-build/apt-$(APT_DEBVER); $(DEB_BUILD_PROG)) + (cd debian/arch-build/apt-$(APT_DEBVER); $(DEB_BUILD_PROG); dpkg-genchanges -S > ../apt_$(APT_DEBVER)_source.changes) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 3e50bef8c..12b03196a 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -183,7 +183,7 @@ belonging to any distribution whose Archive name is "<literal>unstable</literal> <programlisting> Package: * Pin: release a=unstable -Pin-Priority: 50 +Pin-Priority: 500 </programlisting> <simpara>The following record assigns a high priority to all package versions diff --git a/doc/examples/configure-index b/doc/examples/configure-index index f8abd75ed..1911d091b 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -24,11 +24,15 @@ APT { Architecture "i386"; Build-Essential "build-essential"; - + + NeverAutoRemove { "linux-kernel.*"; }; // packages that should never + // considered for autoRemove + // Options for apt-get Get { Arch-Only "false"; + AutomaticRemove "false"; Download-Only "false"; Simulate "false"; Assume-Yes "false"; @@ -251,7 +255,8 @@ Debug pkgDPkgPM "false"; pkgDPkgProgressReporting "false"; pkgOrderList "false"; - + pkgAutoRemove "false"; // show information about automatic removes + pkgInitialize "false"; // This one will dump the configuration space NoLocking "false"; Acquire::Ftp "false"; // Show ftp command traffic diff --git a/doc/examples/sources.list b/doc/examples/sources.list index 9f2343277..a958899ae 100644 --- a/doc/examples/sources.list +++ b/doc/examples/sources.list @@ -1,10 +1,11 @@ # See sources.list(5) for more information, especialy # Remember that you can only use http, ftp or file URIs # CDROMs are managed through the apt-cdrom tool. -deb http://http.us.debian.org/debian stable main contrib non-free -deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free -deb http://security.debian.org stable/updates main contrib non-free +deb http://us.archive.ubuntu.com/ubuntu dapper main restricted +deb-src http://us.archive.ubuntu.com/ubuntu dapper main restricted -# Uncomment if you want the apt-get source function to work -#deb-src http://http.us.debian.org/debian stable main contrib non-free -#deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free +deb http://security.ubuntu.com/ubuntu dapper-security main restricted +deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted + +deb http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted +deb-src http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted diff --git a/methods/http.cc b/methods/http.cc index 341de94e3..09dab8188 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -714,7 +714,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) Req += string("Authorization: Basic ") + Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n"; - Req += "User-Agent: Debian APT-HTTP/1.3\r\n\r\n"; + Req += "User-Agent: Ubuntu APT-HTTP/1.3\r\n\r\n"; if (Debug == true) cerr << Req << endl; diff --git a/methods/makefile b/methods/makefile index 1e3b1ef85..03a424411 100644 --- a/methods/makefile +++ b/methods/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak BIN := $(BIN)/methods # FIXME.. -LIB_APT_PKG_MAJOR = 3.11 +LIB_APT_PKG_MAJOR = 3.50 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR) # The file method diff --git a/po/apt-all.pot b/po/apt-all.pot index 6929345af..cc075ceb3 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-05-27 13:46+0200\n" +"POT-Creation-Date: 2006-07-26 10:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -148,7 +148,7 @@ msgstr "" #: cmdline/apt-cache.cc:1652 cmdline/apt-cdrom.cc:138 cmdline/apt-config.cc:70 #: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:550 -#: cmdline/apt-get.cc:2369 cmdline/apt-sortpkgs.cc:144 +#: cmdline/apt-get.cc:2430 cmdline/apt-sortpkgs.cc:144 #, c-format msgid "%s %s for %s %s compiled on %s %s\n" msgstr "" @@ -243,7 +243,7 @@ msgid "" " -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" msgstr "" -#: cmdline/apt-extracttemplates.cc:267 apt-pkg/pkgcachegen.cc:710 +#: cmdline/apt-extracttemplates.cc:267 apt-pkg/pkgcachegen.cc:712 #, c-format msgid "Unable to write to %s" msgstr "" @@ -531,221 +531,221 @@ msgstr "" msgid "Failed to rename %s to %s" msgstr "" -#: cmdline/apt-get.cc:120 +#: cmdline/apt-get.cc:121 msgid "Y" msgstr "" -#: cmdline/apt-get.cc:142 cmdline/apt-get.cc:1506 +#: cmdline/apt-get.cc:143 cmdline/apt-get.cc:1560 #, c-format msgid "Regex compilation error - %s" msgstr "" -#: cmdline/apt-get.cc:237 +#: cmdline/apt-get.cc:238 msgid "The following packages have unmet dependencies:" msgstr "" -#: cmdline/apt-get.cc:327 +#: cmdline/apt-get.cc:328 #, c-format msgid "but %s is installed" msgstr "" -#: cmdline/apt-get.cc:329 +#: cmdline/apt-get.cc:330 #, c-format msgid "but %s is to be installed" msgstr "" -#: cmdline/apt-get.cc:336 +#: cmdline/apt-get.cc:337 msgid "but it is not installable" msgstr "" -#: cmdline/apt-get.cc:338 +#: cmdline/apt-get.cc:339 msgid "but it is a virtual package" msgstr "" -#: cmdline/apt-get.cc:341 +#: cmdline/apt-get.cc:342 msgid "but it is not installed" msgstr "" -#: cmdline/apt-get.cc:341 +#: cmdline/apt-get.cc:342 msgid "but it is not going to be installed" msgstr "" -#: cmdline/apt-get.cc:346 +#: cmdline/apt-get.cc:347 msgid " or" msgstr "" -#: cmdline/apt-get.cc:375 +#: cmdline/apt-get.cc:376 msgid "The following NEW packages will be installed:" msgstr "" -#: cmdline/apt-get.cc:401 +#: cmdline/apt-get.cc:402 msgid "The following packages will be REMOVED:" msgstr "" -#: cmdline/apt-get.cc:423 +#: cmdline/apt-get.cc:424 msgid "The following packages have been kept back:" msgstr "" -#: cmdline/apt-get.cc:444 +#: cmdline/apt-get.cc:445 msgid "The following packages will be upgraded:" msgstr "" -#: cmdline/apt-get.cc:465 +#: cmdline/apt-get.cc:466 msgid "The following packages will be DOWNGRADED:" msgstr "" -#: cmdline/apt-get.cc:485 +#: cmdline/apt-get.cc:486 msgid "The following held packages will be changed:" msgstr "" -#: cmdline/apt-get.cc:538 +#: cmdline/apt-get.cc:539 #, c-format msgid "%s (due to %s) " msgstr "" -#: cmdline/apt-get.cc:546 +#: cmdline/apt-get.cc:547 msgid "" "WARNING: The following essential packages will be removed.\n" "This should NOT be done unless you know exactly what you are doing!" msgstr "" -#: cmdline/apt-get.cc:577 +#: cmdline/apt-get.cc:578 #, c-format msgid "%lu upgraded, %lu newly installed, " msgstr "" -#: cmdline/apt-get.cc:581 +#: cmdline/apt-get.cc:582 #, c-format msgid "%lu reinstalled, " msgstr "" -#: cmdline/apt-get.cc:583 +#: cmdline/apt-get.cc:584 #, c-format msgid "%lu downgraded, " msgstr "" -#: cmdline/apt-get.cc:585 +#: cmdline/apt-get.cc:586 #, c-format msgid "%lu to remove and %lu not upgraded.\n" msgstr "" -#: cmdline/apt-get.cc:589 +#: cmdline/apt-get.cc:590 #, c-format msgid "%lu not fully installed or removed.\n" msgstr "" -#: cmdline/apt-get.cc:649 +#: cmdline/apt-get.cc:650 msgid "Correcting dependencies..." msgstr "" -#: cmdline/apt-get.cc:652 +#: cmdline/apt-get.cc:653 msgid " failed." msgstr "" -#: cmdline/apt-get.cc:655 +#: cmdline/apt-get.cc:656 msgid "Unable to correct dependencies" msgstr "" -#: cmdline/apt-get.cc:658 +#: cmdline/apt-get.cc:659 msgid "Unable to minimize the upgrade set" msgstr "" -#: cmdline/apt-get.cc:660 +#: cmdline/apt-get.cc:661 msgid " Done" msgstr "" -#: cmdline/apt-get.cc:664 +#: cmdline/apt-get.cc:665 msgid "You might want to run `apt-get -f install' to correct these." msgstr "" -#: cmdline/apt-get.cc:667 +#: cmdline/apt-get.cc:668 msgid "Unmet dependencies. Try using -f." msgstr "" -#: cmdline/apt-get.cc:689 +#: cmdline/apt-get.cc:690 msgid "WARNING: The following packages cannot be authenticated!" msgstr "" -#: cmdline/apt-get.cc:693 +#: cmdline/apt-get.cc:694 msgid "Authentication warning overridden.\n" msgstr "" -#: cmdline/apt-get.cc:700 +#: cmdline/apt-get.cc:701 msgid "Install these packages without verification [y/N]? " msgstr "" -#: cmdline/apt-get.cc:702 +#: cmdline/apt-get.cc:703 msgid "Some packages could not be authenticated" msgstr "" -#: cmdline/apt-get.cc:711 cmdline/apt-get.cc:858 +#: cmdline/apt-get.cc:712 cmdline/apt-get.cc:859 msgid "There are problems and -y was used without --force-yes" msgstr "" -#: cmdline/apt-get.cc:755 +#: cmdline/apt-get.cc:756 msgid "Internal error, InstallPackages was called with broken packages!" msgstr "" -#: cmdline/apt-get.cc:764 +#: cmdline/apt-get.cc:765 msgid "Packages need to be removed but remove is disabled." msgstr "" -#: cmdline/apt-get.cc:775 +#: cmdline/apt-get.cc:776 msgid "Internal error, Ordering didn't finish" msgstr "" -#: cmdline/apt-get.cc:791 cmdline/apt-get.cc:1800 cmdline/apt-get.cc:1833 +#: cmdline/apt-get.cc:792 cmdline/apt-get.cc:1861 cmdline/apt-get.cc:1894 msgid "Unable to lock the download directory" msgstr "" -#: cmdline/apt-get.cc:801 cmdline/apt-get.cc:1881 cmdline/apt-get.cc:2117 +#: cmdline/apt-get.cc:802 cmdline/apt-get.cc:1942 cmdline/apt-get.cc:2178 #: apt-pkg/cachefile.cc:67 msgid "The list of sources could not be read." msgstr "" -#: cmdline/apt-get.cc:816 +#: cmdline/apt-get.cc:817 msgid "How odd.. The sizes didn't match, email apt@packages.debian.org" msgstr "" -#: cmdline/apt-get.cc:821 +#: cmdline/apt-get.cc:822 #, c-format msgid "Need to get %sB/%sB of archives.\n" msgstr "" -#: cmdline/apt-get.cc:824 +#: cmdline/apt-get.cc:825 #, c-format msgid "Need to get %sB of archives.\n" msgstr "" -#: cmdline/apt-get.cc:829 +#: cmdline/apt-get.cc:830 #, c-format msgid "After unpacking %sB of additional disk space will be used.\n" msgstr "" -#: cmdline/apt-get.cc:832 +#: cmdline/apt-get.cc:833 #, c-format msgid "After unpacking %sB disk space will be freed.\n" msgstr "" -#: cmdline/apt-get.cc:846 cmdline/apt-get.cc:1971 +#: cmdline/apt-get.cc:847 cmdline/apt-get.cc:2032 #, c-format msgid "Couldn't determine free space in %s" msgstr "" -#: cmdline/apt-get.cc:849 +#: cmdline/apt-get.cc:850 #, c-format msgid "You don't have enough free space in %s." msgstr "" -#: cmdline/apt-get.cc:864 cmdline/apt-get.cc:884 +#: cmdline/apt-get.cc:865 cmdline/apt-get.cc:885 msgid "Trivial Only specified but this is not a trivial operation." msgstr "" -#: cmdline/apt-get.cc:866 +#: cmdline/apt-get.cc:867 msgid "Yes, do as I say!" msgstr "" -#: cmdline/apt-get.cc:868 +#: cmdline/apt-get.cc:869 #, c-format msgid "" "You are about to do something potentially harmful.\n" @@ -753,74 +753,74 @@ msgid "" " ?] " msgstr "" -#: cmdline/apt-get.cc:874 cmdline/apt-get.cc:893 +#: cmdline/apt-get.cc:875 cmdline/apt-get.cc:894 msgid "Abort." msgstr "" -#: cmdline/apt-get.cc:889 +#: cmdline/apt-get.cc:890 msgid "Do you want to continue [Y/n]? " msgstr "" -#: cmdline/apt-get.cc:961 cmdline/apt-get.cc:1365 cmdline/apt-get.cc:2014 +#: cmdline/apt-get.cc:962 cmdline/apt-get.cc:1366 cmdline/apt-get.cc:2075 #, c-format msgid "Failed to fetch %s %s\n" msgstr "" -#: cmdline/apt-get.cc:979 +#: cmdline/apt-get.cc:980 msgid "Some files failed to download" msgstr "" -#: cmdline/apt-get.cc:980 cmdline/apt-get.cc:2023 +#: cmdline/apt-get.cc:981 cmdline/apt-get.cc:2084 msgid "Download complete and in download only mode" msgstr "" -#: cmdline/apt-get.cc:986 +#: cmdline/apt-get.cc:987 msgid "" "Unable to fetch some archives, maybe run apt-get update or try with --fix-" "missing?" msgstr "" -#: cmdline/apt-get.cc:990 +#: cmdline/apt-get.cc:991 msgid "--fix-missing and media swapping is not currently supported" msgstr "" -#: cmdline/apt-get.cc:995 +#: cmdline/apt-get.cc:996 msgid "Unable to correct missing packages." msgstr "" -#: cmdline/apt-get.cc:996 +#: cmdline/apt-get.cc:997 msgid "Aborting install." msgstr "" -#: cmdline/apt-get.cc:1030 +#: cmdline/apt-get.cc:1031 #, c-format msgid "Note, selecting %s instead of %s\n" msgstr "" -#: cmdline/apt-get.cc:1040 +#: cmdline/apt-get.cc:1041 #, c-format msgid "Skipping %s, it is already installed and upgrade is not set.\n" msgstr "" -#: cmdline/apt-get.cc:1058 +#: cmdline/apt-get.cc:1059 #, c-format msgid "Package %s is not installed, so not removed\n" msgstr "" -#: cmdline/apt-get.cc:1069 +#: cmdline/apt-get.cc:1070 #, c-format msgid "Package %s is a virtual package provided by:\n" msgstr "" -#: cmdline/apt-get.cc:1081 +#: cmdline/apt-get.cc:1082 msgid " [Installed]" msgstr "" -#: cmdline/apt-get.cc:1086 +#: cmdline/apt-get.cc:1087 msgid "You should explicitly select one to install." msgstr "" -#: cmdline/apt-get.cc:1091 +#: cmdline/apt-get.cc:1092 #, c-format msgid "" "Package %s is not available, but is referred to by another package.\n" @@ -828,79 +828,97 @@ msgid "" "is only available from another source\n" msgstr "" -#: cmdline/apt-get.cc:1110 +#: cmdline/apt-get.cc:1111 msgid "However the following packages replace it:" msgstr "" -#: cmdline/apt-get.cc:1113 +#: cmdline/apt-get.cc:1114 #, c-format msgid "Package %s has no installation candidate" msgstr "" -#: cmdline/apt-get.cc:1133 +#: cmdline/apt-get.cc:1134 #, c-format msgid "Reinstallation of %s is not possible, it cannot be downloaded.\n" msgstr "" -#: cmdline/apt-get.cc:1141 +#: cmdline/apt-get.cc:1142 #, c-format msgid "%s is already the newest version.\n" msgstr "" -#: cmdline/apt-get.cc:1168 +#: cmdline/apt-get.cc:1169 #, c-format msgid "Release '%s' for '%s' was not found" msgstr "" -#: cmdline/apt-get.cc:1170 +#: cmdline/apt-get.cc:1171 #, c-format msgid "Version '%s' for '%s' was not found" msgstr "" -#: cmdline/apt-get.cc:1176 +#: cmdline/apt-get.cc:1177 #, c-format msgid "Selected version %s (%s) for %s\n" msgstr "" -#: cmdline/apt-get.cc:1313 +#: cmdline/apt-get.cc:1314 msgid "The update command takes no arguments" msgstr "" -#: cmdline/apt-get.cc:1326 +#: cmdline/apt-get.cc:1327 msgid "Unable to lock the list directory" msgstr "" -#: cmdline/apt-get.cc:1384 +#: cmdline/apt-get.cc:1385 msgid "" "Some index files failed to download, they have been ignored, or old ones " "used instead." msgstr "" -#: cmdline/apt-get.cc:1403 +#: cmdline/apt-get.cc:1399 +msgid "We are not supposed to delete stuff, can't start AutoRemover" +msgstr "" + +#: cmdline/apt-get.cc:1424 +msgid "" +"Hmm, seems like the AutoRemover destroyed something which really\n" +"shouldn't happen. Please file a bug report against apt." +msgstr "" + +#: cmdline/apt-get.cc:1427 cmdline/apt-get.cc:1628 +msgid "The following information may help to resolve the situation:" +msgstr "" + +#: cmdline/apt-get.cc:1431 +msgid "Internal Error, AutoRemover broke stuff" +msgstr "" + +#: cmdline/apt-get.cc:1450 msgid "Internal error, AllUpgrade broke stuff" msgstr "" -#: cmdline/apt-get.cc:1493 cmdline/apt-get.cc:1529 +#: cmdline/apt-get.cc:1547 cmdline/apt-get.cc:1583 #, c-format msgid "Couldn't find package %s" msgstr "" -#: cmdline/apt-get.cc:1516 +#: cmdline/apt-get.cc:1570 #, c-format msgid "Note, selecting %s for regex '%s'\n" msgstr "" -#: cmdline/apt-get.cc:1546 +#: cmdline/apt-get.cc:1600 msgid "You might want to run `apt-get -f install' to correct these:" msgstr "" -#: cmdline/apt-get.cc:1549 +#: cmdline/apt-get.cc:1603 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." msgstr "" -#: cmdline/apt-get.cc:1561 +#: cmdline/apt-get.cc:1615 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -908,163 +926,159 @@ msgid "" "or been moved out of Incoming." msgstr "" -#: cmdline/apt-get.cc:1569 +#: cmdline/apt-get.cc:1623 msgid "" "Since you only requested a single operation it is extremely likely that\n" "the package is simply not installable and a bug report against\n" "that package should be filed." msgstr "" -#: cmdline/apt-get.cc:1574 -msgid "The following information may help to resolve the situation:" -msgstr "" - -#: cmdline/apt-get.cc:1577 +#: cmdline/apt-get.cc:1631 msgid "Broken packages" msgstr "" -#: cmdline/apt-get.cc:1603 +#: cmdline/apt-get.cc:1662 msgid "The following extra packages will be installed:" msgstr "" -#: cmdline/apt-get.cc:1674 +#: cmdline/apt-get.cc:1733 msgid "Suggested packages:" msgstr "" -#: cmdline/apt-get.cc:1675 +#: cmdline/apt-get.cc:1734 msgid "Recommended packages:" msgstr "" -#: cmdline/apt-get.cc:1695 +#: cmdline/apt-get.cc:1754 msgid "Calculating upgrade... " msgstr "" -#: cmdline/apt-get.cc:1698 methods/ftp.cc:702 methods/connect.cc:101 +#: cmdline/apt-get.cc:1757 methods/ftp.cc:702 methods/connect.cc:101 msgid "Failed" msgstr "" -#: cmdline/apt-get.cc:1703 +#: cmdline/apt-get.cc:1762 msgid "Done" msgstr "" -#: cmdline/apt-get.cc:1768 cmdline/apt-get.cc:1776 +#: cmdline/apt-get.cc:1829 cmdline/apt-get.cc:1837 msgid "Internal error, problem resolver broke stuff" msgstr "" -#: cmdline/apt-get.cc:1876 +#: cmdline/apt-get.cc:1937 msgid "Must specify at least one package to fetch source for" msgstr "" -#: cmdline/apt-get.cc:1906 cmdline/apt-get.cc:2135 +#: cmdline/apt-get.cc:1967 cmdline/apt-get.cc:2196 #, c-format msgid "Unable to find a source package for %s" msgstr "" -#: cmdline/apt-get.cc:1950 +#: cmdline/apt-get.cc:2011 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "" -#: cmdline/apt-get.cc:1974 +#: cmdline/apt-get.cc:2035 #, c-format msgid "You don't have enough free space in %s" msgstr "" -#: cmdline/apt-get.cc:1979 +#: cmdline/apt-get.cc:2040 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:1982 +#: cmdline/apt-get.cc:2043 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "" -#: cmdline/apt-get.cc:1988 +#: cmdline/apt-get.cc:2049 #, c-format msgid "Fetch source %s\n" msgstr "" -#: cmdline/apt-get.cc:2019 +#: cmdline/apt-get.cc:2080 msgid "Failed to fetch some archives." msgstr "" -#: cmdline/apt-get.cc:2047 +#: cmdline/apt-get.cc:2108 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "" -#: cmdline/apt-get.cc:2059 +#: cmdline/apt-get.cc:2120 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2060 +#: cmdline/apt-get.cc:2121 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "" -#: cmdline/apt-get.cc:2077 +#: cmdline/apt-get.cc:2138 #, c-format msgid "Build command '%s' failed.\n" msgstr "" -#: cmdline/apt-get.cc:2096 +#: cmdline/apt-get.cc:2157 msgid "Child process failed" msgstr "" -#: cmdline/apt-get.cc:2112 +#: cmdline/apt-get.cc:2173 msgid "Must specify at least one package to check builddeps for" msgstr "" -#: cmdline/apt-get.cc:2140 +#: cmdline/apt-get.cc:2201 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "" -#: cmdline/apt-get.cc:2160 +#: cmdline/apt-get.cc:2221 #, c-format msgid "%s has no build depends.\n" msgstr "" -#: cmdline/apt-get.cc:2212 +#: cmdline/apt-get.cc:2273 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " "found" msgstr "" -#: cmdline/apt-get.cc:2264 +#: cmdline/apt-get.cc:2325 #, c-format msgid "" "%s dependency for %s cannot be satisfied because no available versions of " "package %s can satisfy version requirements" msgstr "" -#: cmdline/apt-get.cc:2299 +#: cmdline/apt-get.cc:2360 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "" -#: cmdline/apt-get.cc:2324 +#: cmdline/apt-get.cc:2385 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "" -#: cmdline/apt-get.cc:2338 +#: cmdline/apt-get.cc:2399 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "" -#: cmdline/apt-get.cc:2342 +#: cmdline/apt-get.cc:2403 msgid "Failed to process build dependencies" msgstr "" -#: cmdline/apt-get.cc:2374 +#: cmdline/apt-get.cc:2435 msgid "Supported modules:" msgstr "" -#: cmdline/apt-get.cc:2415 +#: cmdline/apt-get.cc:2476 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -1349,9 +1363,9 @@ msgid "The info and temp directories need to be on the same filesystem" msgstr "" #. Build the status cache -#: apt-inst/deb/dpkgdb.cc:139 apt-pkg/pkgcachegen.cc:643 -#: apt-pkg/pkgcachegen.cc:712 apt-pkg/pkgcachegen.cc:717 -#: apt-pkg/pkgcachegen.cc:840 +#: apt-inst/deb/dpkgdb.cc:139 apt-pkg/pkgcachegen.cc:645 +#: apt-pkg/pkgcachegen.cc:714 apt-pkg/pkgcachegen.cc:719 +#: apt-pkg/pkgcachegen.cc:842 msgid "Reading package lists" msgstr "" @@ -2089,24 +2103,38 @@ msgstr "" msgid "extra" msgstr "" -#: apt-pkg/depcache.cc:61 apt-pkg/depcache.cc:90 +#: apt-pkg/depcache.cc:101 apt-pkg/depcache.cc:130 msgid "Building dependency tree" msgstr "" -#: apt-pkg/depcache.cc:62 +#: apt-pkg/depcache.cc:102 msgid "Candidate versions" msgstr "" -#: apt-pkg/depcache.cc:91 +#: apt-pkg/depcache.cc:131 msgid "Dependency generation" msgstr "" +#: apt-pkg/depcache.cc:152 apt-pkg/depcache.cc:171 apt-pkg/depcache.cc:175 +msgid "Reading state information" +msgstr "" + +#: apt-pkg/depcache.cc:199 +#, c-format +msgid "Failed to open StateFile %s" +msgstr "" + +#: apt-pkg/depcache.cc:205 +#, c-format +msgid "Failed to write temporary StateFile %s" +msgstr "" + #: apt-pkg/tagfile.cc:72 #, c-format msgid "Unable to parse package file %s (1)" msgstr "" -#: apt-pkg/tagfile.cc:102 +#: apt-pkg/tagfile.cc:103 #, c-format msgid "Unable to parse package file %s (2)" msgstr "" @@ -2174,19 +2202,19 @@ msgstr "" msgid "Index file type '%s' is not supported" msgstr "" -#: apt-pkg/algorithms.cc:241 +#: apt-pkg/algorithms.cc:245 #, c-format msgid "" "The package %s needs to be reinstalled, but I can't find an archive for it." msgstr "" -#: apt-pkg/algorithms.cc:1059 +#: apt-pkg/algorithms.cc:1075 msgid "" "Error, pkgProblemResolver::Resolve generated breaks, this may be caused by " "held packages." msgstr "" -#: apt-pkg/algorithms.cc:1061 +#: apt-pkg/algorithms.cc:1077 msgid "Unable to correct problems, you have held broken packages." msgstr "" @@ -2266,82 +2294,82 @@ msgstr "" msgid "No priority (or zero) specified for pin" msgstr "" -#: apt-pkg/pkgcachegen.cc:74 +#: apt-pkg/pkgcachegen.cc:76 msgid "Cache has an incompatible versioning system" msgstr "" -#: apt-pkg/pkgcachegen.cc:117 +#: apt-pkg/pkgcachegen.cc:119 #, c-format msgid "Error occurred while processing %s (NewPackage)" msgstr "" -#: apt-pkg/pkgcachegen.cc:129 +#: apt-pkg/pkgcachegen.cc:131 #, c-format msgid "Error occurred while processing %s (UsePackage1)" msgstr "" -#: apt-pkg/pkgcachegen.cc:150 +#: apt-pkg/pkgcachegen.cc:152 #, c-format msgid "Error occurred while processing %s (UsePackage2)" msgstr "" -#: apt-pkg/pkgcachegen.cc:154 +#: apt-pkg/pkgcachegen.cc:156 #, c-format msgid "Error occurred while processing %s (NewFileVer1)" msgstr "" -#: apt-pkg/pkgcachegen.cc:184 +#: apt-pkg/pkgcachegen.cc:186 #, c-format msgid "Error occurred while processing %s (NewVersion1)" msgstr "" -#: apt-pkg/pkgcachegen.cc:188 +#: apt-pkg/pkgcachegen.cc:190 #, c-format msgid "Error occurred while processing %s (UsePackage3)" msgstr "" -#: apt-pkg/pkgcachegen.cc:192 +#: apt-pkg/pkgcachegen.cc:194 #, c-format msgid "Error occurred while processing %s (NewVersion2)" msgstr "" -#: apt-pkg/pkgcachegen.cc:207 +#: apt-pkg/pkgcachegen.cc:209 msgid "Wow, you exceeded the number of package names this APT is capable of." msgstr "" -#: apt-pkg/pkgcachegen.cc:210 +#: apt-pkg/pkgcachegen.cc:212 msgid "Wow, you exceeded the number of versions this APT is capable of." msgstr "" -#: apt-pkg/pkgcachegen.cc:213 +#: apt-pkg/pkgcachegen.cc:215 msgid "Wow, you exceeded the number of dependencies this APT is capable of." msgstr "" -#: apt-pkg/pkgcachegen.cc:241 +#: apt-pkg/pkgcachegen.cc:243 #, c-format msgid "Error occurred while processing %s (FindPkg)" msgstr "" -#: apt-pkg/pkgcachegen.cc:254 +#: apt-pkg/pkgcachegen.cc:256 #, c-format msgid "Error occurred while processing %s (CollectFileProvides)" msgstr "" -#: apt-pkg/pkgcachegen.cc:260 +#: apt-pkg/pkgcachegen.cc:262 #, c-format msgid "Package %s %s was not found while processing file dependencies" msgstr "" -#: apt-pkg/pkgcachegen.cc:574 +#: apt-pkg/pkgcachegen.cc:576 #, c-format msgid "Couldn't stat source package list %s" msgstr "" -#: apt-pkg/pkgcachegen.cc:658 +#: apt-pkg/pkgcachegen.cc:660 msgid "Collecting File Provides" msgstr "" -#: apt-pkg/pkgcachegen.cc:785 apt-pkg/pkgcachegen.cc:792 +#: apt-pkg/pkgcachegen.cc:787 apt-pkg/pkgcachegen.cc:794 msgid "IO Error saving source cache" msgstr "" diff --git a/po/makefile b/po/makefile index 45e5b1e5a..07dc51c07 100644 --- a/po/makefile +++ b/po/makefile @@ -40,6 +40,9 @@ $(POTFILES) : $(PO)/%.pot : --files-from=$(PO)/POTFILES_$*.in -o $(PO)/domains/$*/c.pot rm -f $(PO)/POTFILES_$*.in $(MSGCOMM) --more-than=0 $(PO)/domains/$*/c.pot $(PO)/domains/$*/sh.pot --output=$@ + # copy into the domain dirs to make rosetta happy + rm -f $(PO)/domains/$*/*.pot + cp $@ $(PO)/domains/$* $(PACKAGE)-all.pot: $(POTFILES) $(MSGCOMM) --more-than=0 $(POTFILES) --output=$@ diff --git a/share/debian-archive.gpg b/share/debian-archive.gpg Binary files differindex ce412117d..bb5ed5033 100644 --- a/share/debian-archive.gpg +++ b/share/debian-archive.gpg |