Mailinglist Archive: opensuse-buildservice (89 mails)

< Previous Next >
Re: [opensuse-buildservice] how to get the date of last package change
  • From: "Dmitriy Perlow" <dap@xxxxxxx>
  • Date: Tue, 14 Apr 2015 19:21:04 +0300
  • Message-id: <op.xw3bpevkodbuyo@old.tower>
Ruediger Meier <sweet_f_a@xxxxxx> Tue, 14 Apr 2015 19:16:33 +0300:

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:

# 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")"


Providing of build date causes unreproducible builds that increases service load so the latest changes date is much better.

Best regards,
Dmitriy DA(P).DarkneSS Perlow @ Linux x64
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >