Open-CMSIS-Pack / cpackget

Open-CMSIS-Pack Package Installer
Apache License 2.0
23 stars 15 forks source link

[cpackget] Explicit installation may fail #357

Open ReinhardKeil opened 3 weeks ago

ReinhardKeil commented 3 weeks ago

Describe the bug

When installing a newly published pack, an error like this may appear.

cpackget add Keil::B-U585I-IOT02A_BSP@2.0.0
I: Adding pack "Keil::B-U585I-IOT02A_BSP@2.0.0"
E: pack version not found in the pdsc file

It works fine after the execution of cpackget update-index as covered in the documentation. However the UX experience could be better.

To Reproduce

Remove in the CMSIS_PACK_ROOT folder:

Execute: cpackget add Keil::B-U585I-IOT02A_BSP@2.0.0

As a user you get this line from the web portal, and you perhaps don't know that cpackget update-index should be executed first.

Expected Behavior

Execute: cpackget add Keil::B-U585I-IOT02A_BSP@2.0.0 should install a published pack without errors.

This may require some changes.

Envrionment:

jkrech commented 1 week ago

When installing a public pack, the index.pidx needs to be opened. a) if index.pidx does not exist, invoke the behavior of cpackget init https://www.keil.com/pack/index.pidx -> bail out on error b) if index.pidx exists - open index.pidx and read <timestamp> c) if <timestamp> date is smaller than host date invoke behavior of capckget update-index --sparse -> bail out on error d) now continue with the behavior of cpackget add packID, locating pack in index.pidx, downloading pdsc file if version in index is higher than version in pdsc file. e) reading pdsc file <releases> section to find latest or specified version. If no version match found bail out. f) read url attribute from release tag or construct download url from elements <url> <vendor> <name> version . pack