Check-in [db974773f9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Convert genplist to use macros instead or direct call to commands While here rename STAGE_ARGS to PKG_ARGS to avoid STAGE_ARGS collision
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:db974773f9289d2be9cb99b046018c97f1da0109
User & Date: bapt 2012-06-08 08:12:31
Context
2012-06-08
09:40
Fix syntax error check-in: d217bea677 user: bapt tags: trunk
08:12
Convert genplist to use macros instead or direct call to commands While here rename STAGE_ARGS to PKG_ARGS to avoid STAGE_ARGS collision check-in: db974773f9 user: bapt tags: trunk
05:32
By default propose @dirrm not @dirrmtry check-in: 0cdb938d38 user: bapt tags: trunk
Changes

Changes to ports/Mk/bsd.pkgng.mk.

222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
...
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
	fi
.endif # defined(DEFER_CONFLICTS_CHECK)
.endif
.endif

.if !target(do-package)
.if ${USE_STAGE:L} == yes
STAGE_ARGS=	-r ${STAGEDIR} -p ${TMPPLIST} -m ${METADIR}
.endif

do-package: ${TMPPLIST}
.if ${USE_STAGE:M} == yes
	@${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
	@${MKDIR} ${METADIR}
	@${ECHO_CMD} "name: ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}" > ${MANIFESTF} 
................................................................................
		if [ ! -d ${PKGREPOSITORY} ]; then \
			if ! ${MKDIR} ${PKGREPOSITORY}; then \
				${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
				exit 1; \
			fi; \
		fi; \
	fi;
	@if ${PKG_CREATE} ${STAGE_ARGS} -o ${PKGREPOSITORY} ${PKGNAME}; then \
		if [ -d ${PACKAGES} ]; then \
			cd ${.CURDIR} && eval ${MAKE} package-links; \
		fi; \
	else \
		cd ${.CURDIR} && eval ${MAKE} delete-package; \
		exit 1; \
	fi







|







 







|







222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
...
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
	fi
.endif # defined(DEFER_CONFLICTS_CHECK)
.endif
.endif

.if !target(do-package)
.if ${USE_STAGE:L} == yes
PKG_ARGS=	-r ${STAGEDIR} -p ${TMPPLIST} -m ${METADIR}
.endif

do-package: ${TMPPLIST}
.if ${USE_STAGE:M} == yes
	@${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
	@${MKDIR} ${METADIR}
	@${ECHO_CMD} "name: ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}" > ${MANIFESTF} 
................................................................................
		if [ ! -d ${PKGREPOSITORY} ]; then \
			if ! ${MKDIR} ${PKGREPOSITORY}; then \
				${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
				exit 1; \
			fi; \
		fi; \
	fi;
	@if ${PKG_CREATE} ${PKG_ARGS} -o ${PKGREPOSITORY} ${PKGNAME}; then \
		if [ -d ${PACKAGES} ]; then \
			cd ${.CURDIR} && eval ${MAKE} package-links; \
		fi; \
	else \
		cd ${.CURDIR} && eval ${MAKE} delete-package; \
		exit 1; \
	fi

Changes to ports/Mk/bsd.stage.mk.

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	fi
	@[ -f ${PKGMESSAGE} ] && ${CAT} ${PKGMESSAGE} || return 0
.endif
.endif

.if !target(genplist)
genplist: stage
	@(echo "#mtree" && cat ${MTREE_FILE}) | tar tf - | \
		awk '{ sub(/^\.$$/, "", $$1); if ($$1 == "") print "${PREFIX}"; else print "${PREFIX}/"$$1; }' \
		> ${WRKDIR}/.mtree
	@a=${PREFIX}; \
		while :; do \
			a=$${a%/*} ; \
			[ -z "$${a}" ] && break ; \
			echo $${a} >> ${WRKDIR}/.mtree ; \
		done
	@${FIND} ${STAGEDIR} -type f -o -type l | sed -e "s,${STAGEDIR},,g" \
		-e "s,${DOCSDIR},%%PORTDOCS%%%%DOCSDIR%%,g" \
		-e "s,${EXAMPLESDIR},%%PORTEXAMPLES%%%%EXAMPLESDIR%%,g" \
		-e "s,${DATADIR},%%DATADIR%%,g" \
		-e "s,${PREFIX}/,,g" | sort
	@${FIND} ${STAGEDIR} -type d | sed -e "s,${STAGEDIR},,g" \
		| while read line; do \
		grep -qw "^$${line}$$" ${WRKDIR}/.mtree || { \
			if [ -n "$${line}" ]; then \
				${ECHO_CMD} "@dirrm $${line}"; \
			fi ; \
		}; \
		done | sort -r | sed \
		-e "s,\(.*\)${DOCSDIR},%%PORTDOCS%%\1%%DOCSDIR%%,g" \
		-e "s,\(.*\)${EXAMPLESDIR},%%PORTEXAMPLES%%\1%%EXAMPLESDIR%%,g" \
		-e "s,${DATADIR},%%DATADIR%%,g" \
		-e "s,${PREFIX},,g"
.endif







|






|

|






|




|





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	fi
	@[ -f ${PKGMESSAGE} ] && ${CAT} ${PKGMESSAGE} || return 0
.endif
.endif

.if !target(genplist)
genplist: stage
	@(${ECHO_CMD} "#mtree" && ${CAT} ${MTREE_FILE}) | ${TAR} tf - | \
		awk '{ sub(/^\.$$/, "", $$1); if ($$1 == "") print "${PREFIX}"; else print "${PREFIX}/"$$1; }' \
		> ${WRKDIR}/.mtree
	@a=${PREFIX}; \
		while :; do \
			a=$${a%/*} ; \
			[ -z "$${a}" ] && break ; \
			${ECHO_CMD} $${a} >> ${WRKDIR}/.mtree ; \
		done
	@${FIND} ${STAGEDIR} -type f -o -type l | ${SED} -e "s,${STAGEDIR},,g" \
		-e "s,${DOCSDIR},%%PORTDOCS%%%%DOCSDIR%%,g" \
		-e "s,${EXAMPLESDIR},%%PORTEXAMPLES%%%%EXAMPLESDIR%%,g" \
		-e "s,${DATADIR},%%DATADIR%%,g" \
		-e "s,${PREFIX}/,,g" | sort
	@${FIND} ${STAGEDIR} -type d | sed -e "s,${STAGEDIR},,g" \
		| while read line; do \
		${GREP} -qw "^$${line}$$" ${WRKDIR}/.mtree || { \
			if [ -n "$${line}" ]; then \
				${ECHO_CMD} "@dirrm $${line}"; \
			fi ; \
		}; \
		done | ${SORT} -r | ${SED} \
		-e "s,\(.*\)${DOCSDIR},%%PORTDOCS%%\1%%DOCSDIR%%,g" \
		-e "s,\(.*\)${EXAMPLESDIR},%%PORTEXAMPLES%%\1%%EXAMPLESDIR%%,g" \
		-e "s,${DATADIR},%%DATADIR%%,g" \
		-e "s,${PREFIX},,g"
.endif