You are not logged in.

#1 2007-12-21 22:29:39

mclabaut
Member
Registered: 2007-06-18
Posts: 41

pacman hooks ?

Hello,

Is there a way to defined hooks that will be called by pacman before and after doing an upgrade ?
Something similar exists on debian and is very useful to automate the task of updating a version controlled /etc/ repository (etckeeper is doing that with git on debian, and I'm trying to port it to arch with either git or mercurial).

Thanks for any pointer.

Offline

#2 2007-12-22 00:09:56

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: pacman hooks ?

Right now, the solution would be to write a pacman wrapper that does what you need. In the longer term, you should get on the pacman-dev ML and propose something, preferably with working patches.

Offline

#3 2007-12-22 08:38:53

mclabaut
Member
Registered: 2007-06-18
Posts: 41

Re: pacman hooks ?

Ok, thank you tom.
I'll try to have a look at the source and propose some solutions on pacman-dev...

Offline

#4 2007-12-22 10:26:46

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: pacman hooks ?

Well, there are already package hooks, with the install scriptlets, but these are per packages.
What you want is the same thing, but globally? One scriptlet that would be run for every packages?
With the example you gave, it looks like file hooks would be more appropriate. It's already in Aaron TODO list :

* feature for 3.1: package file hooks *
  I've been planning on this one for some time.  Here's a simple rundown:
  in /etc/pacman.d/hooks:
     Hook /usr/include/* : /usr/bin/ctags -R /usr/include/*.h -f /usr/include/systags
  This will allow us to make "global hooks" to simplify a lot of repetitive
  install files (scrollkeeper, depmod, etc).  This also allows us to move
  ldconfig out of pacman entirely.

That could indeed be very useful in many situations. So if you manage to write a patch for this, it would be much appreciated smile


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

Board footer

Powered by FluxBB