canonical / chisel

GNU Affero General Public License v3.0
270 stars 42 forks source link

fix: package names can be of length two #120

Closed rebornplusplus closed 7 months ago

rebornplusplus commented 8 months ago

This PR adds support for package names with a minimum length of two. Previously chisel only supported a minimum length of 3. The limit on the slice name is kept unchanged.

Fixes #119.

letFunny commented 8 months ago

If this is the correct definition (copied from the issue):

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.

Then "a-", "a+" and "a." are valid names not captured by the regexp.

rebornplusplus commented 8 months ago

If this is the correct definition (copied from the issue):

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.

Then "a-", "a+" and "a." are valid names not captured by the regexp.

I only have that reference for now. I am planning to go through the Debian Policy Manual again, today. But yes, based on the definition above, you should be right. But I am not sure if a-, a+, or a. are permitted or not.

rebornplusplus commented 7 months ago

So yeah, the current regex does support package names like foo+ and foo. (a+ and a. now too). But it does not support foo- (or a-).

There are packages like foo+ though:

$ grep "^Package:\s.*+$" Packages 
Package: bonnie++
Package: g++
Package: libdb5.3++
Package: memtest86+

I didn't find occurrences like foo- and foo. yet. Let me know if you spot them!

lwnexgen commented 7 months ago

It would be nice if this could be merged soon :) I have some weird hacks to get a static jq copied into the chiseled image.