freebsd / portmaster

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

--no-confirm overwritten in post_first_pass #68

Closed Helmut1972 closed 2 years ago

Helmut1972 commented 2 years ago

Hi,

portmaster --no-confirm -fBGd -y ca_root_nss

This unsets PM_NO_CONFIRM in post_first_pass

unset PM_FIRST_PASS PM_NO_CONFIRM

displaying the pkg-message after upgrade. Why?

Thank you!

stesser commented 2 years ago

Hi Helmut,

I'm not the original author of portmaster, only the maintainer after the author lost interest in it. Therefore I cannot answer why PM_NO_CONFIRM is being unset with any degree of security.

But you can easily see the author's commit message for that line here.

The "no confirm" option was meant to prevent repeated answers to yes/no questions while portmaster scans for outdated ports and there may be a choice of how to precede.

After the end of the first pass, there will not be any optional questions (for which a yes or no answer could be requested together with --no-confirm or PM_NO_CONFIRM). There will be questions if unexpected issues have been detected, and I do assume that these should not be automatically given the default answer.

But I do see the test for PM_NO_CONFIRM in parent_exit() to control whether the package messages are sent through an actual pager.

The PAGER variable could be initialized before PM_NO_CONFIRM is unset.

As a work-around you can also just pass "PAGER=cat" in the environment (or use "PAGER=cat portmaster ..."). I'll put this issue on a list of changes to consider - thanks for reporting ...

Helmut1972 commented 2 years ago

Works, thank you!

stesser commented 2 years ago

Close issue - the FreeBSD port has been updated to version 3.21, which includes this change.