diff options
author | bubulle@debian.org <> | 2007-04-21 22:21:43 +0200 |
---|---|---|
committer | bubulle@debian.org <> | 2007-04-21 22:21:43 +0200 |
commit | f6c03f1e14b0e37e8dd06c215b1ae6d5b0799c7b (patch) | |
tree | 559c186838d425e53a5b4c3fcbd2165bb4c6883f /apt-pkg/acquire.cc | |
parent | 72c52e774bb0564302617b8aec2f6e24215fd31d (diff) | |
parent | bc50fc3013aa4454d10376888e4ccc24d35de334 (diff) |
Merge with Michael
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r-- | apt-pkg/acquire.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index fff1b2b6a..e1dccf25a 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -193,9 +193,9 @@ void pkgAcquire::Enqueue(ItemDesc &Item) Item.Owner->Status = Item::StatIdle; // Queue it into the named queue - I->Enqueue(Item); - ToFetch++; - + if(I->Enqueue(Item)) + ToFetch++; + // Some trace stuff if (Debug == true) { @@ -549,11 +549,17 @@ pkgAcquire::Queue::~Queue() // Queue::Enqueue - Queue an item to the queue /*{{{*/ // --------------------------------------------------------------------- /* */ -void pkgAcquire::Queue::Enqueue(ItemDesc &Item) +bool pkgAcquire::Queue::Enqueue(ItemDesc &Item) { QItem **I = &Items; - for (; *I != 0; I = &(*I)->Next); - + // move to the end of the queue and check for duplicates here + for (; *I != 0; I = &(*I)->Next) + if (Item.URI == (*I)->URI) + { + Item.Owner->Status = Item::StatDone; + return false; + } + // Create a new item QItem *Itm = new QItem; *Itm = Item; @@ -563,6 +569,7 @@ void pkgAcquire::Queue::Enqueue(ItemDesc &Item) Item.Owner->QueueCounter++; if (Items->Next == 0) Cycle(); + return true; } /*}}}*/ // Queue::Dequeue - Remove an item from the queue /*{{{*/ |