Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159687662
D44593.id144574.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D44593.id144574.diff
View Options
diff --git a/Mk/Scripts/functions.sh b/Mk/Scripts/functions.sh
--- a/Mk/Scripts/functions.sh
+++ b/Mk/Scripts/functions.sh
@@ -28,14 +28,20 @@
PREFIX="${1}"
parse_comments="${2:-1}"
+ if [ "${VARSUBS:-}" = "" ]; then
+ VARSUBS=$(mktemp)
+ export VARSUBS
+ fi
+
cwd=${PREFIX}
cwd_save=
commented_cwd=
- _strip_perms | while read -r line; do
+ _strip_perms | while read -r _line; do
# Handle deactivated OPTIONS. Treat "@comment file" as being in
# the plist so it does not show up as an orphan. PLIST_SUB uses
# a @comment to deactive files. XXX: It would be better to
# make all ports use @ignore instead of @comment.
+ line=$(echo ${_line} | sed -f ${VARSUBS})
if [ ${parse_comments} -eq 1 -a -z "${line%%@comment *}" ]; then
line="${line##*@comment }"
# Strip (owner,group,perm) from keywords
@@ -75,6 +81,18 @@
*) echo >&3 "${comment}${cwd}/${line%/}" ;;
esac
;;
+ @var\ *)
+ set -- $line
+ shift
+ var=$1
+ shift
+ value="$@"
+ echo "s,%%${var}%%,${value},g;" >> ${VARSUBS}
+ ;;
+ @include\ *)
+ export _IN_INCLUDE=1
+ parse_plist "${PREFIX}" ${parse_comments} < ${line#* }
+ ;;
# Handle [file] Keywords
@info\ *|@shell\ *|@xmlcatmgr\ *)
set -- $line
@@ -148,6 +166,12 @@
*) echo "${comment}${cwd}/${line}" ;;
esac
done
+ if [ "${_IN_INCLUDE:-}" = "" ]; then
+ rm ${VARSUBS}
+ unset VARSUBS
+ else
+ unset _IN_INCLUDE
+ fi
}
validate_env() {
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -4642,47 +4642,51 @@
# Generate packing list. Also tests to make sure all required package
# files exist.
-PLIST_SUB_SANITIZED= ${PLIST_SUB:N*_regex=*}
-
. if !target(generate-plist)
generate-plist: ${WRKDIR}
@${ECHO_MSG} "===> Generating temporary packing list"
@${MKDIR} ${TMPPLIST:H}
@if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
@>${TMPPLIST}
+ @echo @include ${WRKDIR}/subs.plist >> ${TMPPLIST}
@for file in ${PLIST_FILES}; do \
- ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
+ ${ECHO_CMD} $${file} >> ${TMPPLIST}; \
done
. for sp in ${_PKGS}
. if ${sp} != ${PKGBASE}
@for file in ${PLIST_FILES${_SP.${sp}}}; do \
- ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's/^/@@${_SP.${sp}:S/^.//}@@/' >> ${TMPPLIST}; \
+ ${ECHO_CMD} $${file} >> ${TMPPLIST}; \
done
. endif
. endfor
. if !empty(PLIST)
. for f in ${PLIST}
@if [ -f "${f}" ]; then \
- ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${f} >> ${TMPPLIST}; \
+ cat ${f} >> ${TMPPLIST}; \
for i in owner group mode; do ${ECHO_CMD} "@$$i"; done >> ${TMPPLIST}; \
fi
. endfor
. endif
. for dir in ${PLIST_DIRS}
- @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dir ,' >> ${TMPPLIST}
+ @${ECHO_CMD} "@dir ${dir}" >> ${TMPPLIST}
. endfor
. for sp in ${_PKGS}
. if ${sp} != ${PKGBASE}
. for dir in ${PLIST_DIRS${_SP.${sp}}}
- @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@@${_SP.${sp}:S/^.//}@@@dir ,' >> ${TMPPLIST}
+ @${ECHO_CMD} "@dir ${dir}" >> ${TMPPLIST}
. endfor
. endif
. endfor
. endif
-${TMPPLIST}:
+${WRKDIR}/subs.plist:
+. for sub in ${PLIST_SUB}
+ @echo "@var ${sub:C/=/ /}" >> ${.TARGET}
+. endfor
+
+${TMPPLIST}: ${WRKDIR}/subs.plist
@cd ${.CURDIR} && ${MAKE} generate-plist
. for _type in EXAMPLES DOCS
@@ -4812,7 +4816,7 @@
. endif
. if !target(check-plist)
-check-plist: stage
+check-plist: stage ${WRKDIR}/subs.plist
@${ECHO_MSG} "====> Checking for pkg-plist issues (check-plist)"
@${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh checkplist
@${ECHO_MSG} "===> No pkg-plist issues found (check-plist)"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 18, 2:30 AM (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34040926
Default Alt Text
D44593.id144574.diff (3 KB)
Attached To
Mode
D44593: Mk/bsd.port.mk: stop using sed for plist
Attached
Detach File
Event Timeline
Log In to Comment