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

  • From: "kallisti5" <trac@xxxxxxxxxxxx>
  • Date: Thu, 18 Aug 2016 22:38:51 -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:  0                 |   Platform:  All
--------------------------------+----------------------------

Comment (by kallisti5):

 Replying to [comment:3 bonefish]:

Replying to [ticket:12917 kallisti5]:
It appears the entire reason the url exists in the repo file
 (BRepositoryInfo blob) is to appease the get_package_dependencies binary.

I wrote get_package_dependencies after Oliver had already implemented
 the repository handling and after we already had a basic Haiku repository.
 I don't think he had that particular tool in mind originally. IIRC the URL
 in the repository info simply identifies the repository. A mirror would
 contain the same URL, with the nice side effect that also provides a
 pointer to the original respository.

The requirements of get_package_dependencies could be greatly cleaned
 up.

Which requirements?

 The requirement for the repo.info and repo to know where they will exist
 ahead of time... it's ridiculous to have a package repository "need to
 know" where it will exist ahead of time... no other repo has this
 requirement *AND* the url in repo.info / repo is '''only''' used for
 get_package_dependencies.

 As for the mirror scenario... lets just use a UUID or something in
 repo.info plus a last updated timestamp in repo.

**Current Behaviour**

get_package_dependencies takes in the following arguments:
  * Several binary local repo files which contain the url, and repo
 package inventory
  * These are pretty much http://packages.haiku-
 os.org/haikuports/master/repo/x86_64/current/repo generated from
 http://packages.haiku-
 os.org/haikuports/master/repo/x86_64/current/repo.info.

No, they are not the "current" repositories. You need to understand that
 the Haiku git repository '''defines''' the HaikuPorts package
 repositories. This provides us with the ability to build an old Haiku
 revision with the same packages repositories they matched originally. If
 you start building against the "current" repositories, you'll lose this
 build stability.

 There have been multiple people commenting on how much of a pain it
 requiring code updates to Haiku any time a HaikuPorts package is updated.
 We have pretty advanced versioning schematics in the package definitions
 already... lets put them to good use.


 Here is an example patch showing the changes to "completely remove url"
 from repo.info:
 
https://github.com/kallisti5/haiku/commit/df88967bf048725cadf6afb5389490204915023b

 Every instance of url in repo was cosmetic. (besides
 get_package_dependencies)

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

Other related posts: