Parcourir la source

run acquire transactions only once

Transactions are run and completed from multiple places, so it happens
for unsigned repos that the Release file was commited even if it was
previously aborted (due to --no-allow-insecure-repositories). The reason
is simply that the "failure" of getting an InRelease/Release.gpg is
currently ignored, so that the acquire process believes that nothing bad
happened and commits the transaction even though the same transaction
was previously aborted.
David Kalnischkies il y a 11 ans
Parent
commit
12796fa241
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      apt-pkg/acquire-item.cc

+ 2 - 0
apt-pkg/acquire-item.cc

@@ -1571,6 +1571,7 @@ void pkgAcqMetaBase::AbortTransaction()
             Rename(PartialFile, PartialFile + ".FAILED");
             Rename(PartialFile, PartialFile + ".FAILED");
       }
       }
    }
    }
+   Transaction.clear();
 }
 }
 									/*}}}*/
 									/*}}}*/
 // AcqMetaBase::TransactionHasError - Check for errors in Transaction	/*{{{*/
 // AcqMetaBase::TransactionHasError - Check for errors in Transaction	/*{{{*/
@@ -1617,6 +1618,7 @@ void pkgAcqMetaBase::CommitTransaction()
       // mark that this transaction is finished
       // mark that this transaction is finished
       (*I)->TransactionManager = 0;
       (*I)->TransactionManager = 0;
    }
    }
+   Transaction.clear();
 }
 }
 									/*}}}*/
 									/*}}}*/
 // AcqMetaBase::TransactionStageCopy - Stage a file for copying		/*{{{*/
 // AcqMetaBase::TransactionStageCopy - Stage a file for copying		/*{{{*/