diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-09-17 09:17:49 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-09-17 09:17:49 +0200 |
commit | 715c65de1f132aff9f040f0640e985018e4b564e (patch) | |
tree | 950287c865870b2b3f678d099d2ad2e212a2862c /apt-pkg/acquire.cc | |
parent | 60323ed7fde01e8c013616e2d428bf9718f2fbc7 (diff) |
use pkgAcqMetaBase as the transactionManager
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r-- | apt-pkg/acquire.cc | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index be4e494e0..9060d492b 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -169,75 +169,6 @@ void pkgAcquire::Remove(Item *Itm) } } /*}}}*/ -// Acquire::AbortTransaction - Remove a transaction /*{{{*/ -void pkgAcquire::AbortTransaction(unsigned long TransactionID) -{ - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "AbortTransaction: " << TransactionID << std::endl; - - std::vector<Item*> Transaction; - for (ItemIterator I = Items.begin(); I != Items.end(); ++I) - if((*I)->TransactionID == TransactionID) - Transaction.push_back(*I); - - for (std::vector<Item*>::iterator I = Transaction.begin(); - I != Transaction.end(); ++I) - { - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << " Cancel: " << (*I)->DestFile << std::endl; - // the transaction will abort, so stop anything that is idle - if ((*I)->Status == pkgAcquire::Item::StatIdle) - (*I)->Status = pkgAcquire::Item::StatDone; - } -} - /*}}}*/ -bool pkgAcquire::TransactionHasError(unsigned long TransactionID) -{ - std::vector<Item*> Transaction; - for (ItemIterator I = Items.begin(); I != Items.end(); ++I) - if((*I)->TransactionID == TransactionID) - if((*I)->Status != pkgAcquire::Item::StatDone && - (*I)->Status != pkgAcquire::Item::StatIdle) - return true; - - return false; -} -// Acquire::CommitTransaction - Commit a transaction /*{{{*/ -void pkgAcquire::CommitTransaction(unsigned long TransactionID) -{ - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "CommitTransaction: " << TransactionID << std::endl; - - std::vector<Item*> Transaction; - for (ItemIterator I = Items.begin(); I != Items.end(); ++I) - if((*I)->TransactionID == TransactionID) - Transaction.push_back(*I); - - // move new files into place *and* remove files that are not - // part of the transaction but are still on disk - for (std::vector<Item*>::iterator I = Transaction.begin(); - I != Transaction.end(); ++I) - { - if((*I)->PartialFile != "") - { - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "mv " - << (*I)->PartialFile << " -> " - << (*I)->DestFile << std::endl; - Rename((*I)->PartialFile, (*I)->DestFile); - chmod((*I)->DestFile.c_str(),0644); - } else { - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "rm " - << (*I)->DestFile << std::endl; - unlink((*I)->DestFile.c_str()); - } - // mark that this transaction is finished - (*I)->TransactionID = 0; - } -} - /*}}}*/ - // Acquire::Add - Add a worker /*{{{*/ // --------------------------------------------------------------------- /* A list of workers is kept so that the select loop can direct their FD |