freebsd / portmaster

FreeBSD port management script without external databases or languages
81 stars 40 forks source link

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

Open michael-o opened 2 years ago

michael-o commented 2 years ago

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 commented 2 years ago

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)