// -*- 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 #include #include /*}}}*/ // 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()); } /*}}}*/