From f5953f6155de71152c692b15b25f5dc0df9e43a4 Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Fri, 9 Aug 2019 23:08:03 -0400 Subject: [PATCH] Package Kit: Purposely ignore an error getting package cache Fixes #15230. The comment pretty much explains it. I think needing this means this code could be redesigned, but I don't know enough yet to make that fix. It also feels like this whole job system and Command pattern is overly complicated when good old functions would be fine, certainly for pkgman. But maybe this is used more heavily in HaikuDepot. --- src/kits/package/RefreshRepositoryRequest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kits/package/RefreshRepositoryRequest.cpp b/src/kits/package/RefreshRepositoryRequest.cpp index da23156f9b..d4f6d47484 100644 --- a/src/kits/package/RefreshRepositoryRequest.cpp +++ b/src/kits/package/RefreshRepositoryRequest.cpp @@ -74,11 +74,11 @@ BRefreshRepositoryRequest::CreateInitialJobs() BRepositoryCache repoCache; BPackageRoster roster; - result = roster.GetRepositoryCache(fRepoConfig.Name(), &repoCache); - if (result != B_OK) { - delete fetchChecksumJob; - return result; - } + // We purposely don't check this error, because this may be for a new repo, + // which doesn't have a cache file yet. The true passed to + // GeneralFileChecksumAccessor below will handle this case, and cause the + // repo data to be fetched and cached for the future in JobSucceeded below. + roster.GetRepositoryCache(fRepoConfig.Name(), &repoCache); ValidateChecksumJob* validateChecksumJob = new (std::nothrow) ValidateChecksumJob(fContext,