aarnt / octoxbps

A Qt-based XBPS front end
GNU General Public License v2.0
72 stars 10 forks source link

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

Open akarelas opened 2 months ago

akarelas commented 2 months ago

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.

aarnt commented 2 months ago

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

akarelas commented 2 months ago

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?

aarnt commented 2 months ago

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.

akarelas commented 2 months ago

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?

aarnt commented 1 month ago

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?

akarelas commented 1 month ago

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 commented 1 month ago

Ah, THIS git repo. Okay.

akarelas commented 1 month ago

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

aarnt commented 1 month ago

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.

akarelas commented 1 month ago

Yes, thanks!

aarnt commented 1 month ago

Yes, thanks!

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

akarelas commented 1 month ago

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

aarnt commented 1 month ago

Probably...

akarelas commented 1 month ago

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 commented 1 month ago

Or should it happen automatically by a bot?

aarnt commented 1 month ago

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

aarnt commented 4 weeks ago

@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...

akarelas commented 2 days ago

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