Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
giterlizzi committed Nov 17, 2023
1 parent 73e5b4c commit b134997
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ use URI::PackageURL;
# OO-interface

# Encode components in PackageURL string
$purl = URI::PackageURL->new(type => cpan, namespace => 'GDT', name => 'URI-PackageURL', version => '2.03');
$purl = URI::PackageURL->new(type => cpan, namespace => 'GDT', name => 'URI-PackageURL', version => '2.04');

say $purl; # pkg:cpan/GDT/URI-PackageURL@2.03
say $purl; # pkg:cpan/GDT/URI-PackageURL@2.04

# Parse PackageURL string
$purl = URI::PackageURL->from_string('pkg:cpan/GDT/URI-PackageURL@2.03');
$purl = URI::PackageURL->from_string('pkg:cpan/GDT/URI-PackageURL@2.04');

# exported funtions

$purl = decode_purl('pkg:cpan/GDT/URI-PackageURL@2.03');
$purl = decode_purl('pkg:cpan/GDT/URI-PackageURL@2.04');
say $purl->type; # cpan

$purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::PackageURL', version => '2.03');
$purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::PackageURL', version => '2.04');
```


Expand All @@ -31,22 +31,22 @@ $purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::Packa
Inspect and export "purl" string in various formats (JSON, YAML, Data::Dumper, ENV):

```console
$ purl-tool pkg:cpan/GDT/URI-PackageURL@2.03 --json | jq
$ purl-tool pkg:cpan/GDT/URI-PackageURL@2.04 --json | jq
{
"name": "URI-PackageURL",
"namespace": "GDT",
"qualifiers": {},
"subpath": null,
"type": "cpan",
"version": "2.03"
"version": "2.04"
}
```


Download package using "purl" string:

```console
$ wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.03 --download-url)
$ wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.04 --download-url)
```


Expand All @@ -57,7 +57,7 @@ Use "purl" string in your shell-scripts:

set -e

PURL="pkg:cpan/GDT/URI-PackageURL@2.03"
PURL="pkg:cpan/GDT/URI-PackageURL@2.04"

eval $(purl-tool "$PURL" --env)

Expand All @@ -72,6 +72,17 @@ perl Makefile.PL
make && make install
```


Create on-the-fly a "purl" string:

```console
$ purl-tool --type cpan \
--namespace GDT \
--name URI-PackageURL \
--version 2.04
```


## Install

Using Makefile.PL:
Expand Down

0 comments on commit b134997

Please sign in to comment.