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.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 5b6b3940c..4c26f79b8 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -16,6 +16,7 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/init.h>
#include <config.h>
#include <apti18n.h>
#include <algorithm>
@@ -333,7 +334,7 @@ bool PackageMap::GenContents(Configuration &Setup,
gettimeofday(&StartTime,0);
// Create a package writer object.
- ContentsWriter Contents("");
+ ContentsWriter Contents("", Arch);
if (PkgExt.empty() == false && Contents.SetExts(PkgExt) == false)
return _error->Error(_("Package extension list is too long"));
if (_error->PendingError() == true)
@@ -606,7 +607,7 @@ bool SimpleGenPackages(CommandLine &CmdL)
// Create a package writer object.
PackagesWriter Packages(_config->Find("APT::FTPArchive::DB"),
- Override, "");
+ Override, "", _config->Find("APT::FTPArchive::Architecture"));
if (_error->PendingError() == true)
return false;
@@ -629,7 +630,7 @@ bool SimpleGenContents(CommandLine &CmdL)
return ShowHelp(CmdL);
// Create a package writer object.
- ContentsWriter Contents(_config->Find("APT::FTPArchive::DB"));
+ ContentsWriter Contents(_config->Find("APT::FTPArchive::DB"), _config->Find("APT::FTPArchive::Architecture"));
if (_error->PendingError() == true)
return false;
@@ -910,6 +911,7 @@ int main(int argc, const char *argv[])
{0,"delink","APT::FTPArchive::DeLinkAct",0},
{0,"readonly","APT::FTPArchive::ReadOnlyDB",0},
{0,"contents","APT::FTPArchive::Contents",0},
+ {'a',"arch","APT::FTPArchive::Architecture",CommandLine::HasArg},
{'c',"config-file",0,CommandLine::ConfigFile},
{'o',"option",0,CommandLine::ArbItem},
{0,0,0,0}};
@@ -924,7 +926,7 @@ int main(int argc, const char *argv[])
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
- if (CmdL.Parse(argc,argv) == false)
+ if (pkgInitConfig(*_config) == false || CmdL.Parse(argc,argv) == false)
{
_error->DumpErrors();
return 100;