What's the use-case for this?
When we try to automatically handle git conflicts wrt changelogs and releases, we can parse the changelog content, author and name form the diff junk. Than, we'd like to use rpmdev-bumpspec to create the new changelog entry.
https://github.com/fedora-python/ferrypick/pull/10
Currently, we can only have that with today's date, but I'd like to reuse the one from the diff junk (assuming it's >= than the latest one).
>=
Makes sense to me, but can you please add some date format validation here? As it stands, you can pass garbage in and break a package build that way.
That was my intention. Garbage in, garbage out. Same as with userstring, where you can pass garbage as well. For our use case, if the git conflict has garbage date, we want to preserve it.
If you want to shoot yourself in the foot, you can. I can certainly emphasize that in the help text if that helps.
The author name can be pretty much arbitrary, but datestamps cannot be. Borked datestamps in terms of formatting and structure will break it.
If you insist. Let me try to figure out how does rpm validate that datestamp.
To be clear, I am not trying to enforce that you validate the chronology. If it is chronologically wrong, that's on you. I just want you to ensure that the datestamp is formatted as %a %b %e %T %Z %Y when passed to be in the rpm changelog, regardless of input format.
%a %b %e %T %Z %Y
https://github.com/rpm-software-management/rpm/blob/a5872582/build/parseChangelog.c#L34-L36
1 new commit added
Validate user-provided datestamp
Done.
Note that I was unable to use either %e or %T in it, so I had to improvise. I hope it is good enough.
%e
%T
2 new commits added
Add explicit --datestamp option for rpmdev-bumpspec
That's fine. Odd, but fine.
Pull-Request has been merged by ngompa