Mailinglist Archive: opensuse-factory (551 mails)

< Previous Next >
Re: [opensuse-factory] rpmlint badness for file-contains-date-and-time
Am 23.05.2011 10:42, schrieb Guido Berhoerster:
* Ludwig Nussel <ludwig.nussel@xxxxxxx> [2011-05-23 09:08]:
Should we assign some badness value to this warning ie make it an
error? There are currently 118 packages in Factory with
file-contains-date-and-time.
No, not in its current state which produces false positives. I
use a hack to replace __DATE__ and __TIME__ with the date and
time extracted from the .changes file:

modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
find . -name '*.[ch]' -print0 |\
xargs -0 sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g"

This has the advantage that the application will still have some
halfway useful date and time information where it expects it.
Unfortunately rpmlint still complains at least for the first
build because it checks for the current date in the binary.
I used this method for my quassel rpms and I get still a
file-contains-date-and-time for the first build after a change. This is
because the modification time ist close to the build time in many cases.

Herbert
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-factory+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups