README
¶
cpackget: Open-CMSIS-Pack Package Installer
This utility allows embedded developers to install (or uninstall) Open-CMSIS-Pack software packs to their local environments.
How to get cpackget
Please visit the latest stable release page and download the binary for your system, decompress it and run the binary named cpackget in the folder.
Usage
cpackget installs packs via a CLI interface and it's intended to be easy to understand it. Here is how the command line looks like:
Usage:
cpackget [command] [flags]
Available Commands:
add Add Open-CMSIS-Pack packages
help Help about any command
init Initializes a pack root folder
list List installed packs
rm Remove Open-CMSIS-Pack packages
update-index Update the public index
Flags:
-h, --help help for cpackget
-R, --pack-root string Specifies pack root folder. Defaults to CMSIS_PACK_ROOT environment variable
-q, --quiet Run cpackget silently, printing only error messages
-v, --verbose Sets verboseness level: None (Errors + Info + Warnings), -v (all + Debugging). Specify "-q" for no messages
-V, --version Prints the version number of cpackget and exit
Use "cpackget [command] --help" for more information about a command.
For example, if one wanted help removing a pack, running cpackget rm --help would print out useful information on the subject.
Specifying the working pack root folder
If cpackget is going to work on an existing pack root folder, there are two ways to specify it:
export CMSIS_PACK_ROOT=path/to/pack-root; cpackget add ARM.CMSIScpackget --pack-root path/to/pack-root pack add ARM.CMSIS
To create a new pack root folder with an up-to-date index file of publicly available Open-CMSIS-Pack packs run:
$ cpackget init --pack-root path/to/new/pack-root https://www.keil.com/pack/index.pidx
The command will create a folder called path/to/new/pack-root and the following subfolders: .Download, .Local, .Web.
A copy of the index file (if specified) is placed in .Web/index.pidx.
If later it is needed to update the public index file, just run cpackget index https://vendor.com/index.pidx and
.Web/index.pidx will be updated accordingly.
Adding packs
The commands below demonstrate how to add packs:
Install a pack version that is present in the file system already:
cpackget add path/to/Vendor.PackName.x.y.z.pack
Install a pack version that can be downloaded using a web link:
cpackget add https://vendor.com/example/Vendor.PackName.x.y.z.pack
Install a pack version from the public package index. The download url will be looked up by the tool:
cpackget add Vendor.PackName.x.y.zorcpackget pack add Vendor::PackName@x.y.z
Install the latest published version of a public package listed in the package index:
cpackget add Vendor.PackNameorcpackget pack add Vendor::PackName
Install packs using version modifiers:
cpackget add Vendor::PackName>=x.y.z, check if there is any version greater than or equal to x.y.z, install latest otherwisecpackget add Vendor::PackName@~x.y.z, check if there is any version greater than or equal to x.y.z
Install the pack versions specified in the ascii file. Each line specifies a single pack.
cpackget add -f list-of-packs.txt
The command below is an example how to add packs via PDSC files:
cpackget add path/to/Vendor.PackName.pdsc
Note that for adding packs via PDSC files is not possible to provide an URL as input. Only local files are allowed.
Listing installed packs
One could get a list of all installed packs by running the list command:
cpackget list
This will include all packs that got installed via cpackget add command, including packs
that were added via PDSC file.
There are also a couple of flags that allow listing extra information.
List all cached packs, that are present in the ".Download/" folder:
cpackget list --cached
List all packs present in index.pidx:
cpackget list --public
Accepting the End User License Agreement (EULA) from the command line
Some packs come with licenses and by default cpackget will prompt the user for agreement. This can be avoided
by using the --agree-embedded-license flag:
cpackget add --agree-embedded-license Vendor.PackName
Also there are cases where users might want to only extract the pack's license and not install it:
cpackget add --extract-embedded-license Vendor.PackName
The extracted license file will be placed next to the pack's. For example if Vendor.PackName.x.y.z had a license file
named LICENSE.txt, cpackget would extract it to .Download/Vendor.PackName.x.y.z.LICENSE.txt.
Removing packs
The commands below demonstrate how to remove packs.
Remove pack Vendor.PackName version x.y.z only, leave others untouched
cpackget rm Vendor.PackName.x.y.zorcpackget rm Vendor::PackName@x.y.z
Remove all versions of pack Vendor.PackName
cpackget rm Vendor.PackNameorcpackget rm Vendor::PackName
Same as above, except that now it also removes the cached pack file.
cpackget rm --purge Vendor.PackName: using--purgetriggers removal of any downloaded files.
And for removing packs that were installed via PDSC files, consider the example commands below:
Remove a local pack, or remove all instances of a local pack that were added via different PDSC file locations
cpackget rm Vendor.PackName.pdsc
Remove a specific PDSC of a pack
cpackget rm path/to/Vendor.PackName.pdsc(cpackget listdisplays the absolute path of PDSC installed packs)
Updating the index
It is common that the index.pidx file gets outdated sometime after the pack installation is initialized. A good practice is to keep it always updated. One can do that by running
cpackget update-index
This will use the address from the <url> tag inside index.pidx to retrieve a new version of the file.
cpackget will also go through all PDSC files within .Web/ checking if the latest version has been
oudated by the one matching the pack tag in index.pidx.
If wanted, the behavior above can be disabled by using --sparse flag, thus updating only the index.pidx.
Working behind a proxy
Some use cases might require network access via a proxy. This can be done via environment variables that are used
by cpackget:
# Windows
% set HTTP_PROXY=http://my-proxy # proxy used for HTTP requests
% set HTTPS_PROXY=https://my-https-proxy # proxy used for HTTPS requests
# Unix
$ export HTTP_PROXY=http://my-proxy # proxy used for HTTP requests
$ export HTTPS_PROXY=https://my-https-proxy # proxy used for HTTPS requests
Then all HTTP/HTTPS requests will be going through the specified proxy.
Contributing to cpackget tool
Found a bug? Want a new feature? Or simply want to fix a typo somewhere? If so please refer to our contributing guide.