From 3b5421b4c75f5c85b48cbb61bf22642ff52a6352 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:51:06 +0000 Subject: Start on acquire stuff Author: jgg Date: 1998-10-20 02:39:12 GMT Start on acquire stuff --- apt-pkg/acquire.cc | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to '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; +} + /*}}}*/ -- cgit v1.2.3-70-g09d2