Use SVNREVISION and BUILDDATE if passed into the make(1)

environment, fallback to trying to figure it out otherwise.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2015-05-26 20:51:44 +00:00
parent 6efd223d8f
commit 0c55af22ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283580

View File

@ -30,24 +30,26 @@ EMBEDDED= 1
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
SNAPSHOT= 1 SNAPSHOT= 1
TLD?= ${FTPDIR}/snapshots TLD?= ${FTPDIR}/snapshots
. for _D in /usr/bin /usr/local/bin . if !defined(SVNREVISION) || empty(SVNREVISION)
. for _S in svnversion svnliteversion . for _D in /usr/bin /usr/local/bin
. if exists(${_D}/${_S}) . for _S in svnversion svnliteversion
. if exists(${_D}/${_S})
SVNVERSION?= ${_D}/${_S} SVNVERSION?= ${_D}/${_S}
. endif . endif
. endfor
. endfor . endfor
. endfor . if exists(${SVNVERSION}) && !empty(SVNVERSION)
. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
. else
BUILDDATE!= date +%Y%m%d
. endif
. if exists(${SVNVERSION}) && !empty(SVNVERSION)
SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE} . endif
. else . endif # !defined(SVNERVISION)
_SNAP_SUFFIX:= -${BUILDDATE} . if !defined(BUILDDATE) || empty(BUILDDATE)
. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
. else
BUILDDATE!= date +%Y%m%d
. endif
. endif . endif
_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE}
.else .else
# release # release
SNAPSHOT= SNAPSHOT=