Remove some serious foot-shooting potential from the release Makefile. For

some unknown reason, when LOCAL_PATCHES and LOCAL_SCRIPT were originally
added, they were silently ignored if the actual file did not exist.  As a
result, if one mistyped the pathname to a patch or script, then the release
silently succeeded.  However, it was not built with the desired changes and
no warning was given to inform the builder either.  This commit explicitly
checks to see that all of the defined patches and scripts exist up front
and bails if any of them do not exist.  I lost several hours of valuable
sleeping time this evening due to this "feature" so I've finally gone and
ripped out.  I've tripped over this in the past several other times as
well.

Glanced at by:	scottl
This commit is contained in:
John Baldwin 2004-07-15 04:52:57 +00:00
parent 208f2fd1ed
commit db8714af52
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132181

View File

@ -314,6 +314,18 @@ release rerelease:
@echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
@exit 1
.endif
.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
.for p in ${LOCAL_PATCHES}
.if !exists(${p})
@echo "The patch file ${p} does not exist!"
@exit 1
.endif
.endfor
.endif
.if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
@echo "The local script ${LOCAL_SCRIPT} does not exist!"
@exit 1
.endif
.if make(release)
.if exists(${CHROOTDIR})
# The first command will fail on a handful of files that have their schg
@ -347,12 +359,10 @@ release rerelease:
.endif
.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
.for p in ${LOCAL_PATCHES}
.if exists(${p})
patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
.endif
.endfor
.endif
.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
.if defined(LOCAL_SCRIPT)
cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
.endif