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

Be more strict about versionlock strings #38

Merged
merged 1 commit into from
Feb 1, 2017

Conversation

lamawithonel
Copy link

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

Copy link

@cmentzer cmentzer left a 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|\*))?)$/]
Copy link
Member

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.

Copy link
Author

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|\*))?)$/]

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?

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.
@bastelfreak
Copy link
Member

thanks!

@bastelfreak bastelfreak merged commit 8fc416c into voxpupuli:master Feb 1, 2017
@traylenator traylenator added the enhancement New feature or request label Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants