Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2021-08-19 21:35:00 +0300
committerBryan Drewery <bryan@shatow.net>2021-08-19 22:53:45 +0300
commit0c3d98fd29d5af4836f4d64e34188e5b46044934 (patch)
treed36a214e83f752e26d314e728bcf8c0b7d2b06b0
parent16ba64a8a05a1dea2551e7cbece27c10977cd57e (diff)
bulk/testport: Detect *new but disabled* OPTIONS
It is possible that a port maintainer adds a new OPTION that is disabled by default but changes the behavior of the port compared to the previous version such that it disables a feature that was otherwise enabled by default. Fixes #900 (cherry picked from commit d16e1e2c0e3320ff5cab185ca4d9f2819b0f247d) Conflicts: src/share/poudriere/common.sh (download_from_repo handling) src/share/poudriere/include/pkg.sh
-rwxr-xr-xsrc/share/poudriere/common.sh30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index 5531bd90..92a4beaf 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -4420,7 +4420,7 @@ deps_fetch_vars() {
if [ "${CHECK_CHANGED_OPTIONS}" != "no" ] && \
have_ports_feature SELECTED_OPTIONS; then
- _changed_options="SELECTED_OPTIONS:O _selected_options"
+ _changed_options=yes
fi
if [ "${CHECK_CHANGED_DEPS}" != "no" ]; then
_changed_deps="LIB_DEPENDS _lib_depends RUN_DEPENDS _run_depends"
@@ -4442,7 +4442,8 @@ deps_fetch_vars() {
CATEGORIES categories \
IGNORE _ignore \
${_changed_deps} \
- ${_changed_options} \
+ ${_changed_options:+_PRETTY_OPTS='${SELECTED_OPTIONS:@opt@${opt}+@} ${DESELECTED_OPTIONS:@opt@${opt}-@}'} \
+ ${_changed_options:+'${_PRETTY_OPTS:O:C/(.*)([+-])$/\2\1/}' _selected_options} \
_PDEPS='${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}' \
'${_PDEPS:C,([^:]*):([^:]*):?.*,\2,:C,^${PORTSDIR}/,,:O:u}' \
_pkg_deps; then
@@ -4723,21 +4724,18 @@ pkg_get_options() {
local _compiled_options
get_pkg_cache_dir SHASH_VAR_PATH "${pkg}"
- if ! shash_get 'pkg' 'options' _compiled_options; then
+ if ! shash_get 'pkg' 'options2' _compiled_options; then
_compiled_options=
while mapfile_read_loop_redir key value; do
case "${value}" in
- off|false) continue ;;
+ off|false) key="-${key}" ;;
+ on|true) key="+${key}" ;;
esac
_compiled_options="${_compiled_options}${_compiled_options:+ }${key}"
done <<-EOF
$(injail ${PKG_BIN} query -F "/packages/All/${pkg##*/}" '%Ok %Ov' | sort)
EOF
- # Compat with pretty-print-config
- if [ -n "${_compiled_options}" ]; then
- _compiled_options="${_compiled_options} "
- fi
- shash_set 'pkg' 'options' "${_compiled_options}"
+ shash_set 'pkg' 'options2' "${_compiled_options}"
fi
if [ -n "${var_return}" ]; then
setvar "${var_return}" "${_compiled_options}"
@@ -5180,19 +5178,15 @@ delete_old_pkg() {
if have_ports_feature SELECTED_OPTIONS; then
shash_remove pkgname-options "${new_pkgname}" \
current_options || current_options=
- # pretty-print-config has a trailing space, so
- # pkg_get_options does as well. Add in for compat.
- if [ -n "${current_options}" ]; then
- current_options="${current_options} "
- fi
else
# Backwards-compat: Fallback on pretty-print-config.
- # XXX: If we know we can use bmake then this would work
- # make _SELECTED_OPTIONS='${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@} ${MULTI GROUP SINGLE RADIO:L:@otype@${OPTIONS_${otype}:@m@${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@}@}@}' -V _SELECTED_OPTIONS:O
current_options=$(injail /usr/bin/make -C \
${PORTSDIR}/${origin} \
- pretty-print-config | tr ' ' '\n' | \
- sed -n 's/^\+\(.*\)/\1/p' | sort -u | tr '\n' ' ')
+ pretty-print-config | \
+ sed -e 's,[^ ]*( ,,g' -e 's, ),,g' -e 's, $,,' | \
+ tr ' ' '\n' | \
+ sort -k1.2 | \
+ paste -d ' ' -s -)
fi
pkg_get_options compiled_options "${pkg}"