From 29d0b55e368aa2ae26ad61f7ecd60b723a3a4e05 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 31 Jul 2009 15:50:19 +0200 Subject: [apt-pkg/sourcelist.cc] only display the warning about missing sources.list file, if no SourceListEntry exists (e.g. sources.list.d dir does not exists or it exists but does not include a .list-file with valid entries) --- apt-pkg/sourcelist.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 47a08ad90..85a20f0b8 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -157,10 +157,15 @@ bool pkgSourceList::ReadMainList() // CNC:2003-11-28 - Entries in sources.list have priority over // entries in sources.list.d. string Main = _config->FindFile("Dir::Etc::sourcelist"); + string noSourceMsg; if (FileExists(Main) == true) Res &= ReadAppend(Main); else + { + // only print the warning if we can't load a valid sourcefile in the end _error->WarningE("FileExists",_("Unable to read %s"),Main.c_str()); + _error->PopMessage(noSourceMsg); + } string Parts = _config->FindDir("Dir::Etc::sourceparts"); if (FileExists(Parts) == true) @@ -168,6 +173,9 @@ bool pkgSourceList::ReadMainList() else _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str()); + if (SrcList.empty() == true && noSourceMsg.empty() == false) + _error->Warning(noSourceMsg.c_str()); + return Res; } /*}}}*/ -- cgit v1.2.3 From d95cf70db1c0cc7d80d862b826ea67ac70c3e92d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 31 Jul 2009 20:42:06 +0200 Subject: [apt-pkg/contrib/strutl.cc] enable thousand separator according to the current locale. Patch from Luca Bruno (Closes: #223712) --- apt-pkg/contrib/strutl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index a991b8988..1683868c8 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -304,13 +304,13 @@ string SizeToStr(double Size) { if (ASize < 100 && I != 0) { - sprintf(S,"%.1f%c",ASize,Ext[I]); + sprintf(S,"%'.1f%c",ASize,Ext[I]); break; } if (ASize < 10000) { - sprintf(S,"%.0f%c",ASize,Ext[I]); + sprintf(S,"%'.0f%c",ASize,Ext[I]); break; } ASize /= 1000.0; -- cgit v1.2.3 From 40e7fe0e053129c28c59acc79e94cc10e89e7738 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Aug 2009 14:31:40 +0200 Subject: =?UTF-8?q?[apt-pkg/contrib/fileutl.cc]=20In=20function=20ExecWait?= =?UTF-8?q?():=20fix=20compile=20warning:=20warning:=20suggest=20explicit?= =?UTF-8?q?=20braces=20to=20avoid=20ambiguous=20=E2=80=98else=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-pkg/contrib/fileutl.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index a7de09c44..4240d9f49 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -451,10 +451,12 @@ bool ExecWait(pid_t Pid,const char *Name,bool Reap) if (Reap == true) return false; if (WIFSIGNALED(Status) != 0) + { if( WTERMSIG(Status) == SIGSEGV) return _error->Error(_("Sub-process %s received a segmentation fault."),Name); else return _error->Error(_("Sub-process %s received signal %u."),Name, WTERMSIG(Status)); + } if (WIFEXITED(Status) != 0) return _error->Error(_("Sub-process %s returned an error code (%u)"),Name,WEXITSTATUS(Status)); -- cgit v1.2.3 From cfb3d242ded4b9d3e5f4f55a3139561fe78155db Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 8 Aug 2009 12:25:48 +0200 Subject: [apt-pkg/indexcopy.cc] fix a (hypothetical) memory leak then the Release file not exists, patch from George Danchev, thanks! (Closes: #511556) --- apt-pkg/indexcopy.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 15696585a..0142d7dbe 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -592,7 +592,10 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, // a Release.gpg without a Release should never happen if(!FileExists(*I+"Release")) + { + delete MetaIndex; continue; + } // verify the gpg signature of "Release" -- cgit v1.2.3 From e85b4cd500cc96a8ce0d35c5e63fe274bed5b917 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 00:52:26 +0200 Subject: Add a Acquire::CompressionTypes config variable from there the acquire-items choose which compression file they should (try first to) download to easily add new or change the order of the compression types. And because it is easy now we directly add builtin lzma support. The compression ratio is better than bzip2 but we prefer the later for now as no (official) mirror uses lzma, so this would only generate useless hits on the servers. Maybe sometime in the future lzma will be the default... [apt-pkg/acquire-item.cc] - use configsettings for dynamic compression type use and order. Based on a patch by Jyrki Muukkonen, thanks! (LP: #71746) [apt-pkg/init.cc] - add default configuration for compression types and add lzma support. Order is now bzip2, lzma, gzip, none (Closes: #510526) [ftparchive/writer.cc] - add lzma support also here, patch for this (and inspiration for the one above) by Robert Millan, thanks! --- apt-pkg/acquire-item.cc | 79 ++++++++++++++++++++++++++++++------------------- apt-pkg/acquire-item.h | 10 ++----- apt-pkg/init.cc | 24 ++++++++++++++- 3 files changed, 75 insertions(+), 38 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 39ae327cb..ffbe66d7d 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -551,13 +551,24 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, if(comprExt.empty()) { // autoselect the compression method - if(FileExists("/bin/bzip2")) - CompressionExtension = ".bz2"; - else - CompressionExtension = ".gz"; - } else { - CompressionExtension = (comprExt == "plain" ? "" : comprExt); + Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + + const char dirBin[] = "Dir::Bin::"; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Tag.empty() == true || Opts->Value.empty() == true) + continue; + const string bin = _config->FindFile(string(dirBin).append(Opts->Value).c_str(),""); + if (bin != "" && !FileExists(bin)) + continue; + comprExt = '.' + Opts->Tag; + break; + } } + CompressionExtension = ((comprExt == "plain" || comprExt == ".") ? "" : comprExt); + Desc.URI = URI + CompressionExtension; Desc.Description = URIDesc; @@ -584,24 +595,32 @@ string pkgAcqIndex::Custom600Headers() /*}}}*/ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/ { - bool descChanged = false; - // no .bz2 found, retry with .gz - if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") { - Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; - - new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc, - ExpectedHash, string(".gz")); - descChanged = true; - } - // no .gz found, retry with uncompressed - else if(Desc.URI.substr(Desc.URI.size()-2) == "gz") { - Desc.URI = Desc.URI.substr(0,Desc.URI.size()-2); + Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + + const char dirBin[] = "Dir::Bin::"; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Tag.empty() == true || Opts->Value.empty() == true) + continue; + + // jump over all already checked compression types + const unsigned int nameLen = Desc.URI.size() - Opts->Tag.size(); + if(Desc.URI.substr(nameLen) != Opts->Tag || Opts->Next == 0) + continue; + + // check if we need an external binary for this compression type + const string bin = _config->FindFile(string(dirBin).append(Opts->Next->Value).c_str(),""); + if (bin != "" && !FileExists(bin)) + continue; + + // retry with the next extension + Desc.URI = Desc.URI.substr(0, nameLen) + Opts->Next->Tag; + + new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc, + ExpectedHash, string(".").append(Opts->Next->Tag)); - new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc, - ExpectedHash, string("plain")); - descChanged = true; - } - if (descChanged) { Status = StatDone; Complete = false; Dequeue(); @@ -698,11 +717,11 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash, Local = true; string compExt = flExtension(flNotDir(URI(Desc.URI).Path)); - const char *decompProg; - if(compExt == "bz2") - decompProg = "bzip2"; - else if(compExt == "gz") - decompProg = "gzip"; + string decompProg; + + // get the binary name for your used compression type + decompProg = _config->Find(string("Acquire::CompressionTypes::").append(compExt),""); + if(decompProg.empty() == false); // flExtensions returns the full name if no extension is found // this is why we have this complicated compare operation here // FIMXE: add a new flJustExtension() that return "" if no @@ -717,9 +736,9 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash, Decompression = true; DestFile += ".decomp"; - Desc.URI = string(decompProg) + ":" + FileName; + Desc.URI = decompProg + ":" + FileName; QueueURI(Desc); - Mode = decompProg; + Mode = decompProg.c_str(); } /*}}}*/ // AcqIndexTrans::pkgAcqIndexTrans - Constructor /*{{{*/ diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 36a926a0f..3f073de5b 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -540,7 +540,9 @@ class pkgAcqIndex : public pkgAcquire::Item * * \param compressExt The compression-related extension with which * this index file should be downloaded, or "" to autodetect - * (".bz2" is used if bzip2 is installed, ".gz" otherwise). + * Compression types can be set with config Acquire::CompressionTypes, + * default is ".lzma" or ".bz2" (if the needed binaries are present) + * fallback is ".gz" or none. */ pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesc, HashString ExpectedHash, string compressExt=""); @@ -569,12 +571,6 @@ class pkgAcqIndexTrans : public pkgAcqIndex * \param URIDesc A "URI-style" description of this index file. * * \param ShortDesc A brief description of this index file. - * - * \param ExpectedHash The expected hashsum of this index file. - * - * \param compressExt The compression-related extension with which - * this index file should be downloaded, or "" to autodetect - * (".bz2" is used if bzip2 is installed, ".gz" otherwise). */ pkgAcqIndexTrans(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesc); diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 63caade36..46017bf0c 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -103,7 +103,29 @@ bool pkgInitConfig(Configuration &Cnf) if (Res == false) return false; - + + // we load all config files, now check the configs and setup post-defaults: + // * check for CompressionTypes setup + { + Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + bool foundLzma=false, foundBzip2=false, foundGzip=false; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Value == "lzma") foundLzma = true; + else if (Opts->Value == "bz2") foundBzip2 = true; + else if (Opts->Value == "gz") foundGzip = true; + } + if (!foundBzip2) Cnf.Set("Acquire::CompressionTypes::bz2","bzip2"); + if (!foundLzma) Cnf.Set("Acquire::CompressionTypes::lzma","lzma"); + if (!foundGzip) Cnf.Set("Acquire::CompressionTypes::gz","gzip"); + Cnf.CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); + Cnf.CndSet("Dir::Bin::bzip2", "/bin/bzip2"); + } + + + if (Cnf.FindB("Debug::pkgInitConfig",false) == true) Cnf.Dump(); -- cgit v1.2.3 From 83cb4069352c9e30482dcbb75a5c60de26a3cf90 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Aug 2009 01:07:54 +0200 Subject: With the introduction of the Is{Delete,Install}Ok hooks the apt flag --ignore-hold only works partly: The holds are to strongly enforced in these hooks - this commit brings the old (and expected) behaviour back. [apt-pkg/depcache.cc] - restore the --ignore-hold effect in the Is{Delete,Install}Ok hooks --- apt-pkg/depcache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 13abbe5ed..228750b74 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -823,7 +823,7 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge, bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge, unsigned long Depth, bool FromUser) { - if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold) + if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold && _config->FindB("APT::Ignore-Hold",false) == false) { if (DebugMarker == true) std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl; @@ -1085,7 +1085,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, bool pkgDepCache::IsInstallOk(PkgIterator const &Pkg,bool AutoInst, unsigned long Depth, bool FromUser) { - if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold) + if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold && _config->FindB("APT::Ignore-Hold",false) == false) { if (DebugMarker == true) std::clog << OutputInDepth(Depth) << "Hold prevents MarkInstall of " << Pkg << " FU=" << FromUser << std::endl; -- cgit v1.2.3 From e878aedb8b53b311295a2df55ce5e865b1ad92b9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Aug 2009 15:32:40 +0200 Subject: "backport" the APT::Configuration class to apt-sid We can use it to simplify the internal code to operate with Acquire::CompressionTypes group. This also made it possible to set this setting with the -o flag. --- apt-pkg/acquire-item.cc | 62 ++++++++++++++--------------------- apt-pkg/aptconfiguration.cc | 78 +++++++++++++++++++++++++++++++++++++++++++++ apt-pkg/aptconfiguration.h | 46 ++++++++++++++++++++++++++ apt-pkg/init.cc | 22 ------------- apt-pkg/makefile | 5 +-- 5 files changed, 151 insertions(+), 62 deletions(-) create mode 100644 apt-pkg/aptconfiguration.cc create mode 100644 apt-pkg/aptconfiguration.h (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index ffbe66d7d..94341c81a 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -15,6 +15,7 @@ // Include Files /*{{{*/ #include #include +#include #include #include #include @@ -551,21 +552,11 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, if(comprExt.empty()) { // autoselect the compression method - Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); - if (Opts != 0) - Opts = Opts->Child; - - const char dirBin[] = "Dir::Bin::"; - for (; Opts != 0; Opts = Opts->Next) - { - if (Opts->Tag.empty() == true || Opts->Value.empty() == true) - continue; - const string bin = _config->FindFile(string(dirBin).append(Opts->Value).c_str(),""); - if (bin != "" && !FileExists(bin)) - continue; - comprExt = '.' + Opts->Tag; - break; - } + std::vector types = APT::Configuration::getCompressionTypes(); + if (types.empty() == true) + comprExt = "plain"; + else + comprExt = "." + types[0]; } CompressionExtension = ((comprExt == "plain" || comprExt == ".") ? "" : comprExt); @@ -595,36 +586,31 @@ string pkgAcqIndex::Custom600Headers() /*}}}*/ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/ { - Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); - if (Opts != 0) - Opts = Opts->Child; + std::vector types = APT::Configuration::getCompressionTypes(); - const char dirBin[] = "Dir::Bin::"; - for (; Opts != 0; Opts = Opts->Next) + for (std::vector::const_iterator t = types.begin(); + t != types.end(); t++) { - if (Opts->Tag.empty() == true || Opts->Value.empty() == true) + // jump over all already tried compression types + const unsigned int nameLen = Desc.URI.size() - (*t).size(); + if(Desc.URI.substr(nameLen) != *t) continue; - // jump over all already checked compression types - const unsigned int nameLen = Desc.URI.size() - Opts->Tag.size(); - if(Desc.URI.substr(nameLen) != Opts->Tag || Opts->Next == 0) - continue; - - // check if we need an external binary for this compression type - const string bin = _config->FindFile(string(dirBin).append(Opts->Next->Value).c_str(),""); - if (bin != "" && !FileExists(bin)) - continue; + // we want to try it with the next extension + t++; - // retry with the next extension - Desc.URI = Desc.URI.substr(0, nameLen) + Opts->Next->Tag; + if (t != types.end()) + { + Desc.URI = Desc.URI.substr(0, nameLen) + *t; - new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc, - ExpectedHash, string(".").append(Opts->Next->Tag)); + new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc, + ExpectedHash, string(".").append(*t)); - Status = StatDone; - Complete = false; - Dequeue(); - return; + Status = StatDone; + Complete = false; + Dequeue(); + return; + } } // on decompression failure, remove bad versions in partial/ diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc new file mode 100644 index 000000000..1a8e8262f --- /dev/null +++ b/apt-pkg/aptconfiguration.cc @@ -0,0 +1,78 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ###################################################################### + + Provide access methods to various configuration settings, + setup defaults and returns validate settings. + + ##################################################################### */ + /*}}}*/ +// Include Files /*{{{*/ +#include +#include +#include + +#include +#include + /*}}}*/ +namespace APT { +// getCompressionTypes - Return Vector of usbale compressiontypes /*{{{*/ +// --------------------------------------------------------------------- +/* return a vector of compression types in the prefered order. */ +std::vector +const Configuration::getCompressionTypes(bool const &Cached) { + static std::vector types; + if (types.empty() == false) { + if (Cached == true) + return types; + else + types.clear(); + } + + // Set default application paths to check for optional compression types + _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); + _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2"); + + ::Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); + if (Opts != 0) + Opts = Opts->Child; + + // at first, move over the options to setup at least the default options + bool foundLzma=false, foundBzip2=false, foundGzip=false; + for (; Opts != 0; Opts = Opts->Next) { + if (Opts->Value == "lzma") + foundLzma = true; + else if (Opts->Value == "bz2") + foundBzip2 = true; + else if (Opts->Value == "gz") + foundGzip = true; + } + + // setup the defaults now + if (!foundBzip2) + _config->Set("Acquire::CompressionTypes::bz2","bzip2"); + if (!foundLzma) + _config->Set("Acquire::CompressionTypes::lzma","lzma"); + if (!foundGzip) + _config->Set("Acquire::CompressionTypes::gz","gzip"); + + // move again over the option tree to finially calculate our result + ::Configuration::Item const *Types = _config->Tree("Acquire::CompressionTypes"); + if (Types != 0) + Types = Types->Child; + + for (; Types != 0; Types = Types->Next) { + string const appsetting = string("Dir::Bin::").append(Types->Value); + // ignore compression types we have no app ready to use + if (appsetting.empty() == false && _config->Exists(appsetting) == true) { + std::string const app = _config->FindFile(appsetting.c_str(), ""); + if (app.empty() == false && FileExists(app) == false) + continue; + } + types.push_back(Types->Tag); + } + + return types; +} + /*}}}*/ +} diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h new file mode 100644 index 000000000..6a123adce --- /dev/null +++ b/apt-pkg/aptconfiguration.h @@ -0,0 +1,46 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/** \class APT::Configuration + * \brief Provide access methods to various configuration settings + * + * This class and their methods providing a layer around the usual access + * methods with _config to ensure that settings are correct and to be able + * to set defaults without the need to recheck it in every method again. + */ + /*}}}*/ +#ifndef APT_CONFIGURATION_H +#define APT_CONFIGURATION_H +// Include Files /*{{{*/ +#include +#include + /*}}}*/ +namespace APT { +class Configuration { /*{{{*/ +public: /*{{{*/ + /** \brief Returns a vector of usable Compression Types + * + * Files can be compressed in various ways to decrease the size of the + * download. Therefore the Acquiremethods support a few compression types + * and some archives provide also a few different types. This option + * group exists to give the user the choice to prefer one type over the + * other (some compression types are very resource intensive - great if you + * have a limited download, bad if you have a really lowpowered hardware.) + * + * This method ensures that the defaults are set and checks at runtime + * if the type can be used. E.g. the current default is to prefer bzip2 + * over lzma and gz - if the bzip2 binary is not available it has not much + * sense in downloading the bz2 file, therefore we will not return bz2 as + * a usable compression type. The availability is checked with the settings + * in the Dir::Bin group. + * + * \param Cached saves the result so we need to calculated it only once + * this parameter should ony be used for testing purposes. + * + * \return a vector of (all) Language Codes in the prefered usage order + */ + std::vector static const getCompressionTypes(bool const &Cached = true); + /*}}}*/ +}; + /*}}}*/ +} +#endif diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 46017bf0c..15efb1a3d 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -104,28 +104,6 @@ bool pkgInitConfig(Configuration &Cnf) if (Res == false) return false; - // we load all config files, now check the configs and setup post-defaults: - // * check for CompressionTypes setup - { - Configuration::Item const *Opts = _config->Tree("Acquire::CompressionTypes"); - if (Opts != 0) - Opts = Opts->Child; - bool foundLzma=false, foundBzip2=false, foundGzip=false; - for (; Opts != 0; Opts = Opts->Next) - { - if (Opts->Value == "lzma") foundLzma = true; - else if (Opts->Value == "bz2") foundBzip2 = true; - else if (Opts->Value == "gz") foundGzip = true; - } - if (!foundBzip2) Cnf.Set("Acquire::CompressionTypes::bz2","bzip2"); - if (!foundLzma) Cnf.Set("Acquire::CompressionTypes::lzma","lzma"); - if (!foundGzip) Cnf.Set("Acquire::CompressionTypes::gz","gzip"); - Cnf.CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); - Cnf.CndSet("Dir::Bin::bzip2", "/bin/bzip2"); - } - - - if (Cnf.FindB("Debug::pkgInitConfig",false) == true) Cnf.Dump(); diff --git a/apt-pkg/makefile b/apt-pkg/makefile index 92ef58967..679d97e70 100644 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@ -34,14 +34,15 @@ SOURCE+= pkgcache.cc version.cc depcache.cc \ acquire-worker.cc acquire-method.cc init.cc clean.cc \ srcrecords.cc cachefile.cc versionmatch.cc policy.cc \ pkgsystem.cc indexfile.cc pkgcachegen.cc acquire-item.cc \ - indexrecords.cc vendor.cc vendorlist.cc cdrom.cc indexcopy.cc + indexrecords.cc vendor.cc vendorlist.cc cdrom.cc indexcopy.cc \ + aptconfiguration.cc HEADERS+= algorithms.h depcache.h pkgcachegen.h cacheiterators.h \ orderlist.h sourcelist.h packagemanager.h tagfile.h \ init.h pkgcache.h version.h progress.h pkgrecords.h \ acquire.h acquire-worker.h acquire-item.h acquire-method.h \ clean.h srcrecords.h cachefile.h versionmatch.h policy.h \ pkgsystem.h indexfile.h metaindex.h indexrecords.h vendor.h \ - vendorlist.h cdrom.h indexcopy.h + vendorlist.h cdrom.h indexcopy.h aptconfiguration.h # Source code for the debian specific components # In theory the deb headers do not need to be exported.. -- cgit v1.2.3