- Add pkg-plist.ignore support which contains a list of files to be ignored for check-orphans. This is part of a scheme for later sub-packages and is a special case of files that will not be packaged. This list is needed as otherwise orphans in the directory will be false-positive leading to potentially missing new orphans that are real problems. By listing the known orphans that don't need to be installed, the maintainer intent is clear and no false-positive orphans exist. This currently works by removing the files from the stagedir, but could be reworked to ignore the files in check-orphans, though poudriere has its own implementation for orphan checking that this implementation does support. Format for file: @cwd file @dirrm dir PLIST_SUB usage is supported. # svn status M Mk/bsd.port.mk M sysutils/beadm/Makefile A sysutils/beadm/pkg-plist.ignore Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk (revision 347113) +++ Mk/bsd.port.mk (working copy) @@ -2269,28 +2269,30 @@ COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$ .endif # The user can override the NO_PACKAGE by specifying this from # the make command line .if defined(FORCE_PACKAGE) .undef NO_PACKAGE .endif DESCR?= ${PKGDIR}/pkg-descr PLIST?= ${PKGDIR}/pkg-plist +PKG_IGNORED= ${PKGDIR}/pkg-plist.ignore PKGHELP?= ${PKGDIR}/pkg-help PKGINSTALL?= ${PKGDIR}/pkg-install PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall PKGREQ?= ${PKGDIR}/pkg-req PKGMESSAGE?= ${PKGDIR}/pkg-message TMPPLIST?= ${WRKDIR}/.PLIST.mktmp TMPPLIST_SORT?= ${WRKDIR}/.PLIST.mktmp.sorted +TMPPKG_IGNORED?= ${WRKDIR}/.PLIST.ignore.mktmp TMPGUCMD?= ${WRKDIR}/.PLIST.gucmd .if !defined(PKG_ARGS) PKG_ARGS= -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS} .if !defined(NO_MTREE) PKG_ARGS+= -m ${MTREE_FILE} .endif .if defined(PKGORIGIN) PKG_ARGS+= -o ${PKGORIGIN} .endif @@ -5599,20 +5605,55 @@ generate-plist: @cd ${.CURDIR} && { ${MAKE} pretty-print-config | fold -sw 120 | ${SED} -e 's/^/@comment OPTIONS:/'; } >> ${TMPPLIST} .endif .endif ${TMPPLIST}: @cd ${.CURDIR} && ${MAKE} generate-plist ${TMPPLIST_SORT}: ${TMPPLIST} @${SORT} -u ${TMPPLIST} >${TMPPLIST_SORT} +.if !defined(NO_STAGE) +${TMPPKG_IGNORED}: + @cd ${.CURDIR} && ${MAKE} generate-pkg-ignored + +generate-pkg-ignored: + @>${TMPPKG_IGNORED}; + @if [ -f ${PKG_IGNORED} ]; then \ + ${ECHO_MSG} "===> Generating ignored files list"; \ + ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPKG_IGNORED}; \ + ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PKG_IGNORED} >> ${TMPPKG_IGNORED}; \ + fi + +remove-ignored: ${TMPPKG_IGNORED} + @if [ -f "${PKG_IGNORED}" ]; then \ + ${ECHO_CMD} "===> Removing ignored files from stagedir"; \ + while read file data; do \ + if [ "$${file}" = "@cwd" ]; then \ + cwd="$${data}"; \ + continue; \ + elif [ "$${file}" = "@dirrm" ]; then \ + ${ECHO_CMD} "$${cwd}/$${data}" >> ${TMPPKG_IGNORED}.dirs; \ + continue; \ + elif [ -n "$${data}" ]; then \ + continue; \ + else \ + ${RM} ${STAGEDIR}$${cwd}/$${file} || :; \ + fi; \ + done < ${TMPPKG_IGNORED}; \ + if [ -f "${TMPPKG_IGNORED}.dirs" ]; then \ + ${SORT} -ur ${TMPPKG_IGNORED}.dirs > ${TMPPKG_IGNORED}.dirs.sorted; \ + while read dir; do \ + ${RMDIR} ${STAGEDIR}$${dir} || :; \ + done < ${TMPPKG_IGNORED}.dirs.sorted; \ + fi; \ + fi +.endif + .if !target(add-plist-docs) .if defined(PORTDOCS) && !defined(NOPORTDOCS) add-plist-docs: @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ fi .for x in ${PORTDOCS} @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ if [ ! -e ${STAGEDIR}${DOCSDIR}/${x} ]; then \ @@ -6467,31 +6508,32 @@ _BUILD_SEQ= build-message pre-build pre _STAGE_DEP= build _STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install generate-plist \ pre-su-install .if defined(NEED_ROOT) _STAGE_SUSEQ= create-users-groups do-install desktop-file-post-install kmod-post-install \ shared-mime-post-install webplugin-post-install \ post-install post-install-script move-uniquefiles post-stage compress-man \ install-rc-script install-ldconfig-file install-license \ install-desktop-entries add-plist-info add-plist-docs add-plist-examples \ - add-plist-data add-plist-post move-uniquefiles-plist fix-plist-sequence + add-plist-data add-plist-post move-uniquefiles-plist fix-plist-sequence \ + remove-ignored .if defined(DEVELOPER) _STAGE_SUSEQ+= stage-qa .endif .else _STAGE_SEQ+= create-users-groups do-install desktop-file-post-install kmod-post-install \ shared-mime-post-install webplugin-post-install post-install post-install-script \ move-uniquefiles post-stage compress-man install-rc-script install-ldconfig-file \ install-license install-desktop-entries add-plist-info add-plist-docs \ add-plist-examples add-plist-data add-plist-post move-uniquefiles-plist \ - fix-plist-sequence + fix-plist-sequence remove-ignored .if defined(DEVELOPER) _STAGE_SEQ+= stage-qa .endif .endif .if defined(WITH_PKGNG) _INSTALL_DEP= stage _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed _INSTALL_SUSEQ= fake-pkg security-check _PACKAGE_DEP= stage Index: sysutils/beadm/Makefile =================================================================== --- sysutils/beadm/Makefile (revision 347113) +++ sysutils/beadm/Makefile (working copy) @@ -11,24 +11,28 @@ MASTER_SITES= GH \ MAINTAINER= bdrewery@FreeBSD.org COMMENT= Solaris-like utility to manage Boot Environments on ZFS LICENSE= BSD USE_GITHUB= yes GH_ACCOUNT= vermaden GH_COMMIT= 09ffd9c GH_TAGNAME= ${GH_COMMIT} +PLIST_SUB+= PORTNAME=${PORTNAME} + NO_BUILD= YES CONFLICTS_INSTALL= beadm-devel-* -PLIST_FILES= sbin/${PORTNAME} \ - man/man1/${PORTNAME}.1.gz +PLIST_FILES= sbin/${PORTNAME} do-install: ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} \ ${STAGEDIR}${PREFIX}/sbin/${PORTNAME} ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 \ ${STAGEDIR}${MANPREFIX}/man/man1/ + ${MKDIR} ${STAGEDIR}${PREFIX}/prefixtest + ${MKDIR} ${STAGEDIR}/test/2 + ${MKDIR} ${STAGEDIR}/test/1/2 .include Index: sysutils/beadm/pkg-plist.ignore =================================================================== --- sysutils/beadm/pkg-plist.ignore (revision 0) +++ sysutils/beadm/pkg-plist.ignore (working copy) @@ -0,0 +1,7 @@ +man/man1/%%PORTNAME%%.1.gz +@dirrm prefixtest +@cwd / +@dirrm test +@dirrm test/1 +@dirrm test/1/2 +@dirrm test/2 Property changes on: sysutils/beadm/pkg-plist.ignore ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property