X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/303a1703ca47c78f2b5ff6887ba6a10907465874..3b5421b4c75f5c85b48cbb61bf22642ff52a6352:/apt-pkg/acquire.cc diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 9d8ae9934..ad5016b28 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire.cc,v 1.1 1998/10/15 06:59:59 jgg Exp $ +// $Id: acquire.cc,v 1.2 1998/10/20 02:39:15 jgg Exp $ /* ###################################################################### Acquire - File Acquiration @@ -14,6 +14,7 @@ #include #include #include +#include /*}}}*/ // Acquire::pkgAcquire - Constructor /*{{{*/ @@ -27,11 +28,18 @@ pkgAcquire::pkgAcquire() /*}}}*/ // Acquire::~pkgAcquire - Destructor /*{{{*/ // --------------------------------------------------------------------- -/* */ +/* Free our memory */ pkgAcquire::~pkgAcquire() { while (Items.size() != 0) delete Items[0]; + + while (Configs != 0) + { + MethodConfig *Jnk = Configs; + Configs = Configs->Next; + delete Jnk; + } } /*}}}*/ // Acquire::Add - Add a new item /*{{{*/ @@ -61,6 +69,52 @@ void pkgAcquire::Enqueue(Item *Item,string URI) { cout << "Fetching " << URI << endl; cout << " to " << Item->ToFile() << endl; + cout << " Queue is: " << QueueName(URI) << endl; +} + /*}}}*/ +// Acquire::QueueName - Return the name of the queue for this URI /*{{{*/ +// --------------------------------------------------------------------- +/* */ +string pkgAcquire::QueueName(string URI) +{ + const MethodConfig *Config = GetConfig(URIAccess(URI)); + return string(); } /*}}}*/ +// Acquire::GetConfig - Fetch the configuration information /*{{{*/ +// --------------------------------------------------------------------- +/* This locates the configuration structure for an access method. If + a config structure cannot be found a Worker will be created to + retrieve it */ +const pkgAcquire::MethodConfig *pkgAcquire::GetConfig(string Access) +{ + // Search for an existing config + MethodConfig *Conf; + for (Conf = Configs; Conf != 0; Conf = Conf->Next) + if (Conf->Access == Access) + return Conf; + + // Create the new config class + Conf = new MethodConfig; + Conf->Access = Access; + Conf->Next = Configs; + Configs = Conf; + // Create the worker to fetch the configuration + Worker Work(Conf); + if (Work.Start() == false) + return 0; + + return Conf; +} + /*}}}*/ + +// Acquire::MethodConfig::MethodConfig - Constructor /*{{{*/ +// --------------------------------------------------------------------- +/* */ +pkgAcquire::MethodConfig::MethodConfig() +{ + SingleInstance = false; + PreScan = false; +} + /*}}}*/