]> git.saurik.com Git - apt.git/commitdiff
make errors more consistent
authorMichael Vogt <mvo@debian.org>
Fri, 1 Aug 2014 15:15:53 +0000 (17:15 +0200)
committerMichael Vogt <mvo@debian.org>
Fri, 1 Aug 2014 15:15:53 +0000 (17:15 +0200)
apt-pkg/acquire.cc
test/integration/test-apt-update-rollback

index 15af5d6bdb7fe7d743908a16109e4a040f1a8028..be4e494e0d5f5caf144be6fd558862fb9bee879f 100644 (file)
@@ -185,8 +185,9 @@ void pkgAcquire::AbortTransaction(unsigned long TransactionID)
    {
       if(_config->FindB("Debug::Acquire::Transaction", false) == true)
          std::clog << "  Cancel: " << (*I)->DestFile << std::endl;
-      //Dequeue(*I);
-      (*I)->Status = pkgAcquire::Item::StatError;
+      // the transaction will abort, so stop anything that is idle
+      if ((*I)->Status == pkgAcquire::Item::StatIdle)
+         (*I)->Status = pkgAcquire::Item::StatDone;
    }
 }
                                                                        /*}}}*/
index b8a2b079105f6e244e23df052607b6eff440849f..24027787e9d461a1c08d85047f8a845850db16f7 100755 (executable)
@@ -59,9 +59,7 @@ test_inrelease_to_broken_hash_reverts_all() {
     break_repository_sources_index
 
     # test the error condition
-    testequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease  
-
-W: Failed to fetch file:${APTARCHIVE}/dists/unstable/main/source/Sources  Hash Sum mismatch
+    testequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/main/source/Sources  Hash Sum mismatch
 
 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
     # ensure that the Packages file is also rolled back
@@ -100,13 +98,7 @@ test_inreleae_to_release_reverts_all() {
     break_repository_sources_index
 
     # ensure error
-    testequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/InRelease  
-
-W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release  
-
-W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release.gpg  
-
-W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources  Hash Sum mismatch
+    testequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources  Hash Sum mismatch
 
 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq # -o Debug::acquire::transaction=1
 
@@ -133,9 +125,7 @@ E: There are problems and -y was used without --force-yes" aptget install -qq -y
     add_new_package
     break_repository_sources_index
 
-    testequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/InRelease  
-
-W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources  Hash Sum mismatch
+    testequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources  Hash Sum mismatch
 
 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq