aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorBeat Gaetzi <beat@FreeBSD.org>2012-09-20 19:51:30 +0000
committerBeat Gaetzi <beat@FreeBSD.org>2012-09-20 19:51:30 +0000
commit87ed9dc1c6c00776de4c076225c97ccc9cb7131e (patch)
tree9e81dbcc2a9036b962d7aaaeb44baa3ea6c59fcf /Mk
parent55bc5941f2b40d52dff0d9551c2cba2a50248655 (diff)
downloadports-87ed9dc1c6c00776de4c076225c97ccc9cb7131e.tar.gz
ports-87ed9dc1c6c00776de4c076225c97ccc9cb7131e.zip
- Remove ftp fallback as all supported FreeBSD versions provide fetch [1]
- Don't call 'pre-config' twice in the 'config-conditional' target [2] - Clean up pkgng metadir so that the 'clean' target can be executed without root permissions if the build was done with a non-root user. [3] - Make 'do-package' atomic while creating the pkg file [4] PR: ports/171161 [2], ports/171329 [3], ports/171672 [4] Submitted by: bapt [1], A.J. Kehoe IV (Nanoman) <m7k60pkr@nanoman.ca> [2], Submitted by: bdrewery [3, 4] Reported by: Kimmo Paasiala <kpaasial@gmail.com> [3] Tested by: Exp-run on pointyhat, bapt (pkgng changes)
Notes
Notes: svn path=/head/; revision=304594
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.pkgng.mk8
-rw-r--r--Mk/bsd.port.mk22
2 files changed, 19 insertions, 11 deletions
diff --git a/Mk/bsd.pkgng.mk b/Mk/bsd.pkgng.mk
index 461104d9614f..90d934b4ad2c 100644
--- a/Mk/bsd.pkgng.mk
+++ b/Mk/bsd.pkgng.mk
@@ -123,6 +123,7 @@ fake-pkg:
.else
@${PKG_CMD} -l -m ${METADIR} -f ${TMPPLIST}
.endif
+ @${RM} -rf ${METADIR}
.else
@${DO_NADA}
.endif
@@ -230,11 +231,16 @@ do-package: ${TMPPLIST}
fi; \
fi; \
fi;
- @if ${PKG_CREATE} -o ${PKGREPOSITORY} ${PKGNAME}; then \
+ @TMPPKGREPOSITORY=$$(mktemp -dt pkg); \
+ trap "${RM} -rf $${TMPPKGREPOSITORY}; exit 1" 1 2 3 5 10 13 15; \
+ if ${PKG_CREATE} -o $${TMPPKGREPOSITORY} ${PKGNAME}; then \
+ ${MV} -f $${TMPPKGREPOSITORY}/${PKGNAME}${PKG_SUFX} ${PKGREPOSITORY}; \
+ ${RM} -rf $${TMPPKGREPOSITORY}; \
if [ -d ${PACKAGES} ]; then \
cd ${.CURDIR} && eval ${MAKE} package-links; \
fi; \
else \
+ ${RM} -rf $${TMPPKGREPOSITORY}; \
cd ${.CURDIR} && eval ${MAKE} delete-package; \
exit 1; \
fi
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 643ee3aaed4d..686d3231cd63 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -2246,18 +2246,12 @@ MAKE_ENV+= PATH=${LOCALBASE}/libexec/ccache:${PATH}
PTHREAD_CFLAGS?=
PTHREAD_LIBS?= -pthread
-.if exists(/usr/bin/fetch)
FETCH_BINARY?= /usr/bin/fetch
FETCH_ARGS?= -AFpr
FETCH_REGET?= 1
.if !defined(DISABLE_SIZE)
FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE}
.endif
-.else
-FETCH_BINARY?= /usr/bin/ftp
-FETCH_ARGS?= -R
-FETCH_REGET?= 0
-.endif
FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
.if defined(RANDOMIZE_MASTER_SITES)
@@ -3911,11 +3905,15 @@ do-package: ${TMPPLIST}
fi; \
fi; \
fi
- @if ${PKG_CMD} -b ${PKGNAME} ${PKGFILE}; then \
+ @TMPPKGFILE=$$(mktemp -t pkg); \
+ trap "${RM} -f $${TMPPKGFILE} $${TMPPKGFILE}${PKG_SUFX}; exit 1" 1 2 3 5 10 13 15; \
+ if ${PKG_CMD} -b ${PKGNAME} $${TMPPKGFILE}; then \
+ ${MV} -f $${TMPPKGFILE}${PKG_SUFX} ${PKGFILE}; \
if [ -d ${PACKAGES} ]; then \
cd ${.CURDIR} && eval ${MAKE} package-links; \
fi; \
else \
+ ${RM} -f $${TMPPKGFILE}; \
cd ${.CURDIR} && eval ${MAKE} delete-package; \
exit 1; \
fi
@@ -6089,8 +6087,8 @@ DEFOPTIONS+= ${opt} "S(${single}): "${${opt}_DESC:Q} on
.undef opt
.endif # pre-config
-.if !target(config)
-config: pre-config
+.if !target(do-config)
+do-config:
.if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI)
@${ECHO_MSG} "===> No options to configure"
.else
@@ -6141,6 +6139,10 @@ config: pre-config
${RM} -f $${TMPOPTIONSFILE}
@cd ${.CURDIR} && ${MAKE} sanity-config
.endif
+.endif # do-config
+
+.if !target(config)
+config: pre-config do-config
.endif # config
.if !target(config-recursive)
@@ -6155,7 +6157,7 @@ config-recursive:
config-conditional: pre-config
.if defined(COMPLETE_OPTIONS_LIST) && !defined(NO_DIALOG)
. if !defined(_FILE_COMPLETE_OPTIONS_LIST) || ${COMPLETE_OPTIONS_LIST:O} != ${_FILE_COMPLETE_OPTIONS_LIST:O}
- @cd ${.CURDIR} && ${MAKE} config;
+ @cd ${.CURDIR} && ${MAKE} do-config;
. endif
.endif
.endif # config-conditional