Skip to content

Cannot non-interactively install ports when direct or automatic port is locked/+IGNOREME #74

@michael-o

Description

@michael-o

I am on Portmaster 3.22 running in a Bastille jail 12.3-RELEASE-p7 on jailhost: FreeBSD 12.3-STABLE 53bc9be1c

My usecase is to automate jail creation with Bastillefiles and one file contains:

CMD env PAGER="/usr/bin/true" portmaster -dG -m -s --no-confirm --no-term-title $(cat /files/software)

Due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266771 I had to lock bash with pkg lock -y bash otherwise portmaster would bindly upgrade bash and fail the build. Now when I apply the Bastille template in the middle of the build portmaster asks me interactively how to proceed with the locked port.
Since -i isn't provided and according to --no-confirm it should assume the default value (no) would be used.

Output:

# portmaster -dG -m -s --no-confirm --no-term-title  shells/bash

===>>> bash-5.1.16 has an +IGNOREME file or the package is locked
        ===>>> Update anyway? y/n [n]

This is the section in question:

portmaster/portmaster

Lines 3221 to 3255 in f273c91

if pm_islocked "$upg_port"; then
# Adding to CUR_DEPS means we will not get here in the build
if [ -z "$PM_BUILDING" ]; then
# Only need to prompt for this once if -ai
case "$INTERACTIVE_YES" in
*:${upg_port}:*) ;; # Let it build
*) if [ -z "$FETCH_ONLY" ]; then
echo ''
echo "===>>> $upg_port has an +IGNOREME file or the package is locked"
get_answer_g n y "\t===>>> Update anyway? y/n"
case "$?" in
1) ;; # Let it build
0) CUR_DEPS="${CUR_DEPS}${upg_port}:${portdir}:"
if [ ${dep_of_deps:-0} -gt 0 ]; then
dep_of_deps=$(( $dep_of_deps - 1 ))
[ -n "$PM_FIRST_PASS" ] &&
num_of_deps=$(( $num_of_deps - 1 ))
fi
safe_exit ;;
esac
else
echo ''
echo "===>>> $upg_port has an +IGNOREME file or the package is locked, ignoring"
echo ''
CUR_DEPS="${CUR_DEPS}${upg_port}:${portdir}:"
safe_exit
fi ;;
esac
elif [ -n "$PM_URB_UP" ]; then
echo ''
echo "===>>> $upg_port has an +IGNOREME file or the package is locked, ignoring"
echo ''
safe_exit
fi
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions