summaryrefslogtreecommitdiff
path: root/ftparchive/apt-ftparchive.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ftparchive/apt-ftparchive.cc')
-rw-r--r--ftparchive/apt-ftparchive.cc52
1 files changed, 5 insertions, 47 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index ba71ee225..692f19e25 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -62,7 +62,6 @@ struct PackageMap
// Stuff for the Package File
string PkgFile;
string BinCacheDB;
- string SrcCacheDB;
string BinOverride;
string ExtraOverride;
@@ -107,12 +106,6 @@ struct PackageMap
inline bool operator() (const PackageMap &x,const PackageMap &y)
{return x.BinCacheDB < y.BinCacheDB;};
};
-
- struct SrcDBCompare : public binary_function<PackageMap,PackageMap,bool>
- {
- inline bool operator() (const PackageMap &x,const PackageMap &y)
- {return x.SrcCacheDB < y.SrcCacheDB;};
- };
void GetGeneral(Configuration &Setup,Configuration &Block);
bool GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats);
@@ -239,14 +232,11 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats)
gettimeofday(&NewTime,0);
double Delta = NewTime.tv_sec - StartTime.tv_sec +
(NewTime.tv_usec - StartTime.tv_usec)/1000000.0;
-
+
c0out << Packages.Stats.Packages << " files " <<
/* SizeToStr(Packages.Stats.MD5Bytes) << "B/" << */
SizeToStr(Packages.Stats.Bytes) << "B " <<
TimeToStr((long)Delta) << endl;
-
- if(_config->FindB("APT::FTPArchive::ShowCacheMisses", false) == true)
- c0out << " Misses in Cache: " << Packages.Stats.Misses<< endl;
Stats.Add(Packages.Stats);
Stats.DeLinkBytes = Packages.Stats.DeLinkBytes;
@@ -273,7 +263,7 @@ bool PackageMap::GenSources(Configuration &Setup,struct CacheDB::Stats &Stats)
SrcDone = true;
// Create a package writer object.
- SourcesWriter Sources(flCombine(CacheDir, SrcCacheDB),
+ SourcesWriter Sources(_config->Find("APT::FTPArchive::DB"),
flCombine(OverrideDir,BinOverride),
flCombine(OverrideDir,SrcOverride),
flCombine(OverrideDir,SrcExtraOverride));
@@ -333,9 +323,6 @@ bool PackageMap::GenSources(Configuration &Setup,struct CacheDB::Stats &Stats)
c0out << Sources.Stats.Packages << " pkgs in " <<
TimeToStr((long)Delta) << endl;
- if(_config->FindB("APT::FTPArchive::ShowCacheMisses", false) == true)
- c0out << " Misses in Cache: " << Sources.Stats.Misses << endl;
-
Stats.Add(Sources.Stats);
Stats.DeLinkBytes = Sources.Stats.DeLinkBytes;
@@ -448,9 +435,6 @@ bool PackageMap::GenContents(Configuration &Setup,
double Delta = NewTime.tv_sec - StartTime.tv_sec +
(NewTime.tv_usec - StartTime.tv_usec)/1000000.0;
- if(_config->FindB("APT::FTPArchive::ShowCacheMisses", false) == true)
- c0out << " Misses in Cache: " << Contents.Stats.Misses<< endl;
-
c0out << Contents.Stats.Packages << " files " <<
SizeToStr(Contents.Stats.Bytes) << "B " <<
TimeToStr((long)Delta) << endl;
@@ -481,8 +465,6 @@ static void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
string DContentsH = Setup.Find("TreeDefault::Contents::Header","");
string DBCache = Setup.Find("TreeDefault::BinCacheDB",
"packages-$(ARCH).db");
- string SrcDBCache = Setup.Find("TreeDefault::SrcCacheDB",
- "sources-$(SECTION).db");
string DSources = Setup.Find("TreeDefault::Sources",
"$(DIST)/$(SECTION)/source/Sources");
string DFLFile = Setup.Find("TreeDefault::FileList", "");
@@ -542,7 +524,6 @@ static void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
Itm.Tag = SubstVar("$(DIST)/$(SECTION)/source",Vars);
Itm.FLFile = SubstVar(Block.Find("SourceFileList",DSFLFile.c_str()),Vars);
Itm.SrcExtraOverride = SubstVar(Block.Find("SrcExtraOverride"),Vars);
- Itm.SrcCacheDB = SubstVar(Block.Find("SrcCacheDB",SrcDBCache.c_str()),Vars);
}
else
{
@@ -592,7 +573,6 @@ static void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
Itm.PkgFile = Block.Find("Packages");
Itm.SrcFile = Block.Find("Sources");
Itm.BinCacheDB = Block.Find("BinCacheDB");
- Itm.SrcCacheDB = Block.Find("SrcCacheDB");
Itm.BinOverride = Block.Find("BinOverride");
Itm.ExtraOverride = Block.Find("ExtraOverride");
Itm.SrcExtraOverride = Block.Find("SrcExtraOverride");
@@ -690,10 +670,6 @@ static bool SimpleGenPackages(CommandLine &CmdL)
if (Packages.RecursiveScan(CmdL.FileList[1]) == false)
return false;
- // Give some stats if asked for
- if(_config->FindB("APT::FTPArchive::ShowCacheMisses", false) == true)
- c0out << " Misses in Cache: " << Packages.Stats.Misses<< endl;
-
return true;
}
/*}}}*/
@@ -750,10 +726,6 @@ static bool SimpleGenSources(CommandLine &CmdL)
if (Sources.RecursiveScan(CmdL.FileList[1]) == false)
return false;
- // Give some stats if asked for
- if(_config->FindB("APT::FTPArchive::ShowCacheMisses", false) == true)
- c0out << " Misses in Cache: " << Sources.Stats.Misses<< endl;
-
return true;
}
/*}}}*/
@@ -805,7 +777,6 @@ static bool Generate(CommandLine &CmdL)
// Sort by cache DB to improve IO locality.
stable_sort(PkgList.begin(),PkgList.end(),PackageMap::DBCompare());
- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare());
// Generate packages
if (CmdL.FileSize() <= 2)
@@ -965,33 +936,20 @@ static bool Clean(CommandLine &CmdL)
// Sort by cache DB to improve IO locality.
stable_sort(PkgList.begin(),PkgList.end(),PackageMap::DBCompare());
- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare());
string CacheDir = Setup.FindDir("Dir::CacheDir");
for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); )
{
- if(I->BinCacheDB != "")
- c0out << I->BinCacheDB << endl;
- if(I->SrcCacheDB != "")
- c0out << I->SrcCacheDB << endl;
+ c0out << I->BinCacheDB << endl;
CacheDB DB(flCombine(CacheDir,I->BinCacheDB));
- CacheDB DB_SRC(flCombine(CacheDir,I->SrcCacheDB));
if (DB.Clean() == false)
_error->DumpErrors();
- if (DB_SRC.Clean() == false)
- _error->DumpErrors();
string CacheDB = I->BinCacheDB;
- string SrcCacheDB = I->SrcCacheDB;
- while(I != PkgList.end() &&
- I->BinCacheDB == CacheDB &&
- I->SrcCacheDB == SrcCacheDB)
- ++I;
-
+ for (; I != PkgList.end() && I->BinCacheDB == CacheDB; ++I);
}
-
-
+
return true;
}
/*}}}*/