Changeset View
Changeset View
Standalone View
Standalone View
Mk/Scripts/check-stagedir.sh
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | sort_dfs() { | ||||
while read -r dir; do | while read -r dir; do | ||||
grep "^[0-9]* ${dir}$" ${WRKDIR}/.staged-dirs-dfs-sorted | grep "^[0-9]* ${dir}$" ${WRKDIR}/.staged-dirs-dfs-sorted | ||||
done | sort -n | cut -d ' ' -f2- | done | sort -n | cut -d ' ' -f2- | ||||
} | } | ||||
# Prepare sed(1) regex for PLIST_SUB_SED/PORTEXAMPLES/OPTIONS/... | # Prepare sed(1) regex for PLIST_SUB_SED/PORTEXAMPLES/OPTIONS/... | ||||
setup_plist_seds() { | setup_plist_seds() { | ||||
### HANDLE PORTDOCS/PORTEXAMPLES | ### HANDLE PORTDOCS/PORTEXAMPLES | ||||
sed_portdocsexamples="/%%DOCSDIR%%/s!^!%%PORTDOCS%%!g; /%%EXAMPLESDIR%%/s!^!%%PORTEXAMPLES%%!g;" | sed_portdocsexamples="/%%DOCSDIR%%/s!^!%%PORTDOCS%%!g; /%%EXAMPLESDIR%%/s!^!%%PORTEXAMPLES%%!g;" | ||||
mat: If you don't rename the variable here, you don't need most of the changes afterwards.
The… | |||||
if [ ${makeplist} -eq 0 ]; then | if [ ${makeplist} -eq 0 ]; then | ||||
# echo "=====> Using OPTIONS: ${PORT_OPTIONS}" | /usr/bin/fmt -w 79 | \ | # echo "=====> Using OPTIONS: ${PORT_OPTIONS}" | /usr/bin/fmt -w 79 | \ | ||||
# sed -e '2,$s/^/ /' | # sed -e '2,$s/^/ /' | ||||
# Handle magical PORT* features | # Handle magical PORT* features | ||||
for option in DOCS EXAMPLES; do | for option in DOCS EXAMPLES; do | ||||
want_option=0 | want_option=0 | ||||
case " ${PORT_OPTIONS} " in | case " ${PORT_OPTIONS} " in | ||||
*\ ${option}\ *) want_option=1 ;; | *\ ${option}\ *) want_option=1 ;; | ||||
esac | esac | ||||
[ ${want_option} -eq 0 ] && \ | [ ${want_option} -eq 0 ] && \ | ||||
sed_portdocsexamples="${sed_portdocsexamples} /^%%PORT${option}%%/d;" | sed_portdocsexamples="${sed_portdocsexamples} /^%%PORT${option}%%/d;" | ||||
done | done | ||||
unset PORT_OPTIONS | unset PORT_OPTIONS | ||||
# This prevents L10N files showing up | |||||
if [ ! -z "${PLIST_AUTO_L10N}" ] ; then | |||||
sed_portdocsexamples="${sed_portdocsexamples} /^%%L10NDIR%%/d;" | |||||
fi | fi | ||||
fi | |||||
sed_plist_sub=$(mktemp -t sed_plist_sub) | sed_plist_sub=$(mktemp -t sed_plist_sub) | ||||
# We only exit 0 or exit 1 | # We only exit 0 or exit 1 | ||||
trap "rm -f ${sed_plist_sub}" EXIT 1 | trap "rm -f ${sed_plist_sub}" EXIT 1 | ||||
echo "${PLIST_SUB_SED}" | /bin/sh ${SCRIPTSDIR}/plist_sub_sed_sort.sh ${sed_plist_sub} | echo "${PLIST_SUB_SED}" | /bin/sh ${SCRIPTSDIR}/plist_sub_sed_sort.sh ${sed_plist_sub} | ||||
unset PLIST_SUB_SED | unset PLIST_SUB_SED | ||||
# Used for generate_plist | # Used for generate_plist | ||||
sed_files_gen="${sed_portdocsexamples} /^share\/licenses/d; \ | sed_files_gen="${sed_portdocsexamples} /^share\/licenses/d; \ | ||||
\#${LOCALBASE}/lib/debug#d;" | \#${LOCALBASE}/lib/debug#d;" | ||||
sed_dirs_gen="s,^,@dir ,; \ | sed_dirs_gen="s,^,@dir ,; \ | ||||
${sed_portdocsexamples} \ | ${sed_portdocsexamples} \ | ||||
/^@dir share\/licenses/d; \ | /^@dir share\/licenses/d; \ | ||||
\#@dir ${LOCALBASE}/lib/debug#d;" | \#@dir ${LOCALBASE}/lib/debug#d;" | ||||
# This prevents L10N files showing up | |||||
if [ ! -z "${PLIST_AUTO_L10N}" ] ; then | |||||
sed_files_gen="/^%%L10NDIR%%/d; ${sed_files_gen}" | |||||
fi | |||||
# These prevent ignoring DOCS/EXAMPLES dirs with sed_portdocsexamples | # These prevent ignoring DOCS/EXAMPLES dirs with sed_portdocsexamples | ||||
sed_files="/^share\/licenses/d; \ | sed_files="/^share\/licenses/d; \ | ||||
\#${LOCALBASE}/lib/debug#d;" | \#${LOCALBASE}/lib/debug#d;" | ||||
sed_dirs="s,^,@dir ,; \ | sed_dirs="s,^,@dir ,; \ | ||||
/^@dir share\/licenses/d; \ | /^@dir share\/licenses/d; \ | ||||
\#@dir ${LOCALBASE}/lib/debug#d;" | \#@dir ${LOCALBASE}/lib/debug#d;" | ||||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |
If you don't rename the variable here, you don't need most of the changes afterwards.
The variable already has a pretty long name, no need to make it longer.