Mailinglist Archive: opensuse-buildservice (89 mails)

< Previous Next >
Re: [opensuse-buildservice] how to get the date of last package change
On Tuesday 14 April 2015, Jan Engelhardt wrote:
On Tuesday 2015-04-14 14:10, Ruediger Meier wrote:
Unfortunately obs repos do not seem to save the correct timestamps
of source files. The only way I could imagine right now is to take
the timestamp of the last "*.changes" entry. Is there a better way?

This is in fact the advertised way if you absolutely need the
"current" time. (For example, if you intend to replace
-TIME__/__DATE__. Though, in case of __DATE__/__TIME__, I just define
them to the empty string, which is a lot quicker.)


I'd like to have a reasonable build date in --version output as
supposed by upstream. I find it funny that OBS does not support
such feature ...

But no problem I'm going to parse the .changes file like this:

%build
# export deterministic BUILD_DATE, format like "__DATE__ __TIME__"
CL_DATE="$(awk -F " - " 'NR==2{print $1;}' %{_sourcedir}/%{name}.changes)"
test -n "$CL_DATE"
export BUILD_DATE="$(LANG=C date --utc -d "${CL_DATE}" +"%b %e %Y %T")"

cu,
Rudi
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >