* [ABI] apt-pkg/acquire.{cc,h}:
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 17 Apr 2007 13:33:19 +0000 (15:33 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 17 Apr 2007 13:33:19 +0000 (15:33 +0200)
  - deal better with duplicated sources.list entries (avoid
    double queuing of  URLs) - this fixes hangs in bzip/gzip

apt-pkg/acquire.cc
apt-pkg/acquire.h
apt-pkg/init.h
apt-pkg/makefile
debian/changelog
methods/makefile

index fff1b2b..e1dccf2 100644 (file)
@@ -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                      /*{{{*/
index 27bb3d3..1d5daf1 100644 (file)
@@ -173,7 +173,7 @@ class pkgAcquire::Queue
    public:
    
    // Put an item into this queue
-   void Enqueue(ItemDesc &Item);
+   bool Enqueue(ItemDesc &Item);
    bool Dequeue(Item *Owner);
 
    // Find a Queued item
index 8255b40..b584b2c 100644 (file)
@@ -18,7 +18,7 @@
 
 // See the makefile
 #define APT_PKG_MAJOR 3
-#define APT_PKG_MINOR 11
+#define APT_PKG_MINOR 12
 #define APT_PKG_RELEASE 0
     
 extern const char *pkgVersion;
index 7e5feae..c493d3d 100644 (file)
@@ -13,7 +13,7 @@ include ../buildlib/defaults.mak
 # methods/makefile - FIXME
 LIBRARY=apt-pkg
 LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-MAJOR=3.11
+MAJOR=3.12
 MINOR=0
 SLIBS=$(PTHREADLIB) $(INTLLIBS)
 APT_DOMAIN:=libapt-pkg$(MAJOR)
index 1786bdf..8b566e5 100644 (file)
@@ -18,6 +18,9 @@ apt (0.6.47) UNRELEASED; urgency=low
     - fix error translation that causes trouble to lsb_release
   * apt-pkg/acquire-item.cc:
     - if decompression of a index fails, delete the index 
+  * [ABI] apt-pkg/acquire.{cc,h}:
+    - deal better with duplicated sources.list entries (avoid
+      double queuing of  URLs) - this fixes hangs in bzip/gzip
 
  -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 18 Dec 2006 19:39:05 +0100
 
index 1e3b1ef..3f561a2 100644 (file)
@@ -7,7 +7,7 @@ include ../buildlib/defaults.mak
 BIN := $(BIN)/methods
 
 # FIXME..
-LIB_APT_PKG_MAJOR = 3.11
+LIB_APT_PKG_MAJOR = 3.12
 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR)
 
 # The file method