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

add an option to choose what to replace non iso characters with #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmorey
Copy link
Contributor

@nmorey nmorey commented Sep 5, 2017

Some upstream repos use annoying version format like: 10.2-63.
When running through the service, : and - are deleted which generates
unusable/misleading version strings (10.263).

This patches adds an option (iso-cleanup-string) which allows to choose which charater/string
to use to replace the non iso ones.
Default value is '' which keeps the legacy behaviour.

For example
10.2-63 with iso-cleanup-string='.' will generate 10.2.63

A test is added to check the proper behavior of the option

Signed-off-by: Nicolas Morey-Chaisemartin [email protected]

@nmorey nmorey force-pushed the dev/iso-cleanup-string branch 2 times, most recently from 034b5b0 to 781ecc5 Compare September 5, 2017 14:22
@aspiers
Copy link
Member

aspiers commented Sep 20, 2017

Thanks a lot for the submission! Your change makes a lot of sense. Please could you extend the PR to include tests for your changes, as per the CONTRIBUTING guide? Thanks again!

@nmorey nmorey force-pushed the dev/iso-cleanup-string branch 2 times, most recently from 0abfeba to b79fa5e Compare September 20, 2017 09:04
@nmorey
Copy link
Contributor Author

nmorey commented Sep 20, 2017

@aspiers Here you go :)

Copy link
Member

@aspiers aspiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the typo this looks fantastic! Any chance you can amend and force push? Thanks again!

@@ -153,4 +153,7 @@ which get maintained in the SCM. Can be used multiple times.</description>
<parameter name="changesauthor">
<description>Specify author of the changes file entry to be written. Defaults to first email entry in ~/.oscrc, or "[email protected]" if there is no .oscrc found.</description>
</parameter>
<parameter name="iso-cleanup-string">
<description>Characters [-:] are replace by this string. Defaults to ''.</description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"replaced"

@bmwiedemann
Copy link
Member

I was wondering, why you call minus and colon "non-iso" characters?
E.g. the iso8859-1 (aka latin1) standardized by the ISO (International Organization for Standardization) contain minus and colon as part of ASCII.

Some upstream repos use annoying version format like: 10.2-63.
When running through the service, : and - are deleted which generates
unusable/misleading version strings (10.263).

This patches adds an option (iso-cleanup-string) which allows to choose which charater/string
to use to replace the non iso ones.
Default value is '' which keeps the legacy behaviour.

For example
10.2-63 with iso-cleanup-string='.' will generate 10.2.63

Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]>
@nmorey nmorey force-pushed the dev/iso-cleanup-string branch from b79fa5e to e313aaf Compare September 25, 2017 07:42
@nmorey
Copy link
Contributor Author

nmorey commented Sep 25, 2017

@aspiers done

@bmwiedemann THe function that cleans these is call ise_cleanup_str
I would guess that here iso means "RPM version compatible"

@aspiers
Copy link
Member

aspiers commented Jan 8, 2018

@bmwiedemann THe function that cleans these is call ise_cleanup_str

Actually it was called version_iso_cleanup :-)

I would guess that here iso means "RPM version compatible"

Effectively, yes. The "ISO" part came from a reference to the function reformatting ISO date formats (or at least something like YYYY-MM-DD HH:MM:SS ZZZZ) to be usable as a valid rpm version.

@aspiers
Copy link
Member

aspiers commented Jan 9, 2018

I'm working on tidying this up.

@aspiers aspiers self-assigned this Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants