-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Be more strict about versionlock strings #38
Conversation
80566b2
to
967c274
Compare
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.
All code changes look reasonable, didn't look too hard at the new regex string in versionlockstring.pp though. Will in the near future and comment again if this is still open.
@@ -0,0 +1 @@ | |||
type Yum::VersionlockString = Pattern[/^([0-9\*]+):([0-9a-zA-Z\._\+%\{\}\*-]+)-([^-]+)-([0-9\*]+)\.(([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?)$/] |
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.
is it possible to add a few strings where is is supposed to match/not match? So a non-yum person has a clue whats going on.
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.
Lots of documentation updates, including examples. Boom. Done.
@@ -0,0 +1 @@ | |||
type Yum::VersionlockString = Pattern[/^([0-9\*]+):([0-9a-zA-Z\._\+%\{\}\*-]+)-([^-]+)-([0-9\*]+)\.(([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?)$/] |
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.
It would be nice if types were composable, so you could do Pattern[^#{Yum::Version}:#{Yum::Epoch}] and this was readable and maintainable. But it's unfortunately they're not.
Maybe a documentation blurb breaking the regex out into it's components?
967c274
to
eb3924a
Compare
This commit locks down the versionlock defined type using a more comprehensive regular expression, storing the Pattern in a type alias. Previously two simple regular expressions were used, but they allowed for invalid inputs with wildcards that spanned multiple fields-- wildcards are only permitted within an individual field.
eb3924a
to
68fed88
Compare
thanks! |
This commit locks down the versionlock defined type using a more
comprehensive regular expression, storing the Pattern in a type alias.
Previously two simple regular expressions were used, but they allowed
for invalid inputs with wildcards that spanned multiple fields--
wildcards are only permitted within an individual field.
Fixes #35