[haiku-bugs] Re: [Haiku] #15230: Unable to add / remove repositories

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Mon, 05 Aug 2019 13:43:13 -0000

#15230: Unable to add / remove repositories
--------------------------------+----------------------------
   Reporter:  kallisti5         |      Owner:  nobody
       Type:  bug               |     Status:  new
   Priority:  critical          |  Milestone:  Unscheduled
  Component:  Kits/Package Kit  |    Version:  R1/Development
 Resolution:                    |   Keywords:  pkgman
 Blocked By:                    |   Blocking:
Has a Patch:  0                 |   Platform:  All
--------------------------------+----------------------------
Description changed by kallisti5:

Old description:

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

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 :-(

New description:

 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 :-(

--

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15230#comment:2>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: