From fd2e929e8e97d93d53611d285439b5425f78fa95 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 2 Jan 2022 20:20:33 +0000 Subject: fixed if missing postinstall --- xibuild | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'xibuild') diff --git a/xibuild b/xibuild index fb47d9d..d8661e1 100755 --- a/xibuild +++ b/xibuild @@ -137,12 +137,14 @@ xibuild () { package >> $LOGFILE 2>&1 && printf "$PASS packaged\n" || return 1; # add postinstall script - POSTINSTALL=$(type postinstall | sed '1,3d;$d') - if [ ${#POSTINSTALL} != 0 ]; then - POST_DIR=$PKG_DEST/tmp/xi/postinstall - mkdir -p $POST_DIR - echo "#!/bin/sh" > $POST_DIR/$PKG_NAME.sh - echo $POSTINSTALL >> $POST_DIR/$PKG_NAME.sh + if command -v postinstall; then + POSTINSTALL=$( && type postinstall | sed '1,3d;$d') + if [ ${#POSTINSTALL} != 0 ]; then + POST_DIR=$PKG_DEST/tmp/xi/postinstall + mkdir -p $POST_DIR + echo "#!/bin/sh" > $POST_DIR/$PKG_NAME.sh + echo $POSTINSTALL >> $POST_DIR/$PKG_NAME.sh + fi fi # go back to root, make things easier -- cgit v1.2.1