Alex Wanderleit
2010-03-11 10:54:49 UTC
Hi!
I would like to place some logging into the scriptlet parts of a .spec
file,
including the current timestamp in each log line.
Avoiding the same "now evaluation line" over and over throughout the
spec file clutters the actual script:
now=`date +%Y%m%d_%H%M%S`
echo "${now}: +++ prep section start +++" >> /tmp/rpm_install.log
My first approach was to have an rpm macro like this in the preamble
section:
%define now %(date +%Y%m%d_%H%M%S)
Unfortunately, the macro expansion takes place only once at rpm build
time,
yielding a not desired result of writing the rpm build time into the
log file.
Is there a way to define a global macro in one place and have that
available and evaluate
at time of rpm installation/update/erase in various scriptlet parts?
Thank you,
Alex
I would like to place some logging into the scriptlet parts of a .spec
file,
including the current timestamp in each log line.
Avoiding the same "now evaluation line" over and over throughout the
spec file clutters the actual script:
now=`date +%Y%m%d_%H%M%S`
echo "${now}: +++ prep section start +++" >> /tmp/rpm_install.log
My first approach was to have an rpm macro like this in the preamble
section:
%define now %(date +%Y%m%d_%H%M%S)
Unfortunately, the macro expansion takes place only once at rpm build
time,
yielding a not desired result of writing the rpm build time into the
log file.
Is there a way to define a global macro in one place and have that
available and evaluate
at time of rpm installation/update/erase in various scriptlet parts?
Thank you,
Alex