You are not logged in.

#1 2017-10-12 18:18:58

aristocat
Member
Registered: 2017-10-12
Posts: 2

AUR from alpm-hooks

Hi all,

I've been trying to use an alpm hook so that upgrading linux-headers would trigger a package rebuild from AUR.
The problem I'm hitting is that the pacman database is locked. This makes sense since the hook is firing from pacman and it's probably sensible to avoid something re-entrant like this.

I've tried dkms in the past, but had some issues with the dkms variant (broadcom-wl-dkms)

I'm already using aurget so I'd rather not install more AUR helpers. I can think up simple solutions using a script to handle this, but was wondering if there is an accepted approach using vanilla arch + aur.

Thanks!

Offline

#2 2017-10-15 03:30:14

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

Re: AUR from alpm-hooks

Yes, the accepted approach is dkms. What issues did you have with that?

Also, makepkg works fine when pacman is locked (but you'd have to install the package afterward manually), although I still don't recommend doing it via a hook.

Last edited by eschwartz (2017-10-15 03:31:22)


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

Offline

#3 2017-10-17 04:04:32

aristocat
Member
Registered: 2017-10-12
Posts: 2

Re: AUR from alpm-hooks

I can't remember the issues and should revisit at some point. Since this is for my personal laptop I just ended up using a quick script. I would strongly recommend against using this on a real environment, but just in case it helps someone:

#!/usr/bin/bash

eval "sudo pacman -Su"
if [ -e "/tmp/new_linux_headers" ]; then
    eval "broadcom_build"
    echo `sudo rm /tmp/new_linux_headers`
fi

with a custom hook like so:

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = linux-headers

[Action]
Description = Recompile broadcom driver
When = PostTransaction
Exec = /usr/bin/touch /tmp/new_linux_headers

The broadcom_build script simply calls aurget with the right arguments

Offline

#4 2017-10-17 14:43:58

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

Re: AUR from alpm-hooks

why are you using a useless use of eval (and why is that even a concept), why are you echoing the stdout of a command run in a subshell, and what is broadcom_build, whether you are eval'ing it or not???

Also why are you explicitly using bash in the shebang, then using POSIX sh constructs like [ instead of [[


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

Offline

Board footer

Powered by FluxBB