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

PKGNAME="ublinux-init"
DATA_FILE_CONF="ublinux*ini"

# 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/layer-base/ -maxdepth 2 -path "*" -name "${DATA_FILE_CONF}" | tail -1 2>/dev/null) ]] && /usr/bin/ubconfig update || true
}

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

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