]> git.saurik.com Git - apt.git/commitdiff
remove the longtime deprecated vendor{,list} stuff
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 24 Jun 2015 20:13:51 +0000 (22:13 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 10 Aug 2015 15:25:26 +0000 (17:25 +0200)
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/acquire-item.h
apt-pkg/init.cc
apt-pkg/metaindex.h
apt-pkg/sourcelist.h
apt-pkg/vendor.cc [deleted file]
apt-pkg/vendor.h [deleted file]
apt-pkg/vendorlist.cc [deleted file]
apt-pkg/vendorlist.h [deleted file]

index 1cd2a6d035740f6d53643f3698f798b9d8c9b816..93d812248083c4c7299459a372fb46b9320aa924 100644 (file)
@@ -31,7 +31,6 @@
 #include <map>
 
 #ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/vendor.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/pkgrecords.h>
 #endif
index 96966b2498df49e17d12235da543f5ad7a758772..1fbb035f780e0c4e05aeed99186928acdebf0c94 100644 (file)
@@ -62,8 +62,6 @@ bool pkgInitConfig(Configuration &Cnf)
    Cnf.CndSet("Dir::Etc","etc/apt/");
    Cnf.CndSet("Dir::Etc::sourcelist","sources.list");
    Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d");
-   Cnf.CndSet("Dir::Etc::vendorlist","vendors.list");
-   Cnf.CndSet("Dir::Etc::vendorparts","vendors.list.d");
    Cnf.CndSet("Dir::Etc::main","apt.conf");
    Cnf.CndSet("Dir::Etc::netrc", "auth.conf");
    Cnf.CndSet("Dir::Etc::parts","apt.conf.d");
index d284655bfb5cf586ea353c6141050c8707610608..94aec2d1f0d79186b79bf4a45c7134b717778f76 100644 (file)
@@ -17,7 +17,6 @@ class OpProgress;
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/vendor.h>
 using std::string;
 #endif
 
index 079f3cb3d7345d6dda91169f8c86cfb0154c0ac5..d801314380db17d03f0912a338354a55161c79bc 100644 (file)
    list all you have is a list of package index files that have the ability
    to be Acquired.
    
-   The vendor machanism is similar, except the vendor types are hard 
-   wired. Before loading the source list the vendor list is loaded.
-   This doesn't load key data, just the checks to perform.
-   
    ##################################################################### */
                                                                        /*}}}*/
 #ifndef PKGLIB_SOURCELIST_H
diff --git a/apt-pkg/vendor.cc b/apt-pkg/vendor.cc
deleted file mode 100644 (file)
index d4add56..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include<config.h>
-
-#include <apt-pkg/vendor.h>
-#include <apt-pkg/configuration.h>
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <utility>
-#include <vector>
-
-Vendor::Vendor(std::string VendorID,
-               std::string Origin,
-              std::vector<struct Vendor::Fingerprint *> *FingerprintList)
-{
-   this->VendorID = VendorID;
-   this->Origin = Origin;
-   for (std::vector<struct Vendor::Fingerprint *>::iterator I = FingerprintList->begin();
-       I != FingerprintList->end(); ++I)
-   {
-      if (_config->FindB("Debug::Vendor", false))
-         std::cerr << "Vendor \"" << VendorID << "\": Mapping \""
-                  << (*I)->Print << "\" to \"" << (*I)->Description << '"' << std::endl;
-      Fingerprints[(*I)->Print] = (*I)->Description;
-   }
-   delete FingerprintList;
-}
-
-const std::string Vendor::LookupFingerprint(std::string Print) const
-{
-   std::map<std::string,std::string>::const_iterator Elt = Fingerprints.find(Print);
-   if (Elt == Fingerprints.end())
-      return "";
-   else
-      return (*Elt).second;
-}
-
-APT_CONST bool Vendor::CheckDist(std::string /*Dist*/)
-{
-   return true;
-}
diff --git a/apt-pkg/vendor.h b/apt-pkg/vendor.h
deleted file mode 100644 (file)
index 2d2e2b0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef PKGLIB_VENDOR_H
-#define PKGLIB_VENDOR_H
-#include <string>
-#include <vector>
-#include <map>
-
-#include <apt-pkg/macros.h>
-
-#ifndef APT_8_CLEANER_HEADERS
-using std::string;
-#endif
-
-// A class representing a particular software provider.
-class APT_DEPRECATED Vendor
-{
-   public:
-   struct Fingerprint
-   {
-      std::string Print;
-      std::string Description;
-   };
-
-   protected:
-   std::string VendorID;
-   std::string Origin;
-   std::map<std::string, std::string> Fingerprints;
-
-   public:
-   Vendor(std::string VendorID, std::string Origin,
-          std::vector<struct Fingerprint *> *FingerprintList);
-   virtual const std::string& GetVendorID() const { return VendorID; };
-   virtual const std::string LookupFingerprint(std::string Print) const;
-   virtual bool CheckDist(std::string Dist);
-   virtual ~Vendor(){};
-};
-
-#endif
diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
deleted file mode 100644 (file)
index db5b87f..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#include<config.h>
-
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
-
-#include <stddef.h>
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include <apti18n.h>
-
-// The whole vendor system is deprecated
-APT_IGNORE_DEPRECATED_PUSH
-
-#include <apt-pkg/vendor.h>
-#include <apt-pkg/vendorlist.h>
-
-using std::string;
-using std::vector;
-
-pkgVendorList::~pkgVendorList()
-{
-   for (vector<const Vendor *>::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 Vendor *>::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 <struct Vendor::Fingerprint *> *Fingerprints = new vector<Vendor::Fingerprint *>;
-      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<Vendor::Fingerprint *> 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 <struct Vendor::Fingerprint *>::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<string> GPGVOutput)  /*{{{*/
-{
-   for (std::vector<string>::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
diff --git a/apt-pkg/vendorlist.h b/apt-pkg/vendorlist.h
deleted file mode 100644 (file)
index bc3702a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// -*- mode: cpp; mode: fold -*-
-// Description                                                         /*{{{*/
-// $Id: vendorlist.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $
-/* ######################################################################
-
-   VendorList - Manage a list of vendors
-   
-   The Vendor List class provides access to a list of vendors and
-   attributes associated with them, read from a configuration file.
-   
-   ##################################################################### */
-                                                                       /*}}}*/
-#ifndef PKGLIB_VENDORLIST_H
-#define PKGLIB_VENDORLIST_H
-
-#include <string>
-#include <vector>
-#include <apt-pkg/macros.h>
-
-#ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/vendor.h>
-#include <apt-pkg/configuration.h>
-using std::string;
-using std::vector;
-#endif
-
-class Vendor;
-class Configuration;
-
-class APT_DEPRECATED pkgVendorList
-{
-   protected:
-   std::vector<Vendor const *> VendorList;
-
-   bool CreateList(Configuration& Cnf);
-   const Vendor* LookupFingerprint(std::string Fingerprint);
-
-   public:
-   typedef std::vector<Vendor const *>::const_iterator const_iterator;
-   bool ReadMainList();
-   bool Read(std::string File);
-
-   // List accessors
-   inline const_iterator begin() const {return VendorList.begin();};
-   inline const_iterator end() const {return VendorList.end();};
-   inline unsigned int size() const {return VendorList.size();};
-   inline bool empty() const {return VendorList.empty();};
-
-   const Vendor* FindVendor(const std::vector<std::string> GPGVOutput);
-
-   ~pkgVendorList();
-};
-
-#endif