vn971 / rua

Build tool for Arch Linux providing control, review and jailed build options
GNU General Public License v3.0
424 stars 42 forks source link

Add an option to merge and accept all changes #147

Open gnzlbg opened 3 years ago

gnzlbg commented 3 years ago

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.

vn971 commented 3 years ago

@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