[haiku-commits] Change in haiku[master]: Package Kit: Delete downloads failing the checksum check

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 10 Jan 2021 17:06:29 +0000

From Stephan Aßmus <superstippi@xxxxxx>:

Stephan Aßmus has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3619 ;)


Change subject: Package Kit: Delete downloads failing the checksum check
......................................................................

Package Kit: Delete downloads failing the checksum check

Change-Id: I3a7a914ea88e7b7b5bcc79160f46a9b4fcbba01b
---
M src/kits/package/manager/PackageManager.cpp
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/19/3619/1

diff --git a/src/kits/package/manager/PackageManager.cpp 
b/src/kits/package/manager/PackageManager.cpp
index f3607b0..8c9830b 100644
--- a/src/kits/package/manager/PackageManager.cpp
+++ b/src/kits/package/manager/PackageManager.cpp
@@ -594,6 +594,11 @@
                                status_t error = DownloadPackage(url, entry,
                                        package->Info().Checksum());
                                if (error != B_OK) {
+                                       if (error == B_BAD_DATA) {
+                                               // B_BAD_DATA is returned when 
there is a checksum mismatch
+                                               // Make sure this download is 
not re-used.
+                                               entry.Remove();
+                                       }
                                        DIE(error, "Failed to download package 
%s",
                                                
package->Info().Name().String());
                                }

--
To view, visit https://review.haiku-os.org/c/haiku/+/3619
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I3a7a914ea88e7b7b5bcc79160f46a9b4fcbba01b
Gerrit-Change-Number: 3619
Gerrit-PatchSet: 1
Gerrit-Owner: Stephan Aßmus <superstippi@xxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: Package Kit: Delete downloads failing the checksum check - Gerrit