- if (stat((List[I] + Name).c_str(),&Buf) != 0 &&
- stat((List[I] + Name + ".gz").c_str(),&Buf) != 0)
- _error->Errno("stat","Failed to stat %s%s",List[I].c_str(),
- Name);
- Inodes[I] = Buf.st_ino;
+ std::vector<std::string> types = APT::Configuration::getCompressionTypes();
+ types.push_back("");
+ for (std::vector<std::string>::const_iterator t = types.begin();
+ t != types.end(); ++t)
+ {
+ std::string filename = List[I] + Name;
+ if ((*t).size() > 0)
+ filename.append("." + *t);
+ if (stat(filename.c_str(), &Buf) != 0)
+ _error->Errno("stat","Failed to stat %s%s",List[I].c_str(),
+ Name);
+ Inodes[I] = Buf.st_ino;
+ }