[arch-projects] any interest?: initcpio cleanup_hook function

Matthew Monaco dgbaley27 at 0x01b.net
Fri Mar 16 00:36:30 EDT 2012


On 03/15/2012 10:12 PM, Dave Reisner wrote:
> 
> I might be convinced that this is a decent idea if there was more than
> one use case for it (in particular, one that existed in the repos).
> 

' knew that was coming

> Riffing on the theme, I'd rather see cleanup hook collection done when
> hooks are run, and not make a full second pass over the hooks... might
> look something like:
> 
>   for h in $HOOKS; do
>      eval "TST=\$hook_$h"
>      if [ "$TST" != "disabled" ]; then
>         run_hook () { msg "$h: no run function defined"; }
>         if [ -e "/hooks/${h}" ]; then
>           . /hooks/${h}
>           msg ":: Running Hook [$h]"
>           run_hook
>           if type run_cleanup >/dev/null; then
>             CLEANUP_HOOKS="$hook $CLEANUP_HOOKS"
>           fi
>         fi
>      fi
>   done
> 
>   for h in $CLEANUP_HOOKS; do
>      msg ":: Running Cleanup [$h]"
>      . /hooks/$h
>      run_cleanup
>   done
> 
> 
>>  fi
>>
>>  # honor the old behavior of break=y as a synonym for break=premount

Like I said, just a presentation of the idea. Looks good, thanks.



More information about the arch-projects mailing list