Skip to content

Fix version separator and update purl-spec - #153

Merged
maennchen merged 2 commits into
mainfrom
fix-version-separator
Jul 28, 2026
Merged

Fix version separator and update purl-spec#153
maennchen merged 2 commits into
mainfrom
fix-version-separator

Conversation

@maennchen

@maennchen maennchen commented Jul 28, 2026

Copy link
Copy Markdown
Member

Two independent changes, one commit each.

Split the version at the last @ instead of the first

The version is separated from the name by the last unencoded @, but binary:split/2 without global splits at the first one. Names that themselves contain an @ — such as the Homebrew formula node@20 — were parsed as name node with version 20@20.10.0 instead of name node@20 with version 20.10.0.

Update purl-spec to dd9ffe9 and regenerate type data

Adds the new brew and git types and picks up changes to 17 existing definitions, bringing the registry to 42 types.

The hex doctest is updated for the re-encoded repository_url example, and two groups of new spec tests are excluded:

  • The git tests expect an unencoded / inside the name (e.g. forgejo/forgejo), but / is the namespace separator in the purl grammar, so it has to be encoded as %2F. One of those fixtures is also corrupt, expecting forgejoforgejo/ with the slash misplaced.
  • The cpan rule that a distribution name must not contain :: only exists as prose in the name_definition note, not as a machine readable field such as permitted_characters, so it cannot be enforced from the type definition.

The version is separated from the name by the last unencoded "@", but
`binary:split/2` without `global` splits at the first one. Names that
themselves contain an "@" — such as the Homebrew formula "node@20" — were
therefore parsed as name "node" with version "20@20.10.0" instead of name
"node@20" with version "20.10.0".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@maennchen
maennchen enabled auto-merge (rebase) July 28, 2026 13:18
@maennchen
maennchen disabled auto-merge July 28, 2026 13:18
Adds the new "brew" and "git" types and picks up changes to 17 existing
definitions, bringing the registry to 42 types.

The hex doctest is updated for the re-encoded repository_url example, and
two groups of new spec tests are excluded:

  - The git tests expect an unencoded "/" inside the name (for example
    "forgejo/forgejo"), but "/" is the namespace separator in the purl
    grammar, so it has to be encoded as %2F. One of those fixtures is also
    corrupt, expecting "forgejoforgejo/" with the slash misplaced.
  - The cpan rule that a distribution name must not contain "::" only
    exists as prose in the name_definition note, not as a machine readable
    field such as permitted_characters, so it cannot be enforced from the
    type definition.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@maennchen
maennchen force-pushed the fix-version-separator branch from baabc50 to d6d19d9 Compare July 28, 2026 13:19
@maennchen
maennchen enabled auto-merge (rebase) July 28, 2026 13:20
@maennchen
maennchen merged commit e051c02 into main Jul 28, 2026
20 checks passed
@maennchen
maennchen deleted the fix-version-separator branch July 28, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant