Przeglądaj źródła

Merge with Michael

bubulle@debian.org 19 lat temu
rodzic
commit
f6c03f1e14

+ 8 - 1
apt-pkg/acquire-item.cc

@@ -183,6 +183,7 @@ string pkgAcqIndex::Custom600Headers()
 
 void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 {
+
    // no .bz2 found, retry with .gz
    if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") {
       Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; 
@@ -194,9 +195,15 @@ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
       Complete = false;
       Dequeue();
       return;
+   } 
+   
+   // on decompression failure, remove bad versions in partial/
+   if(Decompression && Erase) {
+      string s = _config->FindDir("Dir::State::lists") + "partial/";
+      s += URItoFileName(RealURI);
+      unlink(s.c_str());
    }
 
-   
    Item::Failed(Message,Cnf);
 }
 

+ 13 - 6
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			/*{{{*/

+ 1 - 1
apt-pkg/acquire.h

@@ -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

+ 1 - 1
apt-pkg/init.h

@@ -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;

+ 1 - 1
apt-pkg/makefile

@@ -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)

+ 8 - 1
apt-pkg/policy.cc

@@ -36,6 +36,7 @@
 #include <apti18n.h>
 
 #include <iostream>
+#include <sstream>
 									/*}}}*/
 
 using namespace std;
@@ -300,7 +301,13 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
          continue;
       }
 
-      Plcy.CreatePin(Type,Name,string(Word,End),priority);
+      istringstream s(Name);
+      string pkg;
+      while(!s.eof())
+      {
+	 s >> pkg;
+         Plcy.CreatePin(Type, pkg, string(Word,End),priority);
+      };
    }
 
    Plcy.InitDefaults();

+ 21 - 2
debian/changelog

@@ -1,4 +1,4 @@
-apt (0.6.46.5) UNRELEASED; urgency=low
+apt (0.6.47) UNRELEASED; urgency=low
 
   * apt-pkg/algorithm.cc:
     - use clog for all debugging
@@ -16,7 +16,26 @@ apt (0.6.46.5) UNRELEASED; urgency=low
     - only umount if it was mounted by the method before
   * po/gl.po:
     - 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
+  * apt-pkg/policy.cc:
+    - allow multiple packages (thanks to David Foerster)
+  * merged from Christian Perrier:
+  	* mr.po: New Marathi translation  Closes: #416806
+	* zh_CN.po: Updated by Eric Pareja  Closes: #416822
+	* tl.po: Updated by Eric Pareja   Closes: #416638
+	* gl.po: Updated by Jacobo Tarrio
+	         Closes: #412828
+	* da.po: Updated by Claus Hindsgaul
+	         Closes: #409483
+	* fr.po: Remove a non-breakable space for usability
+	         issues. Closes: #408877
+	* ru.po: Updated Russian translation. Closes: #405476
+	* *.po: Unfuzzy after upstream typo corrections
+  
  -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 18 Dec 2006 19:39:05 +0100
 
 apt (0.6.46.4) unstable; urgency=high

+ 4 - 3
doc/apt_preferences.5.xml

@@ -143,10 +143,11 @@ separated by blank lines.  Records can have one of two forms, a specific form
 and a general form.
 <itemizedlist>
 <listitem>
-<simpara>The specific form assigns a priority (a "Pin-Priority") to a
-specified package and specified version or version range.  For example,
+<simpara>The specific form assigns a priority (a "Pin-Priority") to one or more
+specified packages and specified version or version range.  For example,
 the following record assigns a high priority to all versions of
-the <filename>perl</filename> package whose version number begins with "<literal>5.8</literal>".</simpara>
+the <filename>perl</filename> package whose version number begins with "<literal>5.8</literal>".
+Multiple packages can be separated by spaces.</simpara>
 
 <programlisting>
 Package: perl

+ 1 - 1
methods/makefile

@@ -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