giterlizzi / perl-URI-PackageURL

Perl extension for Package URL
Artistic License 2.0
4 stars 1 forks source link

PURLs containing multiple namespaces segments parse incorrectly #5

Closed matt-phylum closed 1 year ago

matt-phylum commented 1 year ago

The PURL test suite contains the PURL pkg:swift/github.com/Alamofire/Alamofire@5.4.3. perl-URI-PackageURL parses it as namespace github.com name Alamofire/Alamofire but it should be namespace github.com/Alamofire name Alamofire.

It also serializes incorrectly. The slash in the package name is not escaped, so serializing the incorrectly parsed PURL results in the original string again, even though it was constructed from a PURL structure that should have a different meaning.

giterlizzi commented 1 year ago

FIXED in last release of URI::PackageURL

$ purl-tool pkg:swift/github.com/Alamofire/Alamofire@5.4.3 --env
PURL="pkg:swift/github.com/Alamofire/Alamofire@5.4.3"
PURL_TYPE="swift"
PURL_NAMESPACE="github.com/Alamofire"
PURL_NAME="Alamofire"
PURL_VERSION="5.4.3"
PURL_SUBPATH=""
PURL_QUALIFIERS=""

Thanks ;)