Closed VukoDrakkeinen closed 4 years ago
Besides the minor comments above, everything seems good. Thanks a lot for the PR! I'll also need to playtest it a bit, but afterwards, I expect to merge.
Man, writing concise and clear error messages/warnings is HARD. I'm still not fully satisfied, but I think it should be somewhat fine now. What do you think?
Merged! Thanks a lot! I did touch up the logging just a tiny bit: https://github.com/vn971/rua/commit/db9c6867fdc5dc82627cda6466196cb1448b5edb An extra pair of eyes is always useful in things like docs. Also, I removed the "$" from the logging if you don't mind, because this symbol might not necessarily be written by the user, and could possibly confuse (IDK? Just left it out for simplicity).
UPD: hmm, we apparently didn't catch it and there were no tests for that, but rua
now breaks if you execute a command like rua search abcd
from root. It will complain saying:
rua search test
RUA does not allow building as root.
Also, makepkg will not allow you building as root anyway.
so basically, the users::get_current_uid()
check is now done earlier/eagerly, and we construct RuaPaths
even when we don't need it (as e.g. for search
action).
I'll think on how to de-compose those two back.
I think the problem can be solved by moving the makepkg
config checks to the function that instantiates RuaPaths, because one only makes sense with the other, currently.
I'll try to do that now.
UPD: hmm, we apparently didn't catch it and there were no tests for that, but
rua
now breaks if you execute a command likerua search abcd
from root.
Hmm, in a similar vein, non-building commands (search
, info
, etc) will fail when executed inside rua
(Error: another RUA instance already running.
)
@VukoDrakkeinen yeah, indeed. I think that problem can be tackled separately though, it shouldn't be hard.
Meanwhile I'm finishing the fix to make root
and PKGEXT
evaluations "lazy" (only for needed commands).
Previously, if set only e.g. in
/etc/makepkg.conf
, options likePKGEXT
were ignored and defaults were used instead.Unfortunately, since
makepkg
configuration files are valid scripts, reading them involves shelling out. Non-ideal, but I feel that ignoring them is strictly worse.