rua icon indicating copy to clipboard operation
rua copied to clipboard

Add an option to merge and accept all changes

Open gnzlbg opened this issue 3 years ago • 1 comments

It would be nice to have an option to merge and accept all changes. I have very few packages from the AUR installed, and i personally vet the maintainers and only use packages from maintainers that I trust.

Having to M and O these packages every time is annoying in this case. While I understand the intent, I never actually inspect the diffs, and only sometimes run shellcheck.

I know this might go against the intent of rua and what one is supposed to do, but because I trust the maintainers of these packages, I don't really feel the need to do that (particularly if I am the maintainer).

Would it be possible to add a way to automatically merge and accept the changes, e.g., via an option or an environment variable or some other way?

Thanks.

gnzlbg avatar Jan 08 '21 08:01 gnzlbg

@gnzlbg Hi! I think that should be possible. You can introduce a flag like --trust, e.g.

rua upgrade --trust=abc,def

and make the environment variable RUA_TRUST also assign to the same parameter.

To make this work, you'll have to introduce the new parameter in cli_args.rs, and when a trusted package is upgraded, attempt merge (fall back to prompt if it fails) and auto-accept the package if merged succeeded.

Overall, such a feature is indeed a bit on the edge from a security perspective. But if it's explicit enough, explained enough and turned off by default, I'm good with having this option. Will definitely accept a quality PR to introduce this

vn971 avatar Jan 10 '21 16:01 vn971