| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: acquire-item.cc,v 1.2 1998/10/20 02:39:12 jgg Exp $
- /* ######################################################################
- Acquire Item - Item to acquire
- Each item can download to exactly one file at a time. This means you
- cannot create an item that fetches two uri's to two files at the same
- time. The pkgAcqIndex class creates a second class upon instantiation
- to fetch the other index files because of this.
-
- ##################################################################### */
- /*}}}*/
- // Include Files /*{{{*/
- #ifdef __GNUG__
- #pragma implementation "apt-pkg/acquire-item.h"
- #endif
- #include <apt-pkg/acquire-item.h>
- #include <apt-pkg/configuration.h>
- #include <strutl.h>
- /*}}}*/
- // Acquire::Item::Item - Constructor /*{{{*/
- // ---------------------------------------------------------------------
- /* */
- pkgAcquire::Item::Item(pkgAcquire *Owner) : Owner(Owner), QueueCounter(0)
- {
- Owner->Add(this);
- }
- /*}}}*/
- // Acquire::Item::~Item - Destructor /*{{{*/
- // ---------------------------------------------------------------------
- /* */
- pkgAcquire::Item::~Item()
- {
- Owner->Remove(this);
- }
- /*}}}*/
- // AcqIndex::AcqIndex - Constructor /*{{{*/
- // ---------------------------------------------------------------------
- /* The package file is added to the queue and a second class is
- instantiated to fetch the revision file */
- pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location) :
- Item(Owner), Location(Location)
- {
- QueueURI(Location->PackagesURI() + ".gz");
- Description = Location->PackagesInfo();
-
- new pkgAcqIndexRel(Owner,Location);
- }
- /*}}}*/
- // pkgAcqIndex::ToFile - File to write the download to /*{{{*/
- // ---------------------------------------------------------------------
- /* */
- string pkgAcqIndex::ToFile()
- {
- string PartialDir = _config->FindFile("Dir::State::lists") + "/partial/";
-
- return PartialDir + URItoFileName(Location->PackagesURI());
- }
- /*}}}*/
- // AcqIndexRel::pkgAcqIndexRel - Constructor /*{{{*/
- // ---------------------------------------------------------------------
- /* The Release file is added to the queue */
- pkgAcqIndexRel::pkgAcqIndexRel(pkgAcquire *Owner,
- const pkgSourceList::Item *Location) :
- Item(Owner), Location(Location)
- {
- QueueURI(Location->ReleaseURI());
- Description = Location->ReleaseInfo();
- }
- /*}}}*/
- // AcqIndexRel::ToFile - File to write the download to /*{{{*/
- // ---------------------------------------------------------------------
- /* */
- string pkgAcqIndexRel::ToFile()
- {
- string PartialDir = _config->FindFile("Dir::State::lists") + "/partial/";
-
- return PartialDir + URItoFileName(Location->ReleaseURI());
- }
- /*}}}*/
|