[haiku-depot-web] Re: Update; Multi-Repository

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-depot-web@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2015 12:21:26 +0200

Hi Andrew,

Am 14.10.2015 um 11:49 schrieb Andrew Lindesay:

When you have time - there is no urgency. You can get a list of the
repositories from the application server using existing API. In
java-land this is;

RepositoryApi#getRepositories(..)

The endpoint is "/api/v1/repository". The API call that HD is already
calling;

PkgApi#getBulkPkg(..)

Will return data that has the fields;

repositorySourceCode
repositoryCode

You can also specify the repositories for which you would like to get
"bulk data" using the request argument;

repositoryCodes

For repositories that are already configured on the host, you can
presumably get a list of URLs. From this list of URLs, you should be
able to work back to the repository sources (provided with
#getRepositories(..)) and then back to the repository. This approach
should be fairly straight forward.

Let me know if you need any help or directions.

Thanks! What HaikuDepot does is get a list of available packages from the OS Package Kit. This means the list will already contain only packages from repositories that the user configured as package sources (currently only via the command line pkgman). HaikuDepot records in its package model which repo a package is from. When it asks the web app about a package, it just needs to add the repositories known to Package Kit (for bulk requests) or the repository of the individual package to the requests. This info is already available and just needs to be passed to the WebInterface methods.

The functionality to learn about repositories known to the web app will be handy when implementing a feature to add new repos from within HaikuDepot. Repositories that the user would not have known about otherwise I mean. The rest of the code will then work as is.

Best regards,
-Stephan


Other related posts: