portmaster icon indicating copy to clipboard operation
portmaster copied to clipboard

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

Open michael-o opened this issue 3 years ago • 1 comments

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: https://github.com/freebsd/portmaster/blob/f273c9160333911ba1c7be3611a6cd34aefd3816/portmaster#L3221-L3255

michael-o avatar Nov 02 '22 12:11 michael-o

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)

michael-o avatar Nov 02 '22 17:11 michael-o