summaryrefslogtreecommitdiff
path: root/ftparchive/writer.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-02-18 15:39:03 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-02-18 15:39:03 +0100
commit113942be71c90e7d6a9cff93cc05ac119db526de (patch)
tree2872bfb8c3b12dc8f9fe9e1622ddffeea528d4e6 /ftparchive/writer.cc
parentb9dacd11a4707092f070d49b1cb1acff642eebf0 (diff)
parent3c5a611808e7af5aec4c2ab12ce0bce79f74928d (diff)
merge from the lp:~donkult/apt/sid branch
Diffstat (limited to 'ftparchive/writer.cc')
-rw-r--r--ftparchive/writer.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 18a3de0c2..9e5b7d4f3 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -54,7 +54,7 @@ inline void SetTFRewriteData(struct TFRewriteData &tfrd,
// FTWScanner::FTWScanner - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-FTWScanner::FTWScanner()
+FTWScanner::FTWScanner(string const &Arch): Arch(Arch)
{
ErrorPrinted = false;
NoLinkAct = !_config->FindB("APT::FTPArchive::DeLinkAct",true);
@@ -299,12 +299,11 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
// ---------------------------------------------------------------------
/* */
PackagesWriter::PackagesWriter(string const &DB,string const &Overrides,string const &ExtOverrides,
- string const &aArch) :
- Db(DB),Stats(Db.Stats), Arch(aArch)
+ string const &Arch) :
+ FTWScanner(Arch), Db(DB), Stats(Db.Stats)
{
Output = stdout;
- SetExts(".deb .udeb .foo .bar .baz");
- AddPattern("*.deb");
+ SetExts(".deb .udeb");
DeLinkLimit = 0;
// Process the command line options
@@ -340,17 +339,16 @@ bool FTWScanner::SetExts(string const &Vals)
string::size_type Start = 0;
while (Start <= Vals.length()-1)
{
- string::size_type Space = Vals.find(' ',Start);
- string::size_type Length;
- if (Space == string::npos)
+ string::size_type const Space = Vals.find(' ',Start);
+ string::size_type const Length = ((Space == string::npos) ? Vals.length() : Space) - Start;
+ if ( Arch.empty() == false )
{
- Length = Vals.length()-Start;
+ AddPattern(string("*_") + Arch + Vals.substr(Start, Length));
+ AddPattern(string("*_all") + Vals.substr(Start, Length));
}
else
- {
- Length = Space-Start;
- }
- AddPattern(string("*") + Vals.substr(Start, Length));
+ AddPattern(string("*") + Vals.substr(Start, Length));
+
Start += Length + 1;
}
@@ -767,11 +765,11 @@ bool SourcesWriter::DoPackage(string FileName)
// ContentsWriter::ContentsWriter - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-ContentsWriter::ContentsWriter(string const &DB) :
- Db(DB), Stats(Db.Stats)
+ContentsWriter::ContentsWriter(string const &DB, string const &Arch) :
+ FTWScanner(Arch), Db(DB), Stats(Db.Stats)
{
- AddPattern("*.deb");
+ SetExts(".deb");
Output = stdout;
}
/*}}}*/