From 2e5f4e45f593535e2c88181ff7a9e2d32a5e60f9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 4 Jun 2010 14:43:03 +0200 Subject: * apt-pkg/cachefile.{cc,h}: - split Open() into submethods to be able to build only parts - make the OpProgress optional in the Cache buildprocess --- apt-pkg/deb/debindexfile.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'apt-pkg/deb/debindexfile.cc') diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index b89429d86..6d9e99497 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -262,15 +262,15 @@ unsigned long debPackagesIndex::Size() const // PackagesIndex::Merge - Load the index file into a cache /*{{{*/ // --------------------------------------------------------------------- /* */ -bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const +bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { string PackageFile = IndexFile("Packages"); FileFd Pkg(PackageFile,FileFd::ReadOnly); debListParser Parser(&Pkg, Architecture); if (_error->PendingError() == true) return _error->Error("Problem opening %s",PackageFile.c_str()); - - Prog.SubProgress(0,Info("Packages")); + if (Prog != NULL) + Prog->SubProgress(0,Info("Packages")); ::URI Tmp(URI); if (Gen.SelectFile(PackageFile,Tmp.Host,*this) == false) return _error->Error("Problem with SelectFile %s",PackageFile.c_str()); @@ -445,7 +445,7 @@ unsigned long debTranslationsIndex::Size() const // TranslationsIndex::Merge - Load the index file into a cache /*{{{*/ // --------------------------------------------------------------------- /* */ -bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const +bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { // Check the translation file, if in use string TranslationFile = IndexFile(Language); @@ -456,7 +456,8 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const if (_error->PendingError() == true) return false; - Prog.SubProgress(0, Info(TranslationFile.c_str())); + if (Prog != NULL) + Prog->SubProgress(0, Info(TranslationFile.c_str())); if (Gen.SelectFile(TranslationFile,string(),*this) == false) return _error->Error("Problem with SelectFile %s",TranslationFile.c_str()); @@ -529,7 +530,7 @@ unsigned long debStatusIndex::Size() const // StatusIndex::Merge - Load the index file into a cache /*{{{*/ // --------------------------------------------------------------------- /* */ -bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const +bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { FileFd Pkg(File,FileFd::ReadOnly); if (_error->PendingError() == true) @@ -537,8 +538,9 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const debListParser Parser(&Pkg); if (_error->PendingError() == true) return false; - - Prog.SubProgress(0,File); + + if (Prog != NULL) + Prog->SubProgress(0,File); if (Gen.SelectFile(File,string(),*this,pkgCache::Flag::NotSource) == false) return _error->Error("Problem with SelectFile %s",File.c_str()); -- cgit v1.2.3