commit e5acedbe6c0395bbdeae33debd9d523c837ec398
parent eb24962768785d42f5f83a41037a94d8b91f5616
Author: cfillion <cfillion@users.noreply.github.com>
Date: Fri, 18 Dec 2015 15:52:40 -0500
don't report rollback errors
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/pkgtransaction.cpp b/src/pkgtransaction.cpp
@@ -101,7 +101,10 @@ void PackageTransaction::commit()
RemoveFile(targetPath);
if(RenameFile(tempPath, targetPath)) {
- m_transaction->addError(strerror(errno), targetPath);
+ m_transaction->addError(strerror(errno), tempPath);
+
+ // it's a bit late to rollback here as some files might already have been
+ // overwritten. at least we can delete the temporary files
rollback();
return;
}
@@ -116,8 +119,7 @@ void PackageTransaction::rollback()
for(const PathPair &paths : m_files) {
const string tempPath = m_transaction->prefixPath(paths.first).join();
- if(RemoveFile(tempPath))
- m_transaction->addError(strerror(errno), tempPath);
+ RemoveFile(tempPath);
}
m_files.clear();