autobuild3
autobuild3 copied to clipboard
Reconsider trigger constrction
The current trigger system is simply sh(--).
We don't need it to be standalone.
Lets do this in ab:
# EXPORT FUNCTION trigger::interest
# interest <dir> [script:=postinst]
interest(){
(( !trset )) && [ -d "abdist/$1" ] || return 0
local scriptname="${2:-postinst}" pkgname="${0##*/}" # Naive but effective basename
trset=1
cat >> "abscripts/$scriptname" << EOF
if [ -e /var/ab/triggered/"$pkgname" ]; then
/var/ab/triggered/"$pkgname" || exit "$?"
fi
EOF
}
declare -fx interest # export function!
By some weird force, my hands impled the scriptname stuff so accidentally we fixed #33.
Still no prerm or postrm here?
@MingcongBai If you are not blind, interest /usr/share/doc/info postrm
I should do this ASAP, even if #35 is not yet ready. Zzzzzzzzzzz.