- Configuration Cnf;
-
- string CnfFile = _config->FindDir("Dir::Etc::vendorparts");
- if (FileExists(CnfFile) == true)
- if (ReadConfigDir(Cnf,CnfFile,true) == false)
- return false;
- CnfFile = _config->FindFile("Dir::Etc::vendorlist");
- if (FileExists(CnfFile) == true)
- if (ReadConfigFile(Cnf,CnfFile,true) == false)
- return false;
-
- // Process 'simple-key' type sections
- const Configuration::Item *Top = Cnf.Tree("simple-key");
- for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next)
- {
- Configuration Block(Top);
- Vendor *Vendor;
-
- Vendor = new pkgSourceList::Vendor;
-
- Vendor->VendorID = Top->Tag;
- Vendor->FingerPrint = Block.Find("Fingerprint");
- Vendor->Description = Block.Find("Name");
-
- if (Vendor->FingerPrint.empty() == true ||
- Vendor->Description.empty() == true)
- {
- _error->Error(_("Vendor block %s is invalid"), Vendor->VendorID.c_str());
- delete Vendor;
- continue;
- }
-
- VendorList.push_back(Vendor);
- }
-
- /* XXX Process 'group-key' type sections
- This is currently faked out so that the vendors file format is
- parsed but nothing is done with it except check for validity */
- Top = Cnf.Tree("group-key");
- for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next)
- {
- Configuration Block(Top);
- Vendor *Vendor;
-
- Vendor = new pkgSourceList::Vendor;
-
- Vendor->VendorID = Top->Tag;
- Vendor->Description = Block.Find("Name");
-
- if (Vendor->Description.empty() == true)
- {
- _error->Error(_("Vendor block %s is invalid"),
- Vendor->VendorID.c_str());
- delete Vendor;
- continue;
- }
-
- VendorList.push_back(Vendor);
- }
-
- return !_error->PendingError();