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

--no-confirm ignored on package creation #66

Open
schmied opened this issue Dec 30, 2021 · 2 comments
Open

--no-confirm ignored on package creation #66

schmied opened this issue Dec 30, 2021 · 2 comments

Comments

@schmied
Copy link

schmied commented Dec 30, 2021

portmaster/portmaster

Lines 1689 to 1697 in b375cf0

echo -e "\n===>>> Package creation failed for ${2}!\n"
[ -n "$backup" -a -n "$PM_IGNORE_FAILED_BACKUP_PACKAGE" ] && return
echo "===>>> Ignore this error [i]"
echo "===>>> Abort update [a]"
echo "===>>> Retry [r]"
echo -e "\n===>>> How would you like to proceed? [i] \c"
read answer ; echo ''

@stesser
Copy link
Member

stesser commented Dec 30, 2021

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
Copy link
Author

schmied commented Dec 31, 2021

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.:

portmaster/portmaster

Lines 3548 to 3553 in b375cf0

echo -e "\n===>>> There is no valid package to install\n"
echo "===>>> Abort update [a]"
echo "===>>> Retry fetch [r]"
echo "===>>> Continue if possible [c]"
echo -e "\n===>>> How would you like to proceed? [a] \c"
read answer ; echo ''

FYI in my use case it is a missing config file that I remove intentionally after the installation of the apache24 port. Thanks!

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

2 participants