summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:06 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:06 +0000
commit3b5421b4c75f5c85b48cbb61bf22642ff52a6352 (patch)
tree1c2b393ca91c645c2b324eb20bf9c5492dbd1519 /apt-pkg/acquire.cc
parent303a1703ca47c78f2b5ff6887ba6a10907465874 (diff)
Start on acquire stuff
Author: jgg Date: 1998-10-20 02:39:12 GMT Start on acquire stuff
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc58
1 files changed, 56 insertions, 2 deletions
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 <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
+#include <strutl.h>
/*}}}*/
// 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;
+}
+ /*}}}*/