AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

Reconsider trigger constrction #34

Open Artoria2e5 opened 9 years ago

Artoria2e5 commented 9 years ago

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.

MingcongBai commented 9 years ago

Still no prerm or postrm here?

Artoria2e5 commented 9 years ago

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

Artoria2e5 commented 8 years ago

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