Opened 5 years ago

Last modified 5 years ago

#15230 closed bug

Unable to add / remove repositories — at Version 2

Reported by: kallisti5 Owned by: nobody
Priority: critical Milestone: R1/beta2
Component: Kits/Package Kit Version: R1/Development
Keywords: pkgman Cc: ttcoder
Blocked By: Blocking:
Platform: All

Description (last modified by kallisti5)

After https://git.haiku-os.org/haiku/commit/src/kits/package?id=dfbf1c8a0ac59206efcf819b420fbbb5bcf55251, it's not possible to "add repositories" to Haiku.

Error: Failed to open repository file "/boot/system/cache/package-repositories/Haiku": No such file or directory

This is the responsible change:

diff --git a/src/kits/package/RefreshRepositoryRequest.cpp b/src/kits/package/RefreshRepositoryRequest.cpp
index 300c1e481e..da23156f9b 100644
--- a/src/kits/package/RefreshRepositoryRequest.cpp
+++ b/src/kits/package/RefreshRepositoryRequest.cpp
@@ -74,7 +74,11 @@ BRefreshRepositoryRequest::CreateInitialJobs()
 
 	BRepositoryCache repoCache;
 	BPackageRoster roster;
-	roster.GetRepositoryCache(fRepoConfig.Name(), &repoCache);
+	result = roster.GetRepositoryCache(fRepoConfig.Name(), &repoCache);
+	if (result != B_OK) {
+		delete fetchChecksumJob;
+		return result;
+	}
 
 	ValidateChecksumJob* validateChecksumJob
 		= new (std::nothrow) ValidateChecksumJob(fContext,

While the error checks in that commit are correct, it seems the functionality of creating repository caches depends on "erroring out loading the cache file"

The ReaderImpl won't create repositories if they are missing. I had a partial fix adding a WriterImpl if the Cache doesn't exist, but a KDL in the network stack killed my git tree and lost my stash data :-(

Change History (2)

comment:1 by kallisti5, 5 years ago

Until this is fixed, I would recommend *NOT* removing the "Haiku" repository. It creates a situation where you can't get future updates without a lot of manual hacking to the Repo caches.

comment:2 by kallisti5, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.