Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xbps-install: Print error message when dir in -r dir does not exist #454

Open
camoz opened this issue Dec 29, 2021 · 4 comments · May be fixed by #456
Open

xbps-install: Print error message when dir in -r dir does not exist #454

camoz opened this issue Dec 29, 2021 · 4 comments · May be fixed by #456

Comments

@camoz
Copy link
Contributor

camoz commented Dec 29, 2021

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.

@camoz
Copy link
Contributor Author

camoz commented Dec 29, 2021

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.

@Duncaen
Copy link
Member

Duncaen commented Dec 29, 2021

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.

Duncaen added a commit to Duncaen/xbps that referenced this issue Dec 29, 2021
This error is already ignored by most callers and where it wasn't it
masked the real error of packages simply not being found without
repositories.

Fixes void-linux#454.
@camoz
Copy link
Contributor Author

camoz commented Dec 29, 2021

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?

@Duncaen
Copy link
Member

Duncaen commented Dec 29, 2021

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 runs xbps-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.

Duncaen added a commit to Duncaen/xbps that referenced this issue Dec 29, 2021
This error is already ignored by most callers and where it wasn't it
masked the real error of packages simply not being found without
repositories.

Fixes void-linux#454.
Duncaen added a commit to Duncaen/xbps that referenced this issue Dec 29, 2021
This error is already ignored by most callers and where it wasn't it
masked the real error of packages simply not being found without
repositories.

Fixes void-linux#454.
Duncaen added a commit to Duncaen/xbps that referenced this issue Dec 31, 2021
This error is already ignored by most callers and where it wasn't it
masked the real error of packages simply not being found without
repositories.

Fixes void-linux#454.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants