]> git.saurik.com Git - apt.git/commitdiff
log with the failed item description, not with next try
authorDavid Kalnischkies <david@kalnischkies.de>
Sun, 14 Aug 2016 07:51:56 +0000 (09:51 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Tue, 16 Aug 2016 17:20:28 +0000 (19:20 +0200)
The failure handling frequently changes URI & Description of the failed
item to try a slightly different combination which might work, but the
logging of the failure happens only afterwards as the same failure
handling decides if this is a critical error or not so we need a backup
here instead of potentially new content.

A purely cosmetic issue, but can still be confusing for humans.

apt-pkg/acquire-worker.cc

index 7a4f8177fa609eaa9ef3a14d0a13f2ffee5c547d..aa1a2654e0a47a8e3d70c9eb09c483647e39cd59 100644 (file)
@@ -464,6 +464,7 @@ bool pkgAcquire::Worker::RunMessages()
               }
               else
               {
+                 auto SavedDesc = Owner->GetItemDesc();
                  if (isDoomedItem(Owner) == false)
                  {
                     if (Message.find("\nFailReason:") == std::string::npos)
@@ -476,7 +477,7 @@ bool pkgAcquire::Worker::RunMessages()
                     Owner->Failed(Message,Config);
                  }
                  if (Log != nullptr)
-                    Log->Fail(Owner->GetItemDesc());
+                    Log->Fail(SavedDesc);
               }
            }
            ItemDone();
@@ -524,11 +525,11 @@ bool pkgAcquire::Worker::RunMessages()
                  Owner->Status = pkgAcquire::Item::StatAuthError;
               else if (errTransient)
                  Owner->Status = pkgAcquire::Item::StatTransientNetworkError;
-
+              auto SavedDesc = Owner->GetItemDesc();
               if (isDoomedItem(Owner) == false)
                  Owner->Failed(Message,Config);
               if (Log != nullptr)
-                 Log->Fail(Owner->GetItemDesc());
+                 Log->Fail(SavedDesc);
            }
            ItemDone();