From 9c9d7a81217873c1c0dc453cac4b66850084f522 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 3 Jan 2008 09:55:53 +0100 Subject: * debian/control: - build against libdb-dev (instead of libdb4.4-dev) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 742e8ca5c..2e9e306c8 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: important Maintainer: APT Development Team Uploaders: Jason Gunthorpe , Adam Heath , Matt Zimmerman , Michael Vogt , Otavio Salvador Standards-Version: 3.7.2.2 -Build-Depends: debhelper (>= 5.0), libdb4.4-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5) +Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5) Build-Depends-Indep: debiandoc-sgml, docbook-utils (>= 0.6.12-1) XS-Vcs-Bzr: http://bzr.debian.org/apt/debian-sid/ -- cgit v1.2.3-70-g09d2 From 3a6d37fdcfbdb152eb00371ff69b8871c9a02527 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 3 Jan 2008 11:25:58 +0100 Subject: * apt-pkg/packagemanager.{cc,h}: - propergate the Immediate flag to make hitting the "E: Internal Error, Could not perform immediate configuration (2)" harder --- apt-pkg/packagemanager.cc | 53 ++++++++++++++++++++++++++++++++++++----------- apt-pkg/packagemanager.h | 1 + debian/changelog | 4 ++++ 3 files changed, 46 insertions(+), 12 deletions(-) (limited to 'debian') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index d6172c6c4..c391a6036 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -118,6 +118,41 @@ bool pkgPackageManager::FixMissing() } /*}}}*/ +// PM::ImmediateAdd - Add the immediate flag recursivly /*{{{*/ +// --------------------------------------------------------------------- +/* This adds the immediate flag to the pkg and recursively to the + dependendies + */ +void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer) +{ + DepIterator D; + + if(UseInstallVer) + { + if(Cache[I].InstallVer == 0) + return; + D = Cache[I].InstVerIter(Cache).DependsList(); + } else { + if (I->CurrentVer == 0) + return; + D = I.CurrentVer().DependsList(); + } + + for ( /* nothing */ ; D.end() == false; D++) + if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) + { + if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate)) + { + if(Debug) + clog << "ImmediateAdd(): Adding Immediate flag to " << I.Name() << endl; + List->Flag(D.TargetPkg(),pkgOrderList::Immediate); + ImmediateAdd(D.TargetPkg(), UseInstallVer); + } + } + return; +} + /*}}}*/ + // PM::CreateOrderList - Create the ordering class /*{{{*/ // --------------------------------------------------------------------- /* This populates the ordering list with all the packages that are @@ -144,21 +179,15 @@ bool pkgPackageManager::CreateOrderList() (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) && NoImmConfigure == false) { + if(Debug) + clog << "CreateOrderList(): Adding Immediate flag for " << I.Name() << endl; List->Flag(I,pkgOrderList::Immediate); - - // Look for other packages to make immediate configurea - if (Cache[I].InstallVer != 0) - for (DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); - D.end() == false; D++) - if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) - List->Flag(D.TargetPkg(),pkgOrderList::Immediate); + + // Look for other install packages to make immediate configurea + ImmediateAdd(I, true); // And again with the current version. - if (I->CurrentVer != 0) - for (DepIterator D = I.CurrentVer().DependsList(); - D.end() == false; D++) - if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) - List->Flag(D.TargetPkg(),pkgOrderList::Immediate); + ImmediateAdd(I, false); } // Not interesting diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index 53cd4c96f..a1bfdc52d 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -49,6 +49,7 @@ class pkgPackageManager : protected pkgCache::Namespace bool Debug; bool DepAdd(pkgOrderList &Order,PkgIterator P,int Depth = 0); + void ImmediateAdd(PkgIterator P, bool UseInstallVer); virtual OrderResult OrderInstall(); bool CheckRConflicts(PkgIterator Pkg,DepIterator Dep,const char *Ver); bool CreateOrderList(); diff --git a/debian/changelog b/debian/changelog index ef9784178..4f22e9d92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,6 +43,10 @@ apt (0.7.10) UNRELEASED; urgency=low * apt-pkg/acquire-item.{cc,h}: - make the authentication download code more robust against servers/proxies with broken If-Range implementations + * apt-pkg/packagemanager.{cc,h}: + - propergate the Immediate flag to make hitting the + "E: Internal Error, Could not perform immediate configuration (2)" + harder [ Chris Cheney ] * ftparchive/contents.cc: -- cgit v1.2.3-70-g09d2 From 110277098f846c98cbb1f155fe7d53ecca64cc1a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 3 Jan 2008 13:46:54 +0100 Subject: add missing changelog entry --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 4f22e9d92..52625ee2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -47,6 +47,8 @@ apt (0.7.10) UNRELEASED; urgency=low - propergate the Immediate flag to make hitting the "E: Internal Error, Could not perform immediate configuration (2)" harder + * debian/control: + - build against libdb-dev (instead of libdb4.4-dev) [ Chris Cheney ] * ftparchive/contents.cc: -- cgit v1.2.3-70-g09d2 From 760d4968005c97f0d5fd6403633f367aac89c763 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 7 Jan 2008 16:47:40 +0100 Subject: * move the ListUpdate() code from cachefile.h into algorithms.{cc,h} as it does not require a cachefile at all --- apt-pkg/algorithms.cc | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++- apt-pkg/algorithms.h | 3 ++ apt-pkg/cachefile.cc | 74 ------------------------------------------------- apt-pkg/cachefile.h | 1 - cmdline/apt-get.cc | 2 +- debian/changelog | 2 +- 6 files changed, 80 insertions(+), 78 deletions(-) (limited to 'debian') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 158f9c258..6e2b97557 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -19,7 +19,7 @@ #include #include #include - +#include #include #include @@ -1302,3 +1302,77 @@ void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List) } /*}}}*/ +// CacheFile::ListUpdate - update the cache files /*{{{*/ +// --------------------------------------------------------------------- +/* This is a simple wrapper to update the cache. it will fetch stuff + * from the network (or any other sources defined in sources.list) + */ +bool ListUpdate(pkgAcquireStatus &Stat, + pkgSourceList &List, + int PulseInterval) +{ + pkgAcquire::RunResult res; + pkgAcquire Fetcher(&Stat); + + // Populate it with the source selection + if (List.GetIndexes(&Fetcher) == false) + return false; + + // Run scripts + RunScripts("APT::Update::Pre-Invoke"); + + // check arguments + if(PulseInterval>0) + res = Fetcher.Run(PulseInterval); + else + res = Fetcher.Run(); + + if (res == pkgAcquire::Failed) + 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(); + + _error->Warning(_("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 + // Keep "APT::Get::List-Cleanup" name for compatibility, but + // this is really a global option for the APT library now + if (!TransientNetworkFailure && !Failed && + (_config->FindB("APT::Get::List-Cleanup",true) == true || + _config->FindB("APT::List-Cleanup",true) == true)) + { + if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false || + Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false) + // something went wrong with the clean + return false; + } + + 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.")); + + + // Run the scripts if all was fine + RunScripts("APT::Update::Post-Invoke"); + return true; +} + /*}}}*/ diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index b72874d8e..defaed57d 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -33,6 +33,7 @@ #include #include +#include #include @@ -130,5 +131,7 @@ bool pkgAllUpgrade(pkgDepCache &Cache); bool pkgMinimizeUpgrade(pkgDepCache &Cache); void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List); + +bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0); #endif diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index 22eac2f60..1a84aea54 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -109,80 +109,6 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock) } /*}}}*/ -// CacheFile::ListUpdate - update the cache files /*{{{*/ -// --------------------------------------------------------------------- -/* This is a simple wrapper to update the cache. it will fetch stuff - * from the network (or any other sources defined in sources.list) - */ -bool pkgCacheFile::ListUpdate(pkgAcquireStatus &Stat, - pkgSourceList &List, - int PulseInterval) -{ - pkgAcquire::RunResult res; - pkgAcquire Fetcher(&Stat); - - // Populate it with the source selection - if (List.GetIndexes(&Fetcher) == false) - return false; - - // Run scripts - RunScripts("APT::Update::Pre-Invoke"); - - // check arguments - if(PulseInterval>0) - res = Fetcher.Run(PulseInterval); - else - res = Fetcher.Run(); - - if (res == pkgAcquire::Failed) - 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 - // Keep "APT::Get::List-Cleanup" name for compatibility, but - // this is really a global option for the APT library now - if (!TransientNetworkFailure && !Failed && - (_config->FindB("APT::Get::List-Cleanup",true) == true || - _config->FindB("APT::List-Cleanup",true) == true)) - { - if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false || - Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false) - // something went wrong with the clean - return false; - } - - 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.")); - - - // Run the scripts if all was fine - RunScripts("APT::Update::Post-Invoke"); - return true; -} - /*}}}*/ // CacheFile::Close - close the cache files /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 8408af996..3b057951c 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -47,7 +47,6 @@ class pkgCacheFile bool BuildCaches(OpProgress &Progress,bool WithLock = true); bool Open(OpProgress &Progress,bool WithLock = true); - bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0); void Close(); pkgCacheFile(); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 5f46dd605..258133c19 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1374,7 +1374,7 @@ bool DoUpdate(CommandLine &CmdL) // do the work CacheFile Cache; - bool res = Cache.ListUpdate(Stat, List); + bool res = ListUpdate(Stat, List); // Rebuild the cache. if (Cache.BuildCaches() == false) diff --git a/debian/changelog b/debian/changelog index ee5384c42..9f78d5916 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,7 +50,7 @@ apt (0.7.10) UNRELEASED; urgency=low * debian/control: - build against libdb-dev (instead of libdb4.4-dev) * merged the apt--DoListUpdate branch, this provides a common interface - for apt-get update like operations for the frontends and also provides + for "apt-get update" like operations for the frontends and also provides hooks to run stuff in APT::Update::{Pre,Post}-Invoke [ Chris Cheney ] -- cgit v1.2.3-70-g09d2