aboutsummaryrefslogtreecommitdiff
path: root/release/Makefile.mirrors
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2015-05-26 20:51:44 +0000
committerGlen Barber <gjb@FreeBSD.org>2015-05-26 20:51:44 +0000
commit0c55af22aec3dc299b833a647c310367f05d6074 (patch)
tree7c2f261da14a9f34131358331a465a97723f1525 /release/Makefile.mirrors
parent6efd223d8ff8e89a0134dd236da358dfb995e911 (diff)
downloadsrc-0c55af22aec3dc299b833a647c310367f05d6074.tar.gz
src-0c55af22aec3dc299b833a647c310367f05d6074.zip
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
Notes
Notes: svn path=/head/; revision=283580
Diffstat (limited to 'release/Makefile.mirrors')
-rw-r--r--release/Makefile.mirrors26
1 files changed, 14 insertions, 12 deletions
diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors
index 69c48153ee70..35ab0c439e48 100644
--- a/release/Makefile.mirrors
+++ b/release/Makefile.mirrors
@@ -30,24 +30,26 @@ EMBEDDED= 1
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
SNAPSHOT= 1
TLD?= ${FTPDIR}/snapshots
-. for _D in /usr/bin /usr/local/bin
-. for _S in svnversion svnliteversion
-. if exists(${_D}/${_S})
+. if !defined(SVNREVISION) || empty(SVNREVISION)
+. for _D in /usr/bin /usr/local/bin
+. for _S in svnversion svnliteversion
+. if exists(${_D}/${_S})
SVNVERSION?= ${_D}/${_S}
-. endif
+. endif
+. endfor
. endfor
-. endfor
-. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
+. if exists(${SVNVERSION}) && !empty(SVNVERSION)
+SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
+. endif
+. endif # !defined(SVNERVISION)
+. 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
+. else
BUILDDATE!= date +%Y%m%d
+. endif
. endif
-. if exists(${SVNVERSION}) && !empty(SVNVERSION)
-SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE}
-. else
-_SNAP_SUFFIX:= -${BUILDDATE}
-. endif
.else
# release
SNAPSHOT=