Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/uniquefiles.mk
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | if [ ! -e ${STAGEDIR}${PREFIX}/$${fname} -a ! -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ | ||||
${LN} -s ${PREFIX}/$${newf} ${STAGEDIR}${PREFIX}/$${fname}; \ | ${LN} -s ${PREFIX}/$${newf} ${STAGEDIR}${PREFIX}/$${fname}; \ | ||||
${ECHO_CMD} LINKED:$${newf}:$${fname} >> ${_UNIQUEPKGLIST}; \ | ${ECHO_CMD} LINKED:$${newf}:$${fname} >> ${_UNIQUEPKGLIST}; \ | ||||
fi | fi | ||||
.else | .else | ||||
# We are not symlinking the renamed binary. | # We are not symlinking the renamed binary. | ||||
_DO_CONDITIONAL_SYMLINK= ${DO_NADA} | _DO_CONDITIONAL_SYMLINK= ${DO_NADA} | ||||
.endif | .endif | ||||
_USES_stage+= 775:move-uniquefiles | |||||
move-uniquefiles: | move-uniquefiles: | ||||
.if ${UNIQUE_PREFIX_FILES} || ${UNIQUE_FIND_PREFIX_FILES} | .if ${UNIQUE_PREFIX_FILES} || ${UNIQUE_FIND_PREFIX_FILES} | ||||
@${ECHO_MSG} "===> Creating unique files: Move files needing PREFIX"; | @${ECHO_MSG} "===> Creating unique files: Move files needing PREFIX"; | ||||
.endif | .endif | ||||
.for entry in ${UNIQUE_PREFIX_FILES} | .for entry in ${UNIQUE_PREFIX_FILES} | ||||
@fname=${entry}; \ | @fname=${entry}; \ | ||||
if [ -e ${STAGEDIR}${PREFIX}/$${fname} -o -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ | if [ -e ${STAGEDIR}${PREFIX}/$${fname} -o -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ | ||||
newf=$${fname%/*}/${UNIQUE_PREFIX}$${fname##*/} ; \ | newf=$${fname%/*}/${UNIQUE_PREFIX}$${fname##*/} ; \ | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | else \ | ||||
${ECHO_MSG} "Makefile error: UNIQUE (suffix): $${fname} not found"; \ | ${ECHO_MSG} "Makefile error: UNIQUE (suffix): $${fname} not found"; \ | ||||
${FALSE}; \ | ${FALSE}; \ | ||||
fi; \ | fi; \ | ||||
done; | done; | ||||
.endif | .endif | ||||
# Using .if exists(${_UNIQUEPKGPLIST} below instead of the sh test | # Using .if exists(${_UNIQUEPKGPLIST} below instead of the sh test | ||||
# does not work in poudriere. It works fine on the CLI, though... | # does not work in poudriere. It works fine on the CLI, though... | ||||
_USES_stage+= 950:move-uniquefiles-plist | |||||
move-uniquefiles-plist: | move-uniquefiles-plist: | ||||
@if [ -e ${_UNIQUEPKGLIST} ]; then \ | @if [ -e ${_UNIQUEPKGLIST} ]; then \ | ||||
orgIFS=$$IFS; IFS=":"; while read command entry newentry; do \ | orgIFS=$$IFS; IFS=":"; while read command entry newentry; do \ | ||||
IFS=$$orgIFS; \ | IFS=$$orgIFS; \ | ||||
case $${command} in \ | case $${command} in \ | ||||
MOVED) \ | MOVED) \ | ||||
${REINPLACE_CMD} -e "s|^$${entry}$$|$${newentry}|" ${TMPPLIST}; \ | ${REINPLACE_CMD} -e "s|^$${entry}$$|$${newentry}|" ${TMPPLIST}; \ | ||||
;; \ | ;; \ | ||||
Show All 13 Lines |