- // 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;
+ // load the order setting into our vector
+ std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
+ for (std::vector<std::string>::const_iterator o = order.begin();
+ o != order.end(); o++) {
+ if ((*o).empty() == true)
+ continue;
+ // ignore types we have no method ready to use
+ if (_config->Exists(string("Acquire::CompressionTypes::").append(*o)) == false)
+ continue;
+ // ignore types we have no app ready to use
+ string const appsetting = string("Dir::Bin::").append(*o);
+ if (_config->Exists(appsetting) == true) {
+ std::string const app = _config->FindFile(appsetting.c_str(), "");
+ if (app.empty() == false && FileExists(app) == false)
+ continue;
+ }
+ types.push_back(*o);