Opened 8 years ago

Closed 7 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:
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 8 years ago.
0001-HaikuDepot-populate-the-web-app-repository-code-into-b.patch (28.5 KB ) - added by apl-haiku 8 years ago.
0001-HaikuDepot-populate-the-web-app-repository-code-into-b2.patch (28.5 KB ) - added by apl-haiku 8 years ago.
sshot.png (7.3 KB ) - added by apl-haiku 8 years ago.
Screenshot of the loopdloop with icon and screenshot.

Download all attachments as: .zip

Change History (28)

comment:1 by apl-haiku, 8 years ago

patch: 01

comment:2 by apl-haiku, 8 years ago

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 by stippi, 8 years ago

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 by apl-haiku, 8 years ago

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 by stippi, 8 years ago

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 by apl-haiku, 8 years ago

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 by stippi, 8 years ago

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 by apl-haiku, 8 years ago

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

comment:9 by apl-haiku, 8 years ago

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

comment:10 by stippi, 8 years ago

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

comment:11 by apl-haiku, 8 years ago

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

comment:12 by bonefish, 8 years ago

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

comment:13 by apl-haiku, 8 years ago

Resolution: fixed
Status: newclosed

comment:14 by bbjimmy, 8 years ago

fixed in hrev50606

comment:15 by bbjimmy, 8 years ago

Resolution: fixed
Status: closedreopened

hrev50609 still does not show the icons or screenshots.

comment:16 by apl-haiku, 8 years ago

Try delete ~/config/cache/HaikuDepot first.

Version 0, edited 8 years ago by apl-haiku (next)

comment:17 by bbjimmy, 8 years ago

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

comment:18 by apl-haiku, 8 years ago

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.

by apl-haiku, 8 years ago

Attachment: sshot.png added

Screenshot of the loopdloop with icon and screenshot.

comment:19 by humdinger, 8 years ago

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 by apl-haiku, 8 years ago

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.

in reply to:  20 comment:21 by humdinger, 8 years ago

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 by apl-haiku, 8 years ago

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 by bbjimmy, 7 years ago

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 by humdinger, 7 years ago

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