Print this page
9231 nightly should create a log/latest/ symlink


1006 ENVCPPFLAGS1=
1007 ENVCPPFLAGS2=
1008 ENVCPPFLAGS3=
1009 ENVCPPFLAGS4=
1010 PARENT_ROOT=
1011 
1012 export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
1013         ENVLDLIBS1 ENVLDLIBS2 PARENT_ROOT
1014 
1015 PKGARCHIVE_ORIG=$PKGARCHIVE
1016 
1017 #
1018 # Juggle the logs and optionally send mail on completion.
1019 #
1020 
1021 function logshuffle {
1022         LLOG="$ATLOG/log.`date '+%F.%H:%M'`"
1023         if [ -f $LLOG -o -d $LLOG ]; then
1024                 LLOG=$LLOG.$$
1025         fi
1026         mkdir $LLOG


1027         export LLOG
1028 
1029         if [ "$build_ok" = "y" ]; then
1030                 mv $ATLOG/proto_list_${MACH} $LLOG
1031 
1032                 if [ -f $ATLOG/proto_list_tools_${MACH} ]; then
1033                         mv $ATLOG/proto_list_tools_${MACH} $LLOG
1034                 fi
1035 
1036                 if [ -f $TMPDIR/wsdiff.results ]; then
1037                         mv $TMPDIR/wsdiff.results $LLOG
1038                 fi
1039 
1040                 if [ -f $TMPDIR/wsdiff-nd.results ]; then
1041                         mv $TMPDIR/wsdiff-nd.results $LLOG
1042                 fi
1043         fi
1044 
1045         #
1046         # Now that we're about to send mail, it's time to check the noise


1088         #
1089         mailx_r=
1090         if [[ -n "${MAILFROM}" ]]; then
1091                 mailx_r="-r ${MAILFROM}"
1092         fi
1093 
1094         cat $build_time_file $build_environ_file $mail_msg_file \
1095             > ${LLOG}/mail_msg
1096         if [ "$m_FLAG" = "y" ]; then
1097                 cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
1098         "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
1099                         ${MAILTO}
1100         fi
1101 
1102         if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
1103                 staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
1104                 staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
1105         fi
1106 
1107         mv $LOGFILE $LLOG


1108 }
1109 
1110 #
1111 #       Remove the locks and temporary files on any exit
1112 #
1113 function cleanup {
1114         logshuffle
1115 
1116         [ -z "$lockfile" ] || staffer rm -f $lockfile
1117         [ -z "$atloglockfile" ] || rm -f $atloglockfile
1118         [ -z "$ulockfile" ] || staffer rm -f $ulockfile
1119         [ -z "$Ulockfile" ] || rm -f $Ulockfile
1120 
1121         set -- $newdirlist
1122         while [ $# -gt 0 ]; do
1123                 ISUSER=$1 staffer rmdir $2
1124                 shift; shift
1125         done
1126         rm -rf $TMPDIR
1127 }




1006 ENVCPPFLAGS1=
1007 ENVCPPFLAGS2=
1008 ENVCPPFLAGS3=
1009 ENVCPPFLAGS4=
1010 PARENT_ROOT=
1011 
1012 export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
1013         ENVLDLIBS1 ENVLDLIBS2 PARENT_ROOT
1014 
1015 PKGARCHIVE_ORIG=$PKGARCHIVE
1016 
1017 #
1018 # Juggle the logs and optionally send mail on completion.
1019 #
1020 
1021 function logshuffle {
1022         LLOG="$ATLOG/log.`date '+%F.%H:%M'`"
1023         if [ -f $LLOG -o -d $LLOG ]; then
1024                 LLOG=$LLOG.$$
1025         fi
1026 
1027         rm -f "$ATLOG/latest" 2>/dev/null
1028         mkdir -p $LLOG
1029         export LLOG
1030 
1031         if [ "$build_ok" = "y" ]; then
1032                 mv $ATLOG/proto_list_${MACH} $LLOG
1033 
1034                 if [ -f $ATLOG/proto_list_tools_${MACH} ]; then
1035                         mv $ATLOG/proto_list_tools_${MACH} $LLOG
1036                 fi
1037 
1038                 if [ -f $TMPDIR/wsdiff.results ]; then
1039                         mv $TMPDIR/wsdiff.results $LLOG
1040                 fi
1041 
1042                 if [ -f $TMPDIR/wsdiff-nd.results ]; then
1043                         mv $TMPDIR/wsdiff-nd.results $LLOG
1044                 fi
1045         fi
1046 
1047         #
1048         # Now that we're about to send mail, it's time to check the noise


1090         #
1091         mailx_r=
1092         if [[ -n "${MAILFROM}" ]]; then
1093                 mailx_r="-r ${MAILFROM}"
1094         fi
1095 
1096         cat $build_time_file $build_environ_file $mail_msg_file \
1097             > ${LLOG}/mail_msg
1098         if [ "$m_FLAG" = "y" ]; then
1099                 cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
1100         "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
1101                         ${MAILTO}
1102         fi
1103 
1104         if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
1105                 staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
1106                 staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
1107         fi
1108 
1109         mv $LOGFILE $LLOG
1110 
1111         ln -s "$LLOG" "$ATLOG/latest"
1112 }
1113 
1114 #
1115 #       Remove the locks and temporary files on any exit
1116 #
1117 function cleanup {
1118         logshuffle
1119 
1120         [ -z "$lockfile" ] || staffer rm -f $lockfile
1121         [ -z "$atloglockfile" ] || rm -f $atloglockfile
1122         [ -z "$ulockfile" ] || staffer rm -f $ulockfile
1123         [ -z "$Ulockfile" ] || rm -f $Ulockfile
1124 
1125         set -- $newdirlist
1126         while [ $# -gt 0 ]; do
1127                 ISUSER=$1 staffer rmdir $2
1128                 shift; shift
1129         done
1130         rm -rf $TMPDIR
1131 }