xbps
xbps copied to clipboard
xbps-install: Print error message when `dir` in `-r dir` does not exist
When running xbps-install -S -r /path/does/not/exist <somepackage>
(and perhaps similar commands) an error message would be nice, saying that the path does not exist.
I think in that case xbps is unhappy that there is no confdir in /path/does/not/exist
(specifying -C /usr/share/xbps.d/
works), maybe it should complain about that then. But IMO it should complain about something. Right now it just returns 95
, which is not documented on the man page of xbps-install
.
This fails because there is no repository and -S
is used to sync the repository pool, the function that loops through the repository pool returns ENOTSUP
(95) if there is no repository.
I think that function should not return an error if there is nothing to loop through, then instead of that error, xbps-install
would complain about the package <somepackage>
not being found.
I see. Also I just learned that -r ./dir
will just create ./dir
(including missing parents) if it does not exist (that kind of surprises me). I should rename this issue but I don´t know of a better name yet.
I understand that the specific problem I described in my OP would be solved by what you suggest. But, wouldn't it be nice for the user to be notified that there is no repo to sync with, when they explicitly asked xbps-install
to sync via the -S
option? What if a user runs xbps-install -S -r /path/does/not/exist
?
I see. Also I just learned that
-r ./dir
will just create./dir
(including missing parents) if it does not exist (that kind of surprises me). I should rename this issue but I don´t know of a better name yet.
Not sure if I see that as an issue, creating the root directory seems convenient, we could maybe change this to only create only the root directory itself and not missing parent directories anything else would seem like a regression to me.
I understand that the specific problem I described in my OP would be solved by what you suggest. But, wouldn't it be nice for the user to be notified that there is no repo to sync with, when they explicitly asked
xbps-install
to sync via the-S
option? What if a user runsxbps-install -S -r /path/does/not/exist
?
I think that would be reasonable, xbps_rpool_sync
could just return an error if there are no repositories.