Commit 63f898c1 authored by Natanael Copa's avatar Natanael Copa

lbu: implement support for lbu package pre/post hooks

scripts in /etc/lbu/pre-package.d/ will be executed prior creating the
tar ball and scripts in /etc/lbu/post-package.d/ will be executed after.

if pre-scripts fails, then will package not be created.

ref #220
parent add06520
......@@ -21,6 +21,9 @@ INCLUDE_LIST="$sysconfdir"/include
DEFAULT_CIPHER="aes-256-cbc"
LBU_CONF="$sysconfdir"/lbu.conf
LBU_PREPACKAGE="$sysconfdir"/pre-package.d
LBU_POSTPACKAGE="$sysconfdir"/post-package.d
if [ -f "$LBU_CONF" ]; then
. "$LBU_CONF"
fi
......@@ -230,6 +233,10 @@ cmd_package() {
check_openssl
init_tmpdir tmpdir
if [ -d "$LBU_PREPACKAGE" ]; then
run-parts "$LBU_PREPACKAGE" || return 1
fi
[ -n "$ENCRYPTION" ] && suff="$suff.$ENCRYPTION"
# find filename
......@@ -294,6 +301,9 @@ cmd_package() {
fi
[ $rc -eq 0 ] && vecho "Created $pkg"
fi
if [ -d "$LBU_POSTPACKAGE" ]; then
run-parts "$LBU_POSTPACKAGE"
fi
return $rc
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment