]>
git.saurik.com Git - apt.git/blob - apt-pkg/acquire-item.cc
e92b611819540e57bc604bd4b4d2fe3710f96375
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: acquire-item.cc,v 1.2 1998/10/20 02:39:12 jgg Exp $
4 /* ######################################################################
6 Acquire Item - Item to acquire
8 Each item can download to exactly one file at a time. This means you
9 cannot create an item that fetches two uri's to two files at the same
10 time. The pkgAcqIndex class creates a second class upon instantiation
11 to fetch the other index files because of this.
13 ##################################################################### */
15 // Include Files /*{{{*/
17 #pragma implementation "apt-pkg/acquire-item.h"
19 #include <apt-pkg/acquire-item.h>
20 #include <apt-pkg/configuration.h>
24 // Acquire::Item::Item - Constructor /*{{{*/
25 // ---------------------------------------------------------------------
27 pkgAcquire::Item::Item(pkgAcquire
*Owner
) : Owner(Owner
), QueueCounter(0)
32 // Acquire::Item::~Item - Destructor /*{{{*/
33 // ---------------------------------------------------------------------
35 pkgAcquire::Item::~Item()
41 // AcqIndex::AcqIndex - Constructor /*{{{*/
42 // ---------------------------------------------------------------------
43 /* The package file is added to the queue and a second class is
44 instantiated to fetch the revision file */
45 pkgAcqIndex::pkgAcqIndex(pkgAcquire
*Owner
,const pkgSourceList::Item
*Location
) :
46 Item(Owner
), Location(Location
)
48 QueueURI(Location
->PackagesURI() + ".gz");
49 Description
= Location
->PackagesInfo();
51 new pkgAcqIndexRel(Owner
,Location
);
54 // pkgAcqIndex::ToFile - File to write the download to /*{{{*/
55 // ---------------------------------------------------------------------
57 string
pkgAcqIndex::ToFile()
59 string PartialDir
= _config
->FindFile("Dir::State::lists") + "/partial/";
61 return PartialDir
+ URItoFileName(Location
->PackagesURI());
65 // AcqIndexRel::pkgAcqIndexRel - Constructor /*{{{*/
66 // ---------------------------------------------------------------------
67 /* The Release file is added to the queue */
68 pkgAcqIndexRel::pkgAcqIndexRel(pkgAcquire
*Owner
,
69 const pkgSourceList::Item
*Location
) :
70 Item(Owner
), Location(Location
)
72 QueueURI(Location
->ReleaseURI());
73 Description
= Location
->ReleaseInfo();
76 // AcqIndexRel::ToFile - File to write the download to /*{{{*/
77 // ---------------------------------------------------------------------
79 string
pkgAcqIndexRel::ToFile()
81 string PartialDir
= _config
->FindFile("Dir::State::lists") + "/partial/";
83 return PartialDir
+ URItoFileName(Location
->ReleaseURI());