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

Glitches out with --yes #143

Open
MenacingPerson opened this issue Mar 29, 2022 · 6 comments
Open

Glitches out with --yes #143

MenacingPerson opened this issue Mar 29, 2022 · 6 comments
Labels

Comments

@MenacingPerson
Copy link

General description of the problem:

When you use --yes, and when pacman asks to choose between 2 packages, it bugs out:

image

Steps to reproduce the problem:

  1. Have a scenario where pacman requires you to choose
  2. Use --yes flag in aconfmgr
  3. See bug

Configuration:

AddPackage initramfs

Expected result:

It would pass the --noconfirm flag to pacman instead of piping yes command to it

Actual result:

It basically pipes yes command to it

Log:

Can't copy, on a VM

Additional context:

No response

@CyberShadow
Copy link
Owner

CyberShadow commented Mar 29, 2022

It would pass the --noconfirm flag to pacman instead of piping yes command to it

We can't do that for package installation because pacman defaults some prompts to "no".

The workaround is to explicitly specify in your aconfmgr configuration the choices that pacman asks for, but I can't think of a panacea other than to change it in pacman (which the pacman maintainers may not be open to - presumably they made those prompts default to "no" for a reason) or use something complicated like expect.

@MenacingPerson
Copy link
Author

We can't do that for package installation because pacman defaults some prompts to "no".

I've dealt with that. Especially when a package is in conflict (wireplumber and pms).

@MenacingPerson
Copy link
Author

Maybe the pacman devs can add a --yes flag that says yes to everything, even questionable choices? Or maybe they'll reject that too?

CyberShadow added a commit that referenced this issue Mar 29, 2022
This reverts commit cd1c4b0.

Not a universal solution as pacman asks for not just yes-or-no
questions, see e.g.
#143.

Let's park this feature until we have a compelling, test-case-backed
use case for it.  For now, users will need to occasionally run
aconfmgr in interactive mode to confirm prompts that pacman deems
too dangerous for --noconfirm.
@CyberShadow
Copy link
Owner

Right.

That said, if both situations can be resolved by changing the aconfmgr configuration to one such that pacman does not produce either type of prompt, then not piping yes is less evil, so maybe we could just try that first.

Maybe the pacman devs can add a --yes flag that says yes to everything, even questionable choices? Or maybe they'll reject that too?

Well, I don't know. They might very well say that pacman is meant to be a user-facing tool and they don't want to support users who stupidly ran it with --yes without thinking and that for automated non-interactive use cases we should build our own libalpm frontend, but that doesn't really work for aconfmgr.

@MenacingPerson
Copy link
Author

That said, if both situations can be resolved by changing the aconfmgr configuration to one such that pacman does not produce either type of prompt, then not piping yes is less evil, so maybe we could just try that first.

I don't understand what you mean.

Well, I don't know. They might very well say that pacman is meant to be a user-facing tool and they don't want to support users who stupidly ran it with --yes without thinking and that for automated non-interactive use cases we should build our own libalpm frontend, but that doesn't really work for aconfmgr.

They could make it stupidly long, something like --i-am-a-machine-i-do-not-care-if-this-breaks-my-system-and-pacman-devs-have-no-liability?

@CyberShadow
Copy link
Owner

CyberShadow commented Mar 29, 2022

There's two relevant situations that can occur here.

The first one is the one that cd1c4b0 attempted to address:

  • Conditions: aconfmgr requests pacman to install a package which conflicts with another, previously-installed package (possibly a dependency which aconfmgr doesn't directly know about).
  • What happens: pacman asks if it should replace the package with the one specified on the command line (or the dependency of one).
  • How to automate: answer y.
  • How to work around: if we uninstall the old package first (and everything that requires it) before attempting to install its replacement, we could avoid such prompts. However, this might not be feasible in all cases. When the package in question is pinned (not a dependency), this already should be the case, as aconfmgr first uninstalls any unwanted packages before installing new ones.

The second one is the one seen here:

  • Conditions: aconfmgr requests pacman to install (usually by a dependency) a virtual package, i.e. something provided by several other packages.
  • What happens: pacman asks the user which package it should install.
  • How to automate: answer 1 or the correct choice.
  • How to work around: specify the wanted package explicitly among the list of packages to install, so pacman doesn't have to guess or ask the user.

It does look like the user has a more reliable workaround for the second situation, but maybe there's something more we can do for the first case that would not involve piping yes.

@CyberShadow CyberShadow changed the title [Bug]: Glitches out with --yes Glitches out with --yes Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants