#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>
Setup.Find("Default::Packages::Extensions",".deb").c_str());
Permissions = Setup.FindI("Default::FileMode",0644);
-
+
if (FLFile.empty() == false)
FLFile = flCombine(Setup.Find("Dir::FileListDir"),FLFile);
string DFLFile = Setup.Find("TreeDefault::FileList", "");
string DSFLFile = Setup.Find("TreeDefault::SourceFileList", "");
- bool const LongDescription = Setup.FindB("TreeDefault::LongDescription",
+ mode_t const Permissions = Setup.FindI("Default::FileMode",0644);
+
+ bool const LongDescription = Setup.FindB("Default::LongDescription",
_config->FindB("APT::FTPArchive::LongDescription", true));
+ string const TranslationCompress = Setup.Find("Default::Translation::Compress",". gzip").c_str();
// Process 'tree' type sections
const Configuration::Item *Top = Setup.Tree("tree");
{"$(SECTION)",&Section},
{"$(ARCH)",&Arch},
{}};
+ mode_t const Perms = Block.FindI("FileMode", Permissions);
bool const LongDesc = Block.FindB("LongDescription", LongDescription);
TranslationWriter *TransWriter;
if (DTrans.empty() == false && LongDesc == false)
{
string const TranslationFile = flCombine(Setup.FindDir("Dir::ArchiveDir"),
SubstVar(Block.Find("Translation", DTrans.c_str()), Vars));
- TransWriter = new TranslationWriter(TranslationFile);
+ string const TransCompress = Block.Find("Translation::Compress", TranslationCompress);
+ TransWriter = new TranslationWriter(TranslationFile, TransCompress, Perms);
}
else
TransWriter = NULL;
while (ParseQuoteWord(Archs,Arch) == true)
{
PackageMap Itm;
-
+ Itm.Permissions = Perms;
Itm.BinOverride = SubstVar(Block.Find("BinOverride"),Vars);
Itm.InternalPrefix = SubstVar(Block.Find("InternalPrefix",DIPrfx.c_str()),Vars);
/* */
void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
{
+ mode_t const Permissions = Setup.FindI("Default::FileMode",0644);
+
// Process 'bindirectory' type sections
const Configuration::Item *Top = Setup.Tree("bindirectory");
for (Top = (Top == 0?0:Top->Child); Top != 0;)
Itm.InternalPrefix = Block.Find("InternalPrefix",Top->Tag.c_str());
Itm.Contents = Block.Find("Contents");
Itm.ContentsHead = Block.Find("Contents::Header");
+ Itm.Permissions = Block.FindI("FileMode", Permissions);
Itm.GetGeneral(Setup,Block);
PkgList.push_back(Itm);
}
// close the Translation master files
- for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+ for (vector<PackageMap>::reverse_iterator I = PkgList.rbegin(); I != PkgList.rend(); I++)
if (I->TransWriter != NULL && I->TransWriter->DecreaseRefCounter() == 0)
delete I->TransWriter;
// 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;