[haiku-bugs] Re: [Haiku] #12917: get_package_dependencies needs to be refactored

  • From: "kallisti5" <trac@xxxxxxxxxxxx>
  • Date: Sat, 03 Sep 2016 02:34:52 -0000

#12917: get_package_dependencies needs to be refactored
--------------------------------+----------------------------
   Reporter:  kallisti5         |      Owner:  kallisti5
       Type:  enhancement       |     Status:  new
   Priority:  normal            |  Milestone:  Unscheduled
  Component:  Kits/Package Kit  |    Version:  R1/Development
 Resolution:                    |   Keywords:
 Blocked By:                    |   Blocking:
Has a Patch:  1                 |   Platform:  All
--------------------------------+----------------------------

Comment (by kallisti5):

 oh my god the layers on layers. It's like a Java developer decided to make
 a movie called "C++ inception"

 ok, after a lot of scratching, clawing, and blank C++ exceptions I ended
 up here:

 src/kits/manager/RepositoryBuilder.cpp
  V BSolverRepository
 src/kits/package/solver/SolverRepository.cpp
  V BPackageRoster
 src/kits/package/PackageRoster.cpp :

 {{{
 status_t
 BPackageRoster::GetRepositoryCache(const BString& name,
     BRepositoryCache* repositoryCache)
 {
     if (repositoryCache == NULL)
         return B_BAD_VALUE;

     // user path has higher precedence than common path
     BPath path;
     status_t result = GetUserRepositoryCachePath(&path);
     if (result != B_OK)
         return result;
     path.Append(name.String());

     BEntry repoCacheEntry(path.Path());
     if (repoCacheEntry.Exists())
         return repositoryCache->SetTo(repoCacheEntry);

     if ((result = GetCommonRepositoryCachePath(&path, true)) != B_OK)
         return result;
     path.Append(name.String());

     repoCacheEntry.SetTo(path.Path());
     return repositoryCache->SetTo(repoCacheEntry);
 }
 }}}

 Which looks like a dead end.  No attempts to get remote repository caches
 based on the url provided in the RepositoryConfig.

 Not sure at this point if that function should or should not attempt to
 fetch a remote RepositoryCache.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12917#comment:10>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: