summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-04-17 16:06:50 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-04-17 16:06:50 +0200
commiteaa204a9808eb2392f4a03d703b585ba3aa3b018 (patch)
treeb879a12b3e524310d84a8d41949d5395d802da25
parenta8cdfb5aaa972f8df0016381ea7ad1be5c38a3d1 (diff)
parentc03462c6fed27e26b2bab4b3b34589fa8bf464f8 (diff)
* apt-pkg/acquire-item.cc:
- if decompression of a index fails, delete the index (LP#68202) * [internal-ABI] apt-pkg/acquire.{cc,h}: - deal better with duplicated sources.list entries (avoid double queuing of URLs) - this fixes hangs in bzip/gzip (LP#102511)
-rw-r--r--apt-pkg/acquire-item.cc9
-rw-r--r--apt-pkg/acquire.cc19
-rw-r--r--apt-pkg/acquire.h2
-rw-r--r--configure.in2
-rw-r--r--debian/changelog10
5 files changed, 31 insertions, 11 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 3be7878bf..04f0bb943 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -233,6 +233,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";
@@ -244,9 +245,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);
}
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 /*{{{*/
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 27bb3d363..1d5daf12e 100644
--- a/apt-pkg/acquire.h
+++ b/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
diff --git a/configure.in b/configure.in
index ca841df36..d9c68eb8f 100644
--- a/configure.in
+++ b/configure.in
@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.46.4ubuntu10")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.46.4ubuntu11")
PACKAGE="apt"
AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
AC_SUBST(PACKAGE)
diff --git a/debian/changelog b/debian/changelog
index a4fc708ac..0701185b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,16 @@
-apt (0.6.46.4ubuntu11) feisty; urgency=low
+apt (0.6.46.4ubuntu11) UNRELEASED; urgency=low
* po/gl.po:
- fix error in translation that causes trouble to lsb_release
(LP#79165)
+ * apt-pkg/acquire-item.cc:
+ - if decompression of a index fails, delete the index (LP#68202)
+ * [internal-ABI] apt-pkg/acquire.{cc,h}:
+ - deal better with duplicated sources.list entries (avoid
+ double queuing of URLs) - this fixes hangs in bzip/gzip
+ (LP#102511)
- --
+ -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 17 Apr 2007 15:53:37 +0200
apt (0.6.46.4ubuntu10) feisty; urgency=low