octoxbps icon indicating copy to clipboard operation
octoxbps copied to clipboard

Feature request: Allow custom locations for xbps-install & xbps-remove utilities

Open akarelas opened this issue 1 year ago • 20 comments

Since I'm using the etckeeper utility, which keeps git commits of changes in the /etc directory, I wrapped the xbps-install and xbps-remove programs with my own scripts with the same name, placed them in the /usr/local/bin directory, so that they execute the etckeeper pre-install and post-install scripts (a necessary move, as xbps does not support hooks) when I run xbps-install/remove from the console.

This setup works fine when when using the command-line, but unfortunately doesn't when I use octoxbps and octoxbps-notifier to install/remove packages or to update my system, because octoxbps is executing the specific xbps-{install,remove} scripts that are under /usr/bin.

Would it be possible for you to remove the directory /usr/bin from the execution of the xbps utilities, so that they are searched from $PATH? This way we can create custom versions of xbps-{install,remove} and all will be fine. Alternatively, if my first suggestion is not possible, then could you please allow the overriding of these locations with environment variables?

Thanks.

akarelas avatar Jul 23 '24 09:07 akarelas

Hi. Searching first for xbps tools on "/usr/local/bin" and use this path if so solves your issue, doesn't it?

aarnt avatar Jul 24 '24 21:07 aarnt

This doesn't seem like a perfect solution, because other users might want to place their wrapper scripts in their /root/.bin directory. You'd have to search for that too, perhaps. And you'd have to know the order of directories in the $PATH variable (maybe the user modified it).

Isn't it better just to remove the path from the execution command?

akarelas avatar Jul 25 '24 12:07 akarelas

I'm sorry but removing the full path is too risky, because a malicious program could harm the system as it'll be executed with elevated privileges.

aarnt avatar Jul 25 '24 12:07 aarnt

I'd be happy with this solution then:

Searching first for xbps tools on "/usr/local/bin" and use this path if so solves your issue, doesn't it?

akarelas avatar Jul 25 '24 14:07 akarelas

Hi @akarelas Yesterday I coded the changes and were able to add a nice pre system upgrade hook using a custom posix shell wrapper on /usr/local/bin. Can you test your solution using latest git code?

aarnt avatar Jul 26 '24 10:07 aarnt

I don't know how to do that. Do you mean xbps-src? I've used that once, I'll try if you want (and I might ask you or on IRC for help in doing that).

akarelas avatar Jul 26 '24 10:07 akarelas

Ah, THIS git repo. Okay.

akarelas avatar Jul 26 '24 10:07 akarelas

If I follow the steps on this page to install octoxbps from source, how easy will it be afterwards to cleanup everything? (And how will I do it?) I don't want it to mess my system.

https://github.com/aarnt/octoxbps?tab=readme-ov-file#follow-the-steps-bellow-to-compile-the-latest-source-code-youll-need-curl-git-and-qt5-packages

akarelas avatar Jul 26 '24 10:07 akarelas

Well, if you do not have the qt dev tools, maybe it's better if I tag a release and you upgrade octoxbps using the official method.

aarnt avatar Jul 26 '24 10:07 aarnt

Yes, thanks!

akarelas avatar Jul 26 '24 10:07 akarelas

Yes, thanks!

I've just released v0.4.0. Let's wait for XBPS automated package updates.

aarnt avatar Jul 29 '24 14:07 aarnt

By no means an expert, but shouldn't there be a PR here? https://github.com/void-linux/void-packages/pulls?q=is%3Apr+octoxbps

akarelas avatar Aug 02 '24 10:08 akarelas

Probably...

aarnt avatar Aug 09 '24 14:08 aarnt

I noticed all of these PRs were made by people other than you. Should someone who is interested, other than you, do this one too?

akarelas avatar Aug 10 '24 20:08 akarelas

Or should it happen automatically by a bot?

akarelas avatar Aug 11 '24 07:08 akarelas

Indeed, it was never me. But this time it's taking a while.

aarnt avatar Aug 11 '24 10:08 aarnt

@akarelas It seems we are close to something... https://repo-default.voidlinux.org/void-updates/void-updates.txt shows octoxbps 0.4.0 is scheduled...

aarnt avatar Aug 26 '24 20:08 aarnt

Not that close yet, it seems :D Almost a month passed

akarelas avatar Sep 21 '24 11:09 akarelas

Any idea what they're waiting for?

akarelas avatar Oct 10 '24 14:10 akarelas

No... I tried to contact another dev but he didn't reply me either.

aarnt avatar Oct 11 '24 10:10 aarnt

Hi, it seems they finally updated the pkg. Can you test it?

aarnt avatar Nov 05 '24 10:11 aarnt

My void laptop's pretty broken. I'll try when I get home (which doesn't happen much though).

akarelas avatar Nov 06 '24 10:11 akarelas

Ok. I will close this issue as it is fixed (at least for me).

aarnt avatar Nov 20 '24 10:11 aarnt

My laptop is being repaired for the next 3 weeks.

akarelas avatar Nov 20 '24 11:11 akarelas

I just tried my repaired laptop for the first time, and am happy to announce that my feature suggestion has been implemented successfully. Thanks!w

akarelas avatar Mar 07 '25 05:03 akarelas