You are not logged in.

#1 2021-01-14 14:17:36

Foxhole
Member
Registered: 2015-08-14
Posts: 37

[SOLVED] Run aur helper from hook

Hello everyone,
Each time I update pulseaudio, the AUR replacement for pulseaudio-bluetooth 

pulseaudio-modules-bt-git

needs to be rebuilt (source: https://wiki.archlinux.org/index.php/Bl … low_volume ).
I was wondering how could I do it automatically, straight after the update of the pulseaudio package.
I have considered something like this

[Trigger]
Operation = Upgrade
Operation = Install
Type = Package
Target = pulseaudio
[Action]
Description=Rebuild pulseaudio bluetooth git against new pulseaudio ver
When=PostTransaction
Exec=/bin/sudo -u low-priv-user trizen -S pulseaudio-modules-bt-git

But clearly, it won't work cause it is still running under pacman, which is still locking the db. It is required to run it once pacman has finished updating all the other packages.
Any idea on how to make this work?

From a security standpoint, probably I should look for a better way to drop privileges, rather than simply applying sudo.

Last edited by Foxhole (2021-01-15 10:25:04)

Offline

#2 2021-01-14 15:36:28

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] Run aur helper from hook

I wonder, you could rebuild the aur packages in a chroot and for things that will need rebuilt you could rebuild the package and bump the pkgver one version up...and using a local repo everything would update at the same time and there would not be pain in up to some extent...

I haven’t tried something like that tho...


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2021-01-14 18:59:02

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Run aur helper from hook

I guess you could run aurutils to rebuild bluetooth and add it to a custom repo. Then pulseaudio will still be broken, but running 'sudo pacman -Syu && sudo pacman -Syu' will update your packages, rebuild the AUR package in a hook, and update all packages including the just-built package.

Or you could add a hook that prints a message at you to "follow up by running trizen -S pulseaudio-modules-bt-git".


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2021-01-14 19:15:23

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

Re: [SOLVED] Run aur helper from hook

'pulseaudio-modules-bt-git' package has meta flag 'Provides: pulseaudio-bluetooth'. That information should inform the AUR helper sufficiently to handle the situation. Not sure why Trizen cannot handle it. Maybe 'yay' makes it better.

Are you sure you're updating with 'trizen -Syu' (instead of 'pacman -Syu')?

Last edited by Maniaxx (2021-01-14 19:25:09)


sys2064

Offline

#5 2021-01-14 21:47:57

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,407
Website

Re: [SOLVED] Run aur helper from hook

You could run the hook in "rebuild-detector" and then rebuild the package. Seems like a simpler and less fragile method than building packages in a hook.

https://aur.archlinux.org/packages/rebuild-detector
https://github.com/maximbaz/rebuild-det … ector.hook


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#6 2021-01-15 09:37:34

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Run aur helper from hook

Maniaxx wrote:

'pulseaudio-modules-bt-git' package has meta flag 'Provides: pulseaudio-bluetooth'. That information should inform the AUR helper sufficiently to handle the situation. Not sure why Trizen cannot handle it. Maybe 'yay' makes it better.

Are you sure you're updating with 'trizen -Syu' (instead of 'pacman -Syu')?

Yes, it is due to the fact that the aur package didn't change, so for trizen it is updated

Offline

#7 2021-01-15 09:38:15

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Run aur helper from hook

Alad wrote:

You could run the hook in "rebuild-detector" and then rebuild the package. Seems like a simpler and less fragile method than building packages in a hook.

https://aur.archlinux.org/packages/rebuild-detector
https://github.com/maximbaz/rebuild-det … ector.hook

This is interesting and much cleaner! I'll give it a look
Edit: It is a cool tool, it does detect all the packages which needs to be rebuilt (i have tested it by rollbacking two versions of pulseaudio and it seemed to work)! I'd say that this is the closest to what I need, so I'll mark this as solved. Thanks

Last edited by Foxhole (2021-01-15 10:24:25)

Offline

#8 2022-01-14 09:45:34

PhotonX
Member
From: Munich
Registered: 2008-08-10
Posts: 591

Re: [SOLVED] Run aur helper from hook

Hi guys,

I just had the same idea and found this topic. In my case I need compiz-easy-patch to be rebuilt whenever protobuf is updated in the repos.

Now my problem is that I know exactly what package needs to be rebuilt, so rebuild-detector doesn't tell me anything new. The problem is rather to trigger the rebuild automatically rather than doing it by hand.

So I wonder, is there a possibility to run a "yay -S compiz-easy-patch" or similar whenever rebuild-detector detects that a rebuild is necessary?

edit: I submitted a feature request at yay: https://github.com/Jguer/yay/issues/1671

Last edited by PhotonX (2022-01-14 12:45:04)


Desktop: http://www.sysprofile.de/id15562, Arch Linux    |    Notebook: Thinkpad L13 Yoga Gen2, Manjaro

The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work.  -  Tuomas Lukka

Offline

Board footer

Powered by FluxBB