-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: package names can be of length two #120
fix: package names can be of length two #120
Conversation
a195268
to
0701528
Compare
This commit 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 canonical#119.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you link the naming requirements for debian packages if you have them? I want to see them to check the tests + regexp.
If this is the correct definition (copied from the issue):
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 |
So yeah, the current regex does support package names like There are packages like
I didn't find occurrences like |
Add pkg and slice name expression string variables to remove duplication and increase test coverage.
It would be nice if this could be merged soon :) I have some weird hacks to get a static |
This reverts commit 0f724ae.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think some way of tying the three regexps together would be nice (#120 (comment)) but let's keep it simple for this bugfix.
@@ -242,9 +242,14 @@ func order(pkgs map[string]*Package, keys []SliceKey) ([]SliceKey, error) { | |||
return order, nil | |||
} | |||
|
|||
var fnameExp = regexp.MustCompile(`^([a-z0-9](?:-?[.a-z0-9+]){2,})\.yaml$`) | |||
// fnameExp matches the slice definition file basename. | |||
var fnameExp = regexp.MustCompile(`^([a-z0-9](?:-?[.a-z0-9+]){1,})\.yaml$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for missing this earlier, but why do we have a dot (.) in that second group? That doesn't look right.
Same question below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's actually go ahead with this for now. Alberto just pointed out that this is part of the package rules, and this is already in the code, so arguably an independent issue.
Let's please follow up on it, though, and agree on the path forward.
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.