Red Hat Bugzilla – Bug 185192
cpanspec should not output dates according to locale
Last modified: 2007-11-30 17:11:27 EST
Description of problem:
cpanspec writes out dates according to locale. If this output differs from POSIX
the spec file will be rejected by rpmbuild.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. LC_ALL=nn_NO.UTF-8 cpanspec --verbose --packager="Roy-Magne Mo
* lau mar 11 2006 Roy-Magne Mo <firstname.lastname@example.org> 0.58-1
# rpmbuild -ba perl-YAML.spec
error: bad date in %changelog: lau mar 11 2006 Roy-Magne Mo <email@example.com>
cpanspec should write the date according to POSIX (I guess)
I see two ways to solve this, the first is the attached patch which sets the
locale for cpanspec as a whole, this will break localization.
1. get current locale
2. store this in a variable
3. create the date with strftime()
4. restore locale
Created attachment 125996 [details]
patch to set locale
Given that pretty much nothing in the generated spec is locale-aware, I'm
inclined to agree with your fix.
This will be fixed in 1.61, which I'm pushing out now.