Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michael-o opened this issue Nov 2, 2022 · 1 comment

Comments

@michael-o
Copy link

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

@michael-o
Copy link
Author

Here is a workaround, but ugly:

# Need to use echo. See https://github.com/freebsd/portmaster/issues/74
CMD echo | env PAGER="/usr/bin/true" portmaster -dG -m -s --no-confirm --no-term-title $(cat /files/software)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant