Print this page
Support for PREBUILT_ILLUMOS, and optional /tmp/debug.$$ output.


1120         logcmd chmod -R u+w $DESTDIR > /dev/null 2>&1
1121         logcmd rm -rf $DESTDIR || \
1122             logerr "Failed to remove temporary install directory"
1123         logmsg "--- Cleaning up temporary manifest and transform files"
1124         logcmd rm -f $P5M_INT $P5M_FINAL $MY_MOG_FILE || \
1125             logerr "Failed to remove temporary manifest and transform files"
1126         logmsg "Done."
1127     fi
1128 }
1129 
1130 #############################################################################
1131 # Helper function that will let you save a predefined function so you can
1132 # override it and call it later
1133 #############################################################################
1134 save_function() {
1135     local ORIG_FUNC=$(declare -f $1)
1136     local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
1137     eval "$NEWNAME_FUNC"
1138 }
1139 



























1140 # Vim hints
1141 # vim:ts=4:sw=4:et:


1120         logcmd chmod -R u+w $DESTDIR > /dev/null 2>&1
1121         logcmd rm -rf $DESTDIR || \
1122             logerr "Failed to remove temporary install directory"
1123         logmsg "--- Cleaning up temporary manifest and transform files"
1124         logcmd rm -f $P5M_INT $P5M_FINAL $MY_MOG_FILE || \
1125             logerr "Failed to remove temporary manifest and transform files"
1126         logmsg "Done."
1127     fi
1128 }
1129 
1130 #############################################################################
1131 # Helper function that will let you save a predefined function so you can
1132 # override it and call it later
1133 #############################################################################
1134 save_function() {
1135     local ORIG_FUNC=$(declare -f $1)
1136     local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
1137     eval "$NEWNAME_FUNC"
1138 }
1139 
1140 # Called by builds that need a PREBUILT_ILLUMOS actually finished.
1141 wait_for_prebuilt() {
1142     if [ ! -d ${PREBUILT_ILLUMOS:-/dev/null} ]; then
1143         echo "wait_for_prebuilt() called w/o PREBUILT_ILLUMOS. Bailing."
1144         clean_up
1145         exit 1
1146     fi
1147 
1148     # -h means symbolic link. That's what nightly does.
1149     if [ ! -h $PREBUILT_ILLUMOS/log/nightly.lock ]; then
1150         return
1151     fi
1152 
1153     nightly_pid=`ls -lt $PREBUILT_ILLUMOS/log/nightly.lock | awk -F. '{print $4}'`
1154     # Wait for nightly to be finished if it's running.
1155     logmsg "Waiting for illumos nightly build $nightly_pid to be finished."
1156     pwait $nightly_pid
1157     if [ -h $PREBUILT_ILLUMOS/log/nightly.lock ]; then
1158         logmsg "Nightly lock present, but build not running.  Bailing."
1159         if [[ -z $BATCH ]]; then
1160             ask_to_continue
1161         fi
1162         clean_up
1163         exit 1
1164     fi
1165 }
1166 
1167 # Vim hints
1168 # vim:ts=4:sw=4:et: