From 8e16d8c39447809506a8cd8e6f88cae3c168f82d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Dec 2011 17:35:54 +0100 Subject: * cmdline/apt-config.cc: - dump the APT::Compressor settings correctly and completely --- cmdline/apt-config.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 94f6ee9b0..47bedfe3f 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -134,6 +134,22 @@ int main(int argc,const char *argv[]) /*{{{*/ for (std::vector::const_iterator a = archs.begin(); a != archs.end(); ++a) _config->Set("APT::Architectures::", *a); + std::vector const compressors = APT::Configuration::getCompressors(); + _config->Clear("APT::Compressor"); + string conf = "APT::Compressor::"; + for (std::vector::const_iterator c = compressors.begin(); c != compressors.end(); ++c) + { + string comp = conf + c->Name + "::"; + _config->Set(comp + "Name", c->Name); + _config->Set(comp + "Extension", c->Extension); + _config->Set(comp + "Binary", c->Binary); + _config->Set(std::string(comp + "Cost").c_str(), c->Cost); + for (std::vector::const_iterator a = c->CompressArgs.begin(); a != c->CompressArgs.end(); ++a) + _config->Set(comp + "CompressArg::", *a); + for (std::vector::const_iterator a = c->UncompressArgs.begin(); a != c->UncompressArgs.end(); ++a) + _config->Set(comp + "UncompressArg::", *a); + } + // Match the operation CmdL.DispatchArg(Cmds); -- cgit v1.2.3 From 468720c59fcf48b20332cdb7b601b2b0d7cbbfbb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Dec 2011 19:31:36 +0100 Subject: enable FileFd to guess the compressor based on the filename if requested or to search for compressed silbings of the given filename and use this guessing instead of hardcoding Gzip compression --- cmdline/apt-cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 65d7b0ccd..1cd5080cc 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1143,7 +1143,7 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V) return _error->Error(_("Package file %s is out of sync."),I.FileName()); FileFd PkgF; - if (PkgF.Open(I.FileName(), FileFd::ReadOnlyGzip) == false) + if (PkgF.Open(I.FileName(), FileFd::ReadOnly, FileFd::Extension) == false) return false; // Read the record -- cgit v1.2.3 From 73688d27f60b2da3889a06362ee567101e3b331e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 15 Dec 2011 09:13:21 +0100 Subject: =?UTF-8?q?atleast=20libapt=20should=20announce=20to=20itself=20th?= =?UTF-8?q?at=20it=20is=20clean=E2=80=A6=20(and=20be=20it=20if=20it=20trie?= =?UTF-8?q?s=20to=20announce=20that=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmdline/apt-extracttemplates.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h index d0f90d3f4..6d07a09c2 100644 --- a/cmdline/apt-extracttemplates.h +++ b/cmdline/apt-extracttemplates.h @@ -14,6 +14,8 @@ #include #include +#include + class DebFile : public pkgDirStream { FileFd File; @@ -31,11 +33,11 @@ public: bool Go(); bool ParseInfo(); - static string GetInstalledVer(const string &package); + static std::string GetInstalledVer(const std::string &package); - string Package; - string Version; - string DepVer, PreDepVer; + std::string Package; + std::string Version; + std::string DepVer, PreDepVer; unsigned int DepOp, PreDepOp; char *Config; -- cgit v1.2.3