common/environment: empty file before writing.

Emptying the headerfile before writing into it. This prevents
defining/undefining a macro multiple times.

addresses #3765.
This commit is contained in:
Enno Boland 2016-03-06 13:03:33 +01:00
parent 1da2309458
commit 15f26298aa
1 changed files with 1 additions and 0 deletions

View File

@ -1,6 +1,7 @@
if [ -n "$SOURCE_DATE_EPOCH" ]; then if [ -n "$SOURCE_DATE_EPOCH" ]; then
CFLAGS+=" -Wno-builtin-macro-redefined -include$XBPS_STATEDIR/timestamp-macros.h" CFLAGS+=" -Wno-builtin-macro-redefined -include$XBPS_STATEDIR/timestamp-macros.h"
CXXFLAGS+=" -Wno-builtin-macro-redefined -include$XBPS_STATEDIR/timestamp-macros.h" CXXFLAGS+=" -Wno-builtin-macro-redefined -include$XBPS_STATEDIR/timestamp-macros.h"
printf > $XBPS_STATEDIR/timestamp-macros.h
for i in "DATE,%b %d %Y" "TIME,%H:%M:%S" "DATETIME,%b %d %Y %H:%M:%S"; do for i in "DATE,%b %d %Y" "TIME,%H:%M:%S" "DATETIME,%b %d %Y %H:%M:%S"; do
mcr=${i%%,*} mcr=${i%%,*}
val=$(LC_ALL=C date --date "@$SOURCE_DATE_EPOCH" +"${i#*,}") val=$(LC_ALL=C date --date "@$SOURCE_DATE_EPOCH" +"${i#*,}")