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

Split Close
Expand all
Collapse all
          --- old/lib/functions.sh
          +++ new/lib/functions.sh
↓ open down ↓ 1129 lines elided ↑ open up ↑
1130 1130  #############################################################################
1131 1131  # Helper function that will let you save a predefined function so you can
1132 1132  # override it and call it later
1133 1133  #############################################################################
1134 1134  save_function() {
1135 1135      local ORIG_FUNC=$(declare -f $1)
1136 1136      local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
1137 1137      eval "$NEWNAME_FUNC"
1138 1138  }
1139 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 +
1140 1167  # Vim hints
1141 1168  # vim:ts=4:sw=4:et:
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX