summaryrefslogtreecommitdiffstats
path: root/lbu.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-12-17 10:10:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-12-17 10:12:24 +0000
commit63f898c17a41acd7d22657209fed005ae3c55fcd (patch)
treebb852e4d975b1fdf34ec2aeceb6f8b638fb94fb8 /lbu.in
parentadd0652011de1c9d4aeb2ae152f198771ebe1743 (diff)
downloadalpine-conf-63f898c17a41acd7d22657209fed005ae3c55fcd.tar.bz2
alpine-conf-63f898c17a41acd7d22657209fed005ae3c55fcd.tar.xz
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
Diffstat (limited to 'lbu.in')
-rw-r--r--lbu.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/lbu.in b/lbu.in
index c1ab743..d4d9c5d 100644
--- a/lbu.in
+++ b/lbu.in
@@ -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
}