Skip to content

Commit

Permalink
Merge branch 'joyent/feature/ctf/trunk' into joyent/release/trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Perkin committed Jan 14, 2021
2 parents 6ccda23 + e972c52 commit 0c062b5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
19 changes: 18 additions & 1 deletion mk/install/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -347,20 +347,37 @@ post-install:
.PHONY: install-ctf
install-ctf: plist
@${STEP_MSG} "Generating CTF data"
@${RM} -f ${WRKDIR}/.ctfdata ${WRKDIR}/.ctffail ${WRKDIR}/.ctfnox
${RUN}cd ${DESTDIR:Q}${PREFIX:Q}; \
${CAT} ${_PLIST_NOKEYWORDS} | while read f; do \
case "$${f}" in \
${CTF_FILES_SKIP:@p@${p}) continue ;;@} \
*) ;; \
esac; \
[ ! -h "$${f}" ] || continue; \
/bin/file -b "$${f}" | grep ^ELF >/dev/null || continue; \
if /bin/elfdump "$${f}" | grep SUNW_ctf >/dev/null; then \
continue; \
fi; \
tmp_f="$${f}.XXX"; \
if ${CTFCONVERT} -o "$${tmp_f}" "$${f}" 2>/dev/null; then \
if err=`${CTFCONVERT} -o "$${tmp_f}" "$${f}" 2>&1`; then \
if [ -f "$${tmp_f}" -a -f "$${f}" ]; then \
${MV} "$${tmp_f}" "$${f}"; \
fi; \
fi; \
${RM} -f "$${tmp_f}"; \
if /bin/elfdump "$${f}" | grep SUNW_ctf >/dev/null; then \
${ECHO} $${f} \
| ${SED} -e 's|^${DESTDIR}||' \
>>${WRKDIR}/.ctfdata; \
[ -x "$${f}" ] || ${ECHO} $${f} \
| ${SED} -e 's|^${DESTDIR}||' \
>>${WRKDIR}/.ctfnox; \
else \
${ECHO} "$${f}: $${err}" \
| ${SED} -e 's|^${DESTDIR}||' \
>>${WRKDIR}/.ctffail; \
fi; \
done

######################################################################
Expand Down
24 changes: 24 additions & 0 deletions mk/pkgformat/pkg/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@ ${STAGE_PKGFILE}: ${_CONTENTS_TARGETS}
${RUN} tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \
${MV} -f "$$tmpname" ${.TARGET}
.endif
@${RUN}${MKDIR} ${PACKAGES}/ctfdata 2>/dev/null || ${TRUE}; \
${RM} -f ${PACKAGES}/ctfdata/${PKGNAME}; \
if [ -f ${WRKDIR}/.ctfdata -a -d ${PACKAGES}/ctfdata ]; then \
${STEP_MSG} "Copying CTF data"; \
${MKDIR} ${PACKAGES}/ctfdata; \
${MV} ${WRKDIR}/.ctfdata \
${PACKAGES}/ctfdata/${PKGNAME}; \
fi; \
${MKDIR} ${PACKAGES}/ctffail 2>/dev/null || ${TRUE}; \
${RM} -f ${PACKAGES}/ctffail/${PKGNAME}; \
if [ -f ${WRKDIR}/.ctffail -a -d ${PACKAGES}/ctffail ]; then \
${STEP_MSG} "Copying CTF failures"; \
${MKDIR} ${PACKAGES}/ctffail; \
${MV} ${WRKDIR}/.ctffail \
${PACKAGES}/ctffail/${PKGNAME}; \
fi; \
${MKDIR} ${PACKAGES}/ctfnox 2>/dev/null || ${TRUE}; \
${RM} -f ${PACKAGES}/ctfnox/${PKGNAME}; \
if [ -f ${WRKDIR}/.ctfnox -a -d ${PACKAGES}/ctfnox ]; then \
${STEP_MSG} "Copying CTF non-executables"; \
${MKDIR} ${PACKAGES}/ctfnox; \
${MV} ${WRKDIR}/.ctfnox \
${PACKAGES}/ctfnox/${PKGNAME}; \
fi

.if ${PKGFILE} != ${STAGE_PKGFILE}
${PKGFILE}: ${STAGE_PKGFILE}
Expand Down

0 comments on commit 0c062b5

Please sign in to comment.