From 76b580bed96aaf0174ca81ba8ed2c4b54226ad85 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 24 Jun 2015 22:13:51 +0200 Subject: remove the longtime deprecated vendor{,list} stuff History suggests that this comes from an earlier apt-secure implementation, but never really became a thing, totally unused and marked as deprecated for "ages" now. Especially as it did nothing even if it would have been used (libapt itself didn't use it at all). --- apt-pkg/vendorlist.cc | 164 -------------------------------------------------- 1 file changed, 164 deletions(-) delete mode 100644 apt-pkg/vendorlist.cc (limited to 'apt-pkg/vendorlist.cc') diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc deleted file mode 100644 index db5b87fc0..000000000 --- a/apt-pkg/vendorlist.cc +++ /dev/null @@ -1,164 +0,0 @@ -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include - -// The whole vendor system is deprecated -APT_IGNORE_DEPRECATED_PUSH - -#include -#include - -using std::string; -using std::vector; - -pkgVendorList::~pkgVendorList() -{ - for (vector::const_iterator I = VendorList.begin(); - I != VendorList.end(); ++I) - delete *I; -} - -// pkgVendorList::ReadMainList - Read list of known package vendors /*{{{*/ -// --------------------------------------------------------------------- -/* This also scans a directory of vendor files similar to apt.conf.d - which can contain the usual suspects of distribution provided data. - The APT config mechanism allows the user to override these in their - configuration file. */ -bool pkgVendorList::ReadMainList() -{ - Configuration Cnf; - - string CnfFile = _config->FindDir("Dir::Etc::vendorparts"); - if (DirectoryExists(CnfFile) == true) - if (ReadConfigDir(Cnf,CnfFile,true) == false) - return false; - CnfFile = _config->FindFile("Dir::Etc::vendorlist"); - if (RealFileExists(CnfFile) == true) - if (ReadConfigFile(Cnf,CnfFile,true) == false) - return false; - - return CreateList(Cnf); -} - /*}}}*/ -bool pkgVendorList::Read(string File) /*{{{*/ -{ - Configuration Cnf; - if (ReadConfigFile(Cnf,File,true) == false) - return false; - - return CreateList(Cnf); -} - /*}}}*/ -bool pkgVendorList::CreateList(Configuration& Cnf) /*{{{*/ -{ - for (vector::const_iterator I = VendorList.begin(); - I != VendorList.end(); ++I) - delete *I; - VendorList.erase(VendorList.begin(),VendorList.end()); - - const Configuration::Item *Top = Cnf.Tree("Vendor"); - for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next) - { - Configuration Block(Top); - string VendorID = Top->Tag; - vector *Fingerprints = new vector; - struct Vendor::Fingerprint *Fingerprint = new struct Vendor::Fingerprint(); - string Origin = Block.Find("Origin"); - - Fingerprint->Print = Block.Find("Fingerprint"); - Fingerprint->Description = Block.Find("Name"); - Fingerprints->push_back(Fingerprint); - - if (Fingerprint->Print.empty() || Fingerprint->Description.empty()) - { - _error->Error(_("Vendor block %s contains no fingerprint"), VendorID.c_str()); - delete Fingerprints; - continue; - } - if (_config->FindB("Debug::sourceList", false)) - std::cerr << "Adding vendor with ID: " << VendorID - << " Fingerprint: " << Fingerprint->Print << std::endl; - - VendorList.push_back(new Vendor(VendorID, Origin, Fingerprints)); - } - - /* Process 'group-key' type sections */ - Top = Cnf.Tree("group-key"); - for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next) - { -// Configuration Block(Top); -// vector Fingerprints; -// string VendorID = Top->Tag; - -// while (Block->Next) -// { -// struct Vendor::Fingerprint Fingerprint = new struct Vendor::Fingerprint; -// Fingerprint->Print = Block.Find("Fingerprint"); -// Fingerprint->Description = Block.Find("Name"); -// if (Fingerprint->print.empty() || Fingerprint->Description.empty()) -// { -// _error->Error(_("Vendor block %s is invalid"), -// Vendor->VendorID.c_str()); -// delete Fingerprint; -// break; -// } -// Block = Block->Next->Next; -// } -// if (_error->PendingError()) -// { -// for (vector ::iterator I = Fingerprints.begin(); -// I != Fingerprints.end(); I++) -// delete *I; -// delete Fingerprints; -// continue; -// } - -// VendorList.push_back(new Vendor(VendorID, Fingerprints)); - } - - return !_error->PendingError(); -} - /*}}}*/ -const Vendor* pkgVendorList::LookupFingerprint(string Fingerprint) /*{{{*/ -{ - for (const_iterator I = VendorList.begin(); I != VendorList.end(); ++I) - { - if ((*I)->LookupFingerprint(Fingerprint) != "") - return *I; - } - - return NULL; -} - /*}}}*/ -const Vendor* pkgVendorList::FindVendor(const std::vector GPGVOutput) /*{{{*/ -{ - for (std::vector::const_iterator I = GPGVOutput.begin(); I != GPGVOutput.end(); ++I) - { - string::size_type pos = (*I).find("VALIDSIG "); - if (_config->FindB("Debug::Vendor", false)) - std::cerr << "Looking for VALIDSIG in \"" << (*I) << "\": pos " << pos << std::endl; - if (pos != std::string::npos) - { - string Fingerprint = (*I).substr(pos+sizeof("VALIDSIG")); - if (_config->FindB("Debug::Vendor", false)) - std::cerr << "Looking for \"" << Fingerprint << "\" in vendor..." << std::endl; - const Vendor* vendor = this->LookupFingerprint(Fingerprint); - if (vendor != NULL) - return vendor; - } - } - - return NULL; -} - /*}}}*/ - -APT_IGNORE_DEPRECATED_POP -- cgit v1.2.3