Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI for URI::PackageURL #3

Closed
giterlizzi opened this issue Jun 13, 2023 · 0 comments
Closed

Add CLI for URI::PackageURL #3

giterlizzi opened this issue Jun 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@giterlizzi
Copy link
Owner

purl-tool with JSON output format:

purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 | jq
{
  "name": "URI-PackageURL",
  "namespace": "GDT",
  "qualifiers": {},
  "subpath": null,
  "type": "cpan",
  "version": "2.00"
}

purl-tool with ENV output format:

purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 --env
PURL="pkg:cpan/GDT/URI-PackageURL@2.00"
PURL_TYPE="cpan"
PURL_NAMESPACE="GDT"
PURL_NAME="URI-PackageURL"
PURL_VERSION="2.00"
PURL_SUBPATH=""
PURL_QUALIFIERS=""
PURL_DOWNLOAD_URL="http://www.cpan.org/authors/id/G/GD/GDT/URI-PackageURL-2.00.tar.gz"
PURL_REPOSITORY_URL="https://metacpan.org/release/GDT/URI-PackageURL-2.00"

purl-tool with YAML output format:

purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 --yaml
--- !!perl/hash:URI::PackageURL
name: URI-PackageURL
namespace: GDT
qualifiers: {}
scheme: pkg
subpath: ~
type: cpan
version: '2.00'

Download package using PackageURL string:
wget $(purl-tool --download-url 'pkg:cpan/GDT/URI-PackageURL@2.00' )

Use ENV variables inside shell-script:

#!bash

eval $(perl -Ilib bin/purl-tool --parse 'pkg:cpan/GDT/URI-PackageURL@2.00' --env)

echo "Download $PURL"
wget $PURL_DOWNLOAD_URL
@giterlizzi giterlizzi added the enhancement New feature or request label Jun 13, 2023
giterlizzi added a commit that referenced this issue Jun 13, 2023
- Added "purl-tool(1)" (#3)
- Added "URI::PackageURL::Util::purl_to_urls" helper
- Fixed name qualifier for "cpan" (#2)
- Fixed some little issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant