Просмотр исходного кода

* handle network failures more gracefully (default apt sources spec)
apt-pkg/acquire-item.cc:
- on network failures (Timeout,ResolveFailure,ConnectionRefused) move the
old (known good) sigfile back and don't touch the indexfiles
cmdline/apt-get.cc:
- don't fail on apt-get update problems but issue a warning instead

Michael Vogt лет назад: 20
Родитель
Сommit
47eb38f452
4 измененных файлов с 30 добавлено и 7 удалено
  1. 7 3
      apt-pkg/acquire-item.cc
  2. 1 1
      cmdline/apt-get.cc
  3. 1 1
      configure.in
  4. 21 2
      debian/changelog

+ 7 - 3
apt-pkg/acquire-item.cc

@@ -321,8 +321,9 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
    DestFile += URItoFileName(URI);
 
-   // remove any partial downloaded sig-file. it may confuse proxies
-   // and is too small to warrant a partial download anyway
+   // remove any partial downloaded sig-file in partial/. 
+   // it may confuse proxies and is too small to warrant a 
+   // partial download anyway
    unlink(DestFile.c_str());
 
    // Create the item
@@ -389,17 +390,20 @@ void pkgAcqMetaSig::Done(string Message,unsigned long Size,string MD5,
 									/*}}}*/
 void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 {
+   string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
 
    // if we get a network error we fail gracefully
    if(LookupTag(Message,"FailReason") == "Timeout" || 
       LookupTag(Message,"FailReason") == "TmpResolveFailure" ||
       LookupTag(Message,"FailReason") == "ConnectionRefused") {
       Item::Failed(Message,Cnf);
+      // move the sigfile back on network failures (and re-authenticated?)
+      if(FileExists(DestFile))
+ 	 Rename(DestFile,Final);
       return;
    }
 
    // Delete any existing sigfile when the acquire failed
-   string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
    unlink(Final.c_str());
 
    // queue a pkgAcqMetaIndex with no sigfile

+ 1 - 1
cmdline/apt-get.cc

@@ -1381,7 +1381,7 @@ bool DoUpdate(CommandLine &CmdL)
       return false;
    
    if (Failed == true)
-      return _error->Warning(_("Some index files failed to download, they have been ignored, or old ones used instead."));
+      _error->Warning(_("Some index files failed to download, they have been ignored, or old ones used instead."));
    
    return true;
 }

+ 1 - 1
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.43.3ubuntu1")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.43.2ubuntu1")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)

+ 21 - 2
debian/changelog

@@ -1,4 +1,4 @@
-apt (0.6.43.3) unstable; urgency=low
+apt (0.6.43.2ubuntu1) dapper; urgency=low
 
   * Merge bubulle@debian.org--2005/apt--main--0 up to patch-182:
   * ca.po: Completed to 512t. Closes: #351592
@@ -26,8 +26,9 @@ apt (0.6.43.3) unstable; urgency=low
   * cmdline/apt-get.cc: only run the list-cleaner if a update was 
     successfull
   * apt-get update errors are only warnings nowdays
+  * be more careful with the signature file on network failures
 
- -- 
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 20 Feb 2006 22:27:48 +0100
 
 apt (0.6.43.2) unstable; urgency=low
 
@@ -54,6 +55,24 @@ apt (0.6.43.2) unstable; urgency=low
 
  -- Michael Vogt <mvo@debian.org>  Thu, 19 Jan 2006 00:06:33 +0100
 
+apt (0.6.43.1ubuntu1) dapper; urgency=low
+
+  * Merge bubulle@debian.org--2005/apt--main--0 up to patch-159:
+    - en_GB.po, de.po: fix spaces errors in "Ign " translations
+      Closes: #347258
+    - makefile: make update-po a pre-requisite of clean target so
+	        that POT and PO files are always up-to-date
+    - sv.po: Completed to 511t. Closes: #346450
+    - sk.po: Completed to 511t. Closes: #346369
+    - fr.po: Completed to 511t
+    - *.po: Updated from sources (511 strings)
+  * add patch to fix http download corruption problem (thanks to
+    Petr Vandrovec, closes: #280844, #290694)
+  * added APT::Periodic::Unattended-Upgrade (requires the package
+    "unattended-upgrade")
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 10 Jan 2006 17:09:31 +0100
+
 apt (0.6.43.1) unstable; urgency=low
   
   * Merge bubulle@debian.org--2005/apt--main--0 up to patch-148: