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

[deb] The regex for valid package names in relationships does not allow names including "." (and is missing a couple of constraints) #1899

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

ccooke
Copy link
Contributor

@ccooke ccooke commented May 4, 2022

Debian policy is that package names may include a period, and this is used for a number of default packages (for instance, ruby2.7).

Binary package documentation points to the Source package docs:
https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-package
Source package documentation includes ".":
https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source

Current text:

Package names (both source and binary, see Package) must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character.

The regex in

RELATIONSHIP_FIELD_PATTERN = /^(?<name>[A-z0-9_-]+)(?: *\((?<relation>[<>=]+) *(?<version>(?:[0-9]+:)?[0-9A-Za-z+~.-]+(?:-[0-9A-Za-z+~.]+)?)\))?$/

does not correctly apply the rules, as it does not allow "." or apply the alphanumeric and minimum-two-character limits.

- Package names must start with an alphanumeric
- Package names must be at least two characters
- Package names may include a '.'
@jordansissel
Copy link
Owner

Nice! Also, thank you for citing references as this helps research and also helps us verify things as Debian policys may change over time <3

@jordansissel jordansissel merged commit 88c1e6a into jordansissel:main Nov 14, 2022
@jordansissel
Copy link
Owner

fpm 1.15.0 is released and contains this improvement.

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.

2 participants