Skip to content

Features

Thorsten de Buhr edited this page Jun 20, 2023 · 9 revisions

List of all supported features in cpackget

Adding packs

  • Commands

    • cpackget add /path/to/Vendor.Packname.x.y.z[.pack|.zip]
    • cpackget add https://vendor.com/Vendor.Packname.x.y.z[.pack|.zip]
    • cpackget add Vendor.Packname[.x.y.z]
    • cpackget add Vendor::Packname[@x.y.z]
  • Actions

    • If the pack is specified as download link, download the file if it is not present under CMSIS_PACK_ROOT/.Download
    • Save a copy of the pack in CMSIS_PACK_ROOT/.Download/ (for consistency rename .zip to .pack)
    • Save a versioned copy of the PDSC file in CMSIS_PACK_ROOT/.Download/
    • Extract all pack files to CMSIS_PACK_ROOT/Vendor/Packname/x.y.z/
      • Note: if the pack file does not contain the file ./Vendor.Packname.pdsc in the base folder of the archive:
        • Check if only a single subdirectory exists and whether it contains the file ./Vendor.Packname.pdsc.
          • If not: stop installation, clean-up and emit error message.
          • Else: use this subdirectory as base directory to extract the content from ignoring other content from parent directory.
    • If the pack is not public (public = pack's pdsc file is present in CMSIS_PACK_ROOT/.Web/ directory) then
      • Save an unversioned copy of the PDSC file in CMSIS_PACK_ROOT/.Local/
    • Touch pack.idx
  • Rules

    • Downloading pack files should be smart enough to handle URL redirection
    • Adding an existing Vendor.Packname.x.y.z[.pack|.zip] should
      • Return an error code (-1) and an output message "Vendor.Packname.x.y.z is already installed"
    • Adding a newer version of a pack that is not public, Vendor.Packname.x.y.z[.pack|.zip] should
      • Do all "cpackget pack add ..." actions
        • Note: as a consequence, the unversioned PDSC file in CMSIS_PACK_ROOT/.Local/ will be overwritten by the new one

Removing packs

  • Commands
    • cpackget rm [--purge] Vendor.Packname[.x.y.z]
    • cpackget rm [--purge] Vendor::Packname[@x.y.z]
  • Actions
    • If there are packs installed under CMSIS_PACK_ROOT/Vendor/Packname/[x.y.z/] then
      • Remove the directory and all contained files from CMSIS_PACK_ROOT/Vendor/Packname/x.y.z/
      • If x.y.z is omitted then
        • Remove CMSIS_PACK_ROOT/Vendor/Packname/ folder
      • After removing packs remove empty directories
        • If CMSIS_PACK_ROOT/Vendor/Packname/ is empty, remove CMSIS_PACK_ROOT/Vendor/Packname/ folder
        • If CMSIS_PACK_ROOT/Vendor/ is empty, remove CMSIS_PACK_ROOT/Vendor/ folder
      • If --purge is specified then:
        • Remove CMSIS_PACK_ROOT/.Download/Vendor.Packname.x.y.z.pack
        • Remove CMSIS_PACK_ROOT/.Download/Vendor.Packname.x.y.z.pdsc
        • If x.y.z is omitted then
          • Remove all Packs and PDSC files that match "Vendor.Packname.*"
      • If the pack is not public (Vendor.Packname.pdsc is not present in CMSIS_PACK_ROOT/.Web/) then:
        • Remove the PDSC Vendor.Packname.pdsc file from CMSIS_PACK_ROOT/.Local/
      • Touch pack.idx
    • If there are NO packs installed and --purge is specified then:
      • Remove CMSIS_PACK_ROOT/.Download/Vendor.Packname.x.y.z.pack
      • Remove CMSIS_PACK_ROOT/.Download/Vendor.Packname.x.y.z.pdsc
      • If x.y.z is omitted then
        • Remove all Packs and PDSC files that match "Vendor.Packname.*"
  • Rules
    • If Vendor.Packname[.x.y.z] is NOT installed and --purge is NOT specified then
      • Return an error code (-1) and an output message "Vendor.Packname[.x.y.z] is not installed"
    • If Vendor.Packname[.x.y.z] has already been purged and --purge is specified then
      • Return an error code (-1) and an output message "Vendor.Packname[.x.y.z] is not purgeable"

Adding PDSC

  • Commands
    • cpackget add /path/to/Vendor.Packname.pdsc
  • Actions
    • Add PDSC entry to CMSIS_PACK_ROOT/.Local/local_repository.pidx
      • The URL attribute should be the absolute path of the PDSC file containing file protocol in it ("file://")
      • The version should be extracted from the top <release> tag in the PDSC file
    • Touch pack.idx
  • Rules:
    • Adding an existing Vendor.Packname.pdsc that contains a version previously present in CMSIS_PACK_ROOT/.Local/local_repository.pidx should
      • Return an error code (-1) and an output message "Vendor.Packname.x.y.z is already installed"

Remove PDSC

  • Commands
    • cpackget rm Vendor.Packname[.x.y.z]
  • Actions
    • Remove the corresponding PDSC entry from CMSIS_PACK_ROOT/.Local/local_repository.pidx file
    • If x.y.z is omitted then
      • Remove all tags from that pack in CMSIS_PACK_ROOT/.Local/local_repository.pidx
    • Touch pack.idx
  • Rules
    • If Vendor.Packname[.x.y.z] is NOT installed then
      • Return an error code (-1) and an output message "Vendor.Packname[.x.y.z] is not installed"

Update of the public package index file

  • Commands
    • cpackget update-index
  • Actions
    • Read <url> from CMSIS_PACK_ROOT/.Web/index.pidx and download latest index.pidx file from that location
    • Also update all pdsc files present in the .Web directory
    • Remove all pdsc files that are not (no longer) present in the index.pidx file.
  • Rules
    • If CMSIS_PACK_ROOT/.Web/index.pidx does not exists exit with an error suggesting to run cpackget init ...
Clone this wiki locally