freebsd / portmaster

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

--no-confirm ignored on package creation #66

Open schmied opened 2 years ago

schmied commented 2 years ago

https://github.com/freebsd/portmaster/blob/b375cf09c7a58d26b2500805206730e21225e38b/portmaster#L1689-L1697

stesser commented 2 years ago

The --no-confirm option makes portmaster assume a yes or no reply. What should be done in this case? The only safe option seems to be to assume "Abort update" in this case? But the semantics of --no-confirm seem to suggest that the default action "Ignore this error" should be taken - which I do not consider a reasonable action if not approved by the user.

schmied commented 2 years ago

I am totally with you regarding the conflict between the safety concern and the default option. In my special use case I would prefer the default 'Ignore this error'. The question is whether or not to add complexity in configuration and code. But in the current state the script is not in all cases useful in scripted environments. The simplest way I can think of is introducing a knob 'Continue on (noncritical) error' or 'Skip on (noncritical) error' or something. That can be used in other parts of the script too and no need to introduce another mechanism there, e.g.: https://github.com/freebsd/portmaster/blob/b375cf09c7a58d26b2500805206730e21225e38b/portmaster#L3548-L3553 FYI in my use case it is a missing config file that I remove intentionally after the installation of the apache24 port. Thanks!