Closed vn971 closed 4 years ago
I just tested this on v0.17.4
and rua
does exit with Error: another RUA instance already running.
,
so I guess this can be considered fixed already.
Uh oh, this will also stop subcommands like info
and search
. Those should be allowed, arguably.
Yeah... Quite unfortunately though.
This got fixed as part of https://github.com/vn971/rua/commit/a56b8863a7ae8c48fd90d477a8c9bb209373ea7b
Because we now take the "uniqueness" lock as early as possible, we also do it before environment checks, which gives an error reason of:
Error: another RUA instance already running.
Hopefully understandable enough for situation of running rua inside rua.
Steps:
rua install xcalib
T
to go to a terminalrua
from this terminalExpected at this point: RUA tells you that you're running it inside itself, or fail with some other easy to understand reason
Actual behavior:
Possible solution: use the already existing mechanism to prevent running multiple instances of RUA simultaneously, before doing other filesystem/environment checks. This will make the error message be something like:
Another RUA instance already running.
which is arguably more understandable. It is one step from being trivial in that code grouping has to change a little, but that's the only thing that needs to be changed.Also, it makes sense to remove panicking from the PKGDEST checking code regardless.