autobuild3 icon indicating copy to clipboard operation
autobuild3 copied to clipboard

Reconsider trigger constrction

Open Artoria2e5 opened this issue 10 years ago • 3 comments

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.

Artoria2e5 avatar Jul 05 '15 12:07 Artoria2e5

Still no prerm or postrm here?

MingcongBai avatar Jul 06 '15 01:07 MingcongBai

@MingcongBai If you are not blind, interest /usr/share/doc/info postrm

Artoria2e5 avatar Jul 06 '15 11:07 Artoria2e5

I should do this ASAP, even if #35 is not yet ready. Zzzzzzzzzzz.

Artoria2e5 avatar Oct 05 '15 15:10 Artoria2e5