summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-12-19 14:07:51 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-12-19 14:07:51 +0100
commit27da8141d21cfbfc29675510737ee05bdfd4a2b1 (patch)
tree008e311e4c24dbfce3f47643d962cfa67a333a68 /cmdline
parent386566e36bedb453eb6f914e8e14fd555a2bf111 (diff)
parent6fd947bd48449652edf783cfb1362391e63f9be1 (diff)
merged from lp:~donkult/apt/experimental
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc2
-rw-r--r--cmdline/apt-config.cc16
-rw-r--r--cmdline/apt-extracttemplates.h10
3 files changed, 23 insertions, 5 deletions
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
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<std::string>::const_iterator a = archs.begin(); a != archs.end(); ++a)
_config->Set("APT::Architectures::", *a);
+ std::vector<APT::Configuration::Compressor> const compressors = APT::Configuration::getCompressors();
+ _config->Clear("APT::Compressor");
+ string conf = "APT::Compressor::";
+ for (std::vector<APT::Configuration::Compressor>::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<std::string>::const_iterator a = c->CompressArgs.begin(); a != c->CompressArgs.end(); ++a)
+ _config->Set(comp + "CompressArg::", *a);
+ for (std::vector<std::string>::const_iterator a = c->UncompressArgs.begin(); a != c->UncompressArgs.end(); ++a)
+ _config->Set(comp + "UncompressArg::", *a);
+ }
+
// Match the operation
CmdL.DispatchArg(Cmds);
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 <apt-pkg/pkgcache.h>
#include <apt-pkg/dirstream.h>
+#include <string>
+
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;