# old version (without -$pkgrel): ${1%%-*}
# new version (without -$pkgrel): ${2%%-*}

PKGNAME="ubboot"

# arg 1:  the new package version
pre_install() {
    true
}

# arg 1:  the new package version
post_install() {
    post_upgrade $@
}

# arg 1:  the new package version
# arg 2:  the old package version
pre_upgrade() {
    true
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
    [[ -w $(find /memory/data/from/0 -maxdepth 1 -type d -name "boot" | tail -1) ]] && /usr/lib/ubboot/ubboot-skel update -udgt || true

}

# arg 1:  the old package version
pre_remove() {
    true
}

# arg 1:  the old package version
post_remove() {
    true
}
