Opened 3 years ago

Closed 3 years ago

#12793 closed enhancement (fixed)

add screenshot and icon from third party depots

Reported by: bbjimmy Owned by: stippi
Priority: normal Milestone: Unscheduled
Component: Applications/HaikuDepot Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

in the haiku-depot-web mailing list, in the "Malformed URLs in Packages" thread on Sat, May 21, 2016, Andrew Lindesay wrote:

The HaikuDepotServer (HDS) application server system already provides the APIs that are required for HaikuDepot (HD) desktop application to access information and package-data for multiple repositories, but at this point in time, HD only obtains data for the "HaikuPorts" repository. If somebody would like to undertake this work with HD, I would be glad to help explain how the HDS APIs provide the data required to achieve this.

Attachments (4)

0001-HaikuDepot-populate-the-web-app-repository-code-into.patch (28.6 KB) - added by apl-haiku 3 years ago.
0001-HaikuDepot-populate-the-web-app-repository-code-into-b.patch (28.5 KB) - added by apl-haiku 3 years ago.
0001-HaikuDepot-populate-the-web-app-repository-code-into-b2.patch (28.5 KB) - added by apl-haiku 3 years ago.
sshot.png (7.3 KB) - added by apl-haiku 3 years ago.
Screenshot of the loopdloop with icon and screenshot.

Download all attachments as: .zip

Change History (28)

comment:1 Changed 3 years ago by apl-haiku

Has a Patch: set

comment:2 Changed 3 years ago by apl-haiku

I've just added a patch for this. The idea is that the "DepotInfo" object has picked up a code for the web-app (HDS) repository code so that it can use that in API calls to the HDS application server. The (HDS) repository is identified by searching for it using the base URL of the locally configured repository.

comment:3 Changed 3 years ago by stippi

Thanks for the patch and sorry for the late reply!

Reading through the patch, I am wondering about Model::PopulateWebAppRepositoryCode(). Why is the repository code retrieved in a while loop, overwriting the repository code in each successful iteration? Is it supposed to use the last code stored in the reply?

The rest of the patch looks good. There are a few small coding style issues which you could fix. It should be "} else {" instead of "}\nelse {" (a couple instances). And usually we don't write "if (0 == someObject.SomeCount())", but "(someObject.SomeCount() == 0)". I know why you do this, but the code is somewhat easier to read. There is no assignment supposed to be in an if-clause and the compiler will warn about these types of errors.

Again, thanks for your work! You should definitely receive commit access, I'll propose you on the developer list.

comment:4 Changed 3 years ago by apl-haiku

Hi Stephan; thank you for finding time for the feedback! I'll see if I can take a look at those code-style issues soon. In Model::PopulateWebAppRepositoryCode(), the reality is that the "items" should only contain one value actually. I'll take a look to see if I can make this more explicit or put a comment in to explain what I am doing there. Yes, commit access would be quite handy as I have a few other changes that, time permitting, I may make over the next few months.

comment:5 Changed 3 years ago by stippi

Nice! The vote on your commit access went in your favor. :-) I don't actually know who would make the changes to the server to grant you access. But I guess it should happen soon and you will be notified.

comment:6 Changed 3 years ago by apl-haiku

Hello Stephan; I've just found time to update that patch with those code-style issues that you had raised. I adjusted the "PopulateWebAppRepositoryCode()" to accommodate the expectation that only the first code need be extracted. I hope that's all OK. The only thing I wasn't sure about was string literals exceeding the 80 character limit –– is that OK? Let me know if there is anything else that needs addressing.

comment:7 Changed 3 years ago by stippi

Looks good. Thanks! The string literals can / need to be broken up like this:

printf("A very long line that exceeds "
    "the 80 char per line limit.");

comment:8 Changed 3 years ago by apl-haiku

Thanks Stephan - those lines should be wrapped in the latest patch now.

comment:9 Changed 3 years ago by apl-haiku

Hi Stephan; sorry to ping you, but could you see if that patch is ready to go now?

comment:10 Changed 3 years ago by stippi

Yes, looks fine, thanks! And sorry! Have you received your commit access already?

comment:11 Changed 3 years ago by apl-haiku

Hi Stephan; No, I have not heard from anybody about that yet.

comment:12 Changed 3 years ago by bonefish

Andrew, you should now have commit access. You still need to subscribe to haiku-commits@…, if you haven't done that yet.

comment:13 Changed 3 years ago by apl-haiku

Resolution: fixed
Status: newclosed

comment:14 Changed 3 years ago by bbjimmy

fixed in hrev50606

comment:15 Changed 3 years ago by bbjimmy

Resolution: fixed
Status: closedreopened

hrev50609 still does not show the icons or screenshots.

comment:16 Changed 3 years ago by apl-haiku

Try delete ~/config/cache/HaikuDepot first.

Last edited 3 years ago by apl-haiku (previous) (diff)

comment:17 Changed 3 years ago by bbjimmy

After deleting ~/config/cache/HaikuDepot still no icons or screenshots.

comment:18 Changed 3 years ago by apl-haiku

Hi; Ah it seems that the HD <---> HDS communications is quite slow at the moment for some reason. I've got some thoughts around that, but unfortunately it will take a while to implement. In the meantime, start the HaikuDepot application from the command line and watch the logs until it stops its setup tasks. Then check again.

Another thing to note is that HD is only working with the HVIF icons. Some packages in HDS are loaded only with bitmap icons. A good one to look at is loopdloop in the "FatElk" repository.

See attached screenshot for how this looks at my end.

If this doesn't work, grab me the first few lines of the log trace from HaikuDepot runtime output to check the repository match-up between the host system's configuration and the meta-data on the HDS system. I think we could end up with problems there in relation to the URLs changing.

Changed 3 years ago by apl-haiku

Attachment: sshot.png added

Screenshot of the loopdloop with icon and screenshot.

comment:19 Changed 3 years ago by humdinger

I also don't see icons or screenshots. This is the output after clearing the cache:

Package file not found: (null)
did assign web app repository code 'besly' to local depot 'BeSly Software Solutions'
unable to find a repository code for 'coquillemartialarts.com/fatelk/repo'
unable to find a repository code for 'http://packages.haiku-os.org/haiku/master/x86_gcc2/current'
did assign web app repository code 'haikuports' to local depot 'HaikuPorts'
unable to find a repository code for 'clasquin-johnson.co.za/michel/repo'
Fatal exception occurred while resolving system dependencies: No such file or directory, details: 
Populated package info for bashhistoryswitcher: summary, description, size, prominence
.
.
.

If I click on "beshare", I get:

PackageContentsView::_PopuplatePackageContens(): failed to init BPackageReader(/boot/system/packages/beshare-3.02-2-x86_gcc2.hpkg): No such file or directory

In HDS BeShare has a vector icon and screenshots: https://depot.haiku-os.org/#/pkg/beshare/fatelk/3/02/-/-/2/x86_gcc2 I do see comments and ratings for it.

comment:20 Changed 3 years ago by apl-haiku

Hi Humdinger;

It looks like the "FatElk" repository configured on your desktop system is not being married-up with the repository on the HDS system. On the HDS system, the repository URL is http://coquillemartialarts.com/fatelk/repo, but on your desktop system, it is coquillemartialarts.com/fatelk/repo. Can you please adjust that and try again. Check the initial log trace; this should show the repositories correlating like this;

did assign web app repository code 'besly' to local depot 'BeSly Software Solutions'
did assign web app repository code 'fatelk' to local depot 'FatElk'
unable to find a repository code for 'http://packages.haiku-os.org/haiku/master/x86_gcc2/current/'
did assign web app repository code 'haikuports' to local depot 'HaikuPorts'
did assign web app repository code 'clasqm' to local depot 'clasqm's repo'

Also, can I confirm that you let the HaikuDepot log trace complete. It takes quite a while to download all of the icons and complete the setup process.

On my system, I can see from the logs that it is getting the icons for BeShare;

Getting/Updating native icon for beshare_x86
Getting/Updating native icon for beshare
Getting/Updating native icon for beshare_info
Getting/Updating native icon for beshare_server

There are two BeShare packages and both have icons, screenshots and ratings.

comment:21 in reply to:  20 Changed 3 years ago by humdinger

Replying to apl-haiku:

It looks like the "FatElk" repository configured on your desktop system is not being married-up with the repository on the HDS system. On the HDS system, the repository URL is http://coquillemartialarts.com/fatelk/repo, but on your desktop system, it is coquillemartialarts.com/fatelk/repo.

That was it, icons and screenshots are there now! Thanks. Sorry for sending you on a wild goose chase... @bbjimmy: You should correct the instructions how to add the repo on your website http://fatelk.com/repo :)

comment:22 Changed 3 years ago by apl-haiku

I can see that there will eventually need to be some sort of a UUID on the repositories so that they can be identified in a way other than the URL because the URL might change.

comment:23 Changed 3 years ago by bbjimmy

It seems to be working now that I uae http://coquillemartialarts.com/fatelk/repo and let it tale its time to download all the icons.

comment:24 Changed 3 years ago by humdinger

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.