Print this page
4030 remove useless nightly/bldenv options
Reviewed by: Andy Stormont <andyjstormont@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/nightly.sh
          +++ new/usr/src/tools/scripts/nightly.sh
↓ open down ↓ 222 lines elided ↑ open up ↑
 223  223          echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
 224  224              tee -a $mail_msg_file >> $LOGFILE
 225  225          for i in `filelist ${DEST} '^rename:'`
 226  226          do
 227  227                  echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
 228  228                  rm -f ${i}.export
 229  229                  mv ${i} ${i}.export
 230  230          done
 231  231  }
 232  232  
 233      -#
 234      -# Copy some or all of the source tree.
 235      -#
 236      -# Returns 0 for success, non-zero for failure.
 237      -#
 238      -# usage: copy_source CODEMGR_WS DESTDIR LABEL SRCROOT
 239      -#
 240      -function copy_source {
 241      -        WS=$1
 242      -        DEST=$2
 243      -        label=$3
 244      -        srcroot=$4
 245      -
 246      -        printf "\n==== Creating %s source from %s (%s) ====\n\n" \
 247      -            "$DEST" "$WS" "$label" | tee -a $mail_msg_file >> $LOGFILE
 248      -
 249      -        printf "cleaning out %s\n" "$DEST." >> $LOGFILE
 250      -        rm -rf "$DEST" >> $LOGFILE 2>&1
 251      -
 252      -        printf "creating %s\n" "$DEST." >> $LOGFILE
 253      -        mkdir -p "$DEST" 2>> $LOGFILE
 254      -
 255      -        if (( $? != 0 )) ; then
 256      -                printf "failed to create %s\n" "$DEST" |
 257      -                    tee -a $mail_msg_file >> $LOGFILE
 258      -                build_ok=n
 259      -                return 1
 260      -        fi
 261      -        cd "$WS"
 262      -
 263      -        printf "populating %s\n" "$DEST." >> $LOGFILE
 264      -
 265      -        case "$SCM_TYPE" in
 266      -        teamware)
 267      -                find $srcroot -name 's\.*' -a -type f -print | \
 268      -                    sed -e 's,SCCS\/s.,,' | \
 269      -                    grep -v '/\.del-*' | \
 270      -                    cpio -pd $DEST >>$LOGFILE 2>&1
 271      -                if (( $? != 0 )) ; then
 272      -                    printf "cpio failed for %s\n" "$DEST" |
 273      -                        tee -a $mail_msg_file >> $LOGFILE
 274      -                    build_ok=n
 275      -                    return 1
 276      -                fi
 277      -                ;;
 278      -        mercurial)
 279      -                copy_source_mercurial $DEST $srcroot
 280      -                if (( $? != 0 )) ; then
 281      -                    build_ok=n
 282      -                    return 1
 283      -                fi
 284      -                ;;
 285      -        *)
 286      -                build_ok=n
 287      -                echo "Tree copy is not supported for workspace type" \
 288      -                    "$SCM_TYPE" | tee -a $mail_msg_file >> $LOGFILE
 289      -                return 1
 290      -                ;;
 291      -        esac
 292      -
 293      -        return 0
 294      -}
 295      -
 296      -#
 297      -# Mercurial-specific copy code for copy_source().
 298      -#
 299      -# Returns 0 for success, non-zero for failure.
 300      -#
 301      -# usage: copy_source_mercurial destdir srcroot
 302      -#
 303      -function copy_source_mercurial {
 304      -        typeset dest=$1
 305      -        typeset srcroot=$2
 306      -
 307      -        hg locate -I "$srcroot" | cpio -pd "$dest" >>$LOGFILE 2>&1
 308      -        if (( $? != 0 )) ; then
 309      -            printf "cpio failed for %s\n" "$dest" |
 310      -                tee -a $mail_msg_file >> $LOGFILE
 311      -            return 1
 312      -        fi
 313      -
 314      -        return 0
 315      -}
 316      -
 317      -#
 318      -# function to create (but not build) the export/crypt source tree.
 319      -# usage: set_up_source_build CODEMGR_WS DESTDIR MAKE_TARGET
 320      -# Sets SRC to the modified source tree, for use by the caller when it
 321      -# builds the tree.
 322      -#
 323      -function set_up_source_build {
 324      -        WS=$1
 325      -        DEST=$2
 326      -        MAKETARG=$3
 327      -
 328      -        copy_source $WS $DEST $MAKETARG usr
 329      -        if (( $? != 0 )); then
 330      -            echo "\nCould not copy source tree for source build." |
 331      -                tee -a $mail_msg_file >> $LOGFILE
 332      -            build_ok=n
 333      -            return
 334      -        fi
 335      -
 336      -        SRC=${DEST}/usr/src
 337      -
 338      -        cd $SRC
 339      -        rm -f ${MAKETARG}.out
 340      -        echo "making ${MAKETARG} in ${SRC}." >> $LOGFILE
 341      -        /bin/time $MAKE -e ${MAKETARG} 2>&1 | \
 342      -            tee -a $SRC/${MAKETARG}.out >> $LOGFILE
 343      -        echo "\n==== ${MAKETARG} build errors ====\n" >> $mail_msg_file
 344      -        egrep ":" $SRC/${MAKETARG}.out | \
 345      -                egrep -e "(^${MAKE}:|[  ]error[:        \n])" | \
 346      -                egrep -v "Ignoring unknown host" | \
 347      -                egrep -v "warning" >> $mail_msg_file
 348      -
 349      -        echo "clearing state files." >> $LOGFILE
 350      -        find . -name '.make*' -exec rm -f {} \;
 351      -}
 352      -
 353  233  # Return library search directive as function of given root.
 354  234  function myldlibs {
 355  235          echo "-L$1/lib -L$1/usr/lib"
 356  236  }
 357  237  
 358  238  # Return header search directive as function of given root.
 359  239  function myheaders {
 360  240          echo "-I$1/usr/include"
 361  241  }
 362  242  
↓ open down ↓ 12 lines elided ↑ open up ↑
 375  255          SUFFIX=$2
 376  256          ND=$3
 377  257          MULTIPROTO=$4
 378  258          INSTALLOG=install${SUFFIX}-${MACH}
 379  259          NOISE=noise${SUFFIX}-${MACH}
 380  260          PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
 381  261  
 382  262          ORIGROOT=$ROOT
 383  263          [ $MULTIPROTO = no ] || export ROOT=$ROOT$SUFFIX
 384  264  
 385      -        if [[ "$O_FLAG" = y ]]; then
 386      -                echo "\nSetting CLOSEDROOT= ${ROOT}-closed\n" >> $LOGFILE
 387      -                export CLOSEDROOT=${ROOT}-closed
 388      -        fi
 389      -
 390  265          export ENVLDLIBS1=`myldlibs $ROOT`
 391  266          export ENVCPPFLAGS1=`myheaders $ROOT`
 392  267  
 393  268          this_build_ok=y
 394  269          #
 395  270          #       Build OS-Networking source
 396  271          #
 397  272          echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
 398  273                  >> $LOGFILE
 399  274  
↓ open down ↓ 502 lines elided ↑ open up ↑
 902  777  
 903  778  if [ "$OPTHOME" = "" ]; then
 904  779          OPTHOME=/opt
 905  780          export OPTHOME
 906  781  fi
 907  782  if [ "$TEAMWARE" = "" ]; then
 908  783          TEAMWARE=$OPTHOME/teamware
 909  784          export TEAMWARE
 910  785  fi
 911  786  
 912      -USAGE='Usage: nightly [-in] [+t] [-V VERS ] [ -S E|D|H|O ] <env_file>
      787 +USAGE='Usage: nightly [-in] [+t] [-V VERS ] <env_file>
 913  788  
 914  789  Where:
 915  790          -i      Fast incremental options (no clobber, lint, check)
 916  791          -n      Do not do a bringover
 917  792          +t      Use the build tools in $ONBLD_TOOLS/bin
 918  793          -V VERS set the build version string to VERS
 919      -        -S      Build a variant of the source product
 920      -                E - build exportable source
 921      -                D - build domestic source (exportable + crypt)
 922      -                H - build hybrid source (binaries + deleted source)
 923      -                O - build (only) open source
 924  794  
 925  795          <env_file>  file in Bourne shell syntax that sets and exports
 926  796          variables that configure the operation of this script and many of
 927  797          the scripts this one calls. If <env_file> does not exist,
 928  798          it will be looked for in $OPTHOME/onbld/env.
 929  799  
 930  800  non-DEBUG is the default build type. Build options can be set in the
 931  801  NIGHTLY_OPTIONS variable in the <env_file> as follows:
 932  802  
 933  803          -A      check for ABI differences in .so files
 934  804          -C      check for cstyle/hdrchk errors
 935  805          -D      do a build with DEBUG on
 936  806          -F      do _not_ do a non-DEBUG build
 937  807          -G      gate keeper default group of options (-au)
 938  808          -I      integration engineer default group of options (-ampu)
 939  809          -M      do not run pmodes (safe file permission checker)
 940  810          -N      do not run protocmp
 941      -        -O      generate OpenSolaris deliverables
 942  811          -R      default group of options for building a release (-mp)
 943  812          -U      update proto area in the parent
 944  813          -V VERS set the build version string to VERS
 945  814          -X      copy x86 IHV proto area
 946  815          -f      find unreferenced files
 947  816          -i      do an incremental build (no "make clobber")
 948  817          -l      do "make lint" in $LINTDIRS (default: $SRC y)
 949  818          -m      send mail to $MAILTO at end of build
 950  819          -n      do not do a bringover
 951  820          -o      build using root privileges to set OWNER/GROUP (old style)
 952  821          -p      create packages
 953  822          -r      check ELF runtime attributes in the proto area
 954  823          -t      build and use the tools in $SRC/tools (default setting)
 955  824          +t      Use the build tools in $ONBLD_TOOLS/bin
 956  825          -u      update proto_list_$MACH and friends in the parent workspace;
 957  826                  when used with -f, also build an unrefmaster.out in the parent
 958  827          -w      report on differences between previous and current proto areas
 959  828          -z      compress cpio archives with gzip
 960  829          -W      Do not report warnings (freeware gate ONLY)
 961      -        -S      Build a variant of the source product
 962      -                E - build exportable source
 963      -                D - build domestic source (exportable + crypt)
 964      -                H - build hybrid source (binaries + deleted source)
 965      -                O - build (only) open source
 966  830  '
 967  831  #
 968  832  #       A log file will be generated under the name $LOGFILE
 969  833  #       for partially completed build and log.`date '+%F'`
 970  834  #       in the same directory for fully completed builds.
 971  835  #
 972  836  
 973  837  # default values for low-level FLAGS; G I R are group FLAGS
 974  838  A_FLAG=n
 975  839  C_FLAG=n
 976  840  D_FLAG=n
 977  841  F_FLAG=n
 978  842  f_FLAG=n
 979  843  i_FLAG=n; i_CMD_LINE_FLAG=n
 980  844  l_FLAG=n
 981  845  M_FLAG=n
 982  846  m_FLAG=n
 983  847  N_FLAG=n
 984  848  n_FLAG=n
 985      -O_FLAG=n
 986  849  o_FLAG=n
 987  850  P_FLAG=n
 988  851  p_FLAG=n
 989  852  r_FLAG=n
 990  853  T_FLAG=n
 991  854  t_FLAG=y
 992  855  U_FLAG=n
 993  856  u_FLAG=n
 994  857  V_FLAG=n
 995  858  W_FLAG=n
 996  859  w_FLAG=n
 997  860  X_FLAG=n
 998      -SD_FLAG=n
 999      -SE_FLAG=n
1000      -SH_FLAG=n
1001      -SO_FLAG=n
1002  861  #
1003  862  XMOD_OPT=
1004  863  #
1005  864  build_ok=y
1006  865  
1007      -function is_source_build {
1008      -        [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o \
1009      -            "$SH_FLAG" = "y" -o "$SO_FLAG" = "y" ]
1010      -        return $?
1011      -}
1012      -
1013  866  #
1014  867  # examine arguments
1015  868  #
1016  869  
1017      -#
1018      -# single function for setting -S flag and doing error checking.
1019      -# usage: set_S_flag <type>
1020      -# where <type> is the source build type ("E", "D", ...).
1021      -#
1022      -function set_S_flag {
1023      -        if is_source_build; then
1024      -                echo "Can only build one source variant at a time."
1025      -                exit 1
1026      -        fi
1027      -        if [ "$1" = "E" ]; then
1028      -                SE_FLAG=y
1029      -        elif [ "$1" = "D" ]; then
1030      -                SD_FLAG=y
1031      -        elif [ "$1" = "H" ]; then
1032      -                SH_FLAG=y
1033      -        elif [ "$1" = "O" ]; then
1034      -                SO_FLAG=y
1035      -        else
1036      -                echo "$USAGE"
1037      -                exit 1
1038      -        fi
1039      -}
1040      -
1041  870  OPTIND=1
1042      -while getopts +inS:tV: FLAG
      871 +while getopts +intV: FLAG
1043  872  do
1044  873          case $FLAG in
1045  874            i )   i_FLAG=y; i_CMD_LINE_FLAG=y
1046  875                  ;;
1047  876            n )   n_FLAG=y
1048  877                  ;;
1049      -          S )
1050      -                set_S_flag $OPTARG
1051      -                ;;
1052  878           +t )   t_FLAG=n
1053  879                  ;;
1054  880            V )   V_FLAG=y
1055  881                  V_ARG="$OPTARG"
1056  882                  ;;
1057  883           \? )   echo "$USAGE"
1058  884                  exit 1
1059  885                  ;;
1060  886          esac
1061  887  done
↓ open down ↓ 138 lines elided ↑ open up ↑
1200 1026  fi
1201 1027  
1202 1028  check_closed_tree
1203 1029  
1204 1030  #
1205 1031  # Note: changes to the option letters here should also be applied to the
1206 1032  #       bldenv script.  `d' is listed for backward compatibility.
1207 1033  #
1208 1034  NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
1209 1035  OPTIND=1
1210      -while getopts +ABCDdFfGIilMmNnOoPpRrS:TtUuWwXxz FLAG $NIGHTLY_OPTIONS
     1036 +while getopts +ABCDdFfGIilMmNnoPpRrTtUuWwXxz FLAG $NIGHTLY_OPTIONS
1211 1037  do
1212 1038          case $FLAG in
1213 1039            A )   A_FLAG=y
1214 1040                  ;;
1215 1041            B )   D_FLAG=y
1216 1042                  ;; # old version of D
1217 1043            C )   C_FLAG=y
1218 1044                  ;;
1219 1045            D )   D_FLAG=y
1220 1046                  ;;
↓ open down ↓ 12 lines elided ↑ open up ↑
1233 1059            l )   l_FLAG=y
1234 1060                  ;;
1235 1061            M )   M_FLAG=y
1236 1062                  ;;
1237 1063            m )   m_FLAG=y
1238 1064                  ;;
1239 1065            N )   N_FLAG=y
1240 1066                  ;;
1241 1067            n )   n_FLAG=y
1242 1068                  ;;
1243      -          O )   O_FLAG=y
1244      -                ;;
1245 1069            o )   o_FLAG=y
1246 1070                  ;;
1247 1071            P )   P_FLAG=y
1248 1072                  ;; # obsolete
1249 1073            p )   p_FLAG=y
1250 1074                  ;;
1251 1075            R )   m_FLAG=y
1252 1076                  p_FLAG=y
1253 1077                  ;;
1254 1078            r )   r_FLAG=y
1255 1079                  ;;
1256      -          S )
1257      -                set_S_flag $OPTARG
1258      -                ;;
1259 1080            T )   T_FLAG=y
1260 1081                  ;; # obsolete
1261 1082           +t )   t_FLAG=n
1262 1083                  ;;
1263 1084            U )   if [ -z "${PARENT_ROOT}" ]; then
1264 1085                          echo "PARENT_ROOT must be set if the U flag is" \
1265 1086                              "present in NIGHTLY_OPTIONS."
1266 1087                          exit 1
1267 1088                  fi
1268 1089                  NIGHTLY_PARENT_ROOT=$PARENT_ROOT
↓ open down ↓ 171 lines elided ↑ open up ↑
1440 1261          if [ "$IA32_IHV_WS" = "" ]; then
1441 1262                  echo "IA32_IHV_WS: must be set for copying ihv proto"
1442 1263                  args_ok=n
1443 1264          fi
1444 1265          if [ ! -d "$IA32_IHV_WS" ]; then
1445 1266                  echo "$IA32_IHV_WS: not found"
1446 1267                  args_ok=n
1447 1268          fi
1448 1269  fi
1449 1270  
1450      -# Append source version
1451      -if [ "$SE_FLAG" = "y" ]; then
1452      -        VERSION="${VERSION}:EXPORT"
1453      -fi
1454      -
1455      -if [ "$SD_FLAG" = "y" ]; then
1456      -        VERSION="${VERSION}:DOMESTIC"
1457      -fi
1458      -
1459      -if [ "$SH_FLAG" = "y" ]; then
1460      -        VERSION="${VERSION}:MODIFIED_SOURCE_PRODUCT"
1461      -fi
1462      -
1463      -if [ "$SO_FLAG" = "y" ]; then
1464      -        VERSION="${VERSION}:OPEN_ONLY"
1465      -fi
1466      -
1467 1271  TMPDIR="/tmp/nightly.tmpdir.$$"
1468 1272  export TMPDIR
1469 1273  rm -rf ${TMPDIR}
1470 1274  mkdir -p $TMPDIR || exit 1
1471 1275  chmod 777 $TMPDIR
1472 1276  
1473 1277  #
1474 1278  # Keep elfsign's use of pkcs11_softtoken from looking in the user home
1475 1279  # directory, which doesn't always work.   Needed until all build machines
1476 1280  # have the fix for 6271754
↓ open down ↓ 215 lines elided ↑ open up ↑
1692 1496  # Return the list of interesting proto areas, depending on the current
1693 1497  # options.
1694 1498  #
1695 1499  function allprotos {
1696 1500          typeset roots="$ROOT"
1697 1501  
1698 1502          if [[ "$F_FLAG" = n && "$MULTI_PROTO" = yes ]]; then
1699 1503                  roots="$roots $ROOT-nd"
1700 1504          fi
1701 1505  
1702      -        if [[ $O_FLAG = y ]]; then
1703      -                roots="$roots $ROOT-closed"
1704      -                [ $MULTI_PROTO = yes ] && roots="$roots $ROOT-nd-closed"
1705      -        fi
1706      -
1707 1506          echo $roots
1708 1507  }
1709 1508  
1710 1509  # Ensure no other instance of this script is running on this host.
1711 1510  # LOCKNAME can be set in <env_file>, and is by default, but is not
1712 1511  # required due to the use of $ATLOG below.
1713 1512  if [ -n "$LOCKNAME" ]; then
1714 1513          create_lock /tmp/$LOCKNAME "lockfile"
1715 1514  fi
1716 1515  #
↓ open down ↓ 59 lines elided ↑ open up ↑
1776 1575  echo "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
1777 1576  
1778 1577  if [ "$P_FLAG" = "y" ]; then
1779 1578          obsolete_build GPROF | tee -a $mail_msg_file >> $LOGFILE
1780 1579  fi
1781 1580  
1782 1581  if [ "$T_FLAG" = "y" ]; then
1783 1582          obsolete_build TRACE | tee -a $mail_msg_file >> $LOGFILE
1784 1583  fi
1785 1584  
1786      -if is_source_build; then
1787      -        if [ "$i_FLAG" = "y" -o "$i_CMD_LINE_FLAG" = "y" ]; then
1788      -                echo "WARNING: the -S flags do not support incremental" \
1789      -                    "builds; forcing clobber\n" | tee -a $mail_msg_file >> $LOGFILE
1790      -                i_FLAG=n
1791      -                i_CMD_LINE_FLAG=n
1792      -        fi
1793      -        if [ "$N_FLAG" = "n" ]; then
1794      -                echo "WARNING: the -S flags do not support protocmp;" \
1795      -                    "protocmp disabled\n" | \
1796      -                    tee -a $mail_msg_file >> $LOGFILE
1797      -                N_FLAG=y
1798      -        fi
1799      -        if [ "$l_FLAG" = "y" ]; then
1800      -                echo "WARNING: the -S flags do not support lint;" \
1801      -                    "lint disabled\n" | tee -a $mail_msg_file >> $LOGFILE
1802      -                l_FLAG=n
1803      -        fi
1804      -        if [ "$C_FLAG" = "y" ]; then
1805      -                echo "WARNING: the -S flags do not support cstyle;" \
1806      -                    "cstyle check disabled\n" | tee -a $mail_msg_file >> $LOGFILE
1807      -                C_FLAG=n
1808      -        fi
1809      -else
1810      -        if [ "$N_FLAG" = "y" ]; then
1811      -                if [ "$p_FLAG" = "y" ]; then
1812      -                        cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
     1585 +if [ "$N_FLAG" = "y" ]; then
     1586 +        if [ "$p_FLAG" = "y" ]; then
     1587 +                cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1813 1588  WARNING: the p option (create packages) is set, but so is the N option (do
1814 1589           not run protocmp); this is dangerous; you should unset the N option
1815 1590  EOF
1816      -                else
1817      -                        cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
     1591 +        else
     1592 +                cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1818 1593  Warning: the N option (do not run protocmp) is set; it probably shouldn't be
1819 1594  EOF
1820      -                fi
1821      -                echo "" | tee -a $mail_msg_file >> $LOGFILE
1822 1595          fi
     1596 +        echo "" | tee -a $mail_msg_file >> $LOGFILE
1823 1597  fi
1824 1598  
1825 1599  if [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
1826 1600          #
1827 1601          # In the past we just complained but went ahead with the lint
1828 1602          # pass, even though the proto area was built non-DEBUG.  It's
1829 1603          # unlikely that non-DEBUG headers will make a difference, but
1830 1604          # rather than assuming it's a safe combination, force the user
1831 1605          # to specify a DEBUG build.
1832 1606          #
↓ open down ↓ 35 lines elided ↑ open up ↑
1868 1642                      "will only sign crypto modules\n" | \
1869 1643                      tee -a $mail_msg_file >> $LOGFILE
1870 1644                  export ELFSIGN_OBJECT=true
1871 1645          elif [ "$VERIFY_ELFSIGN" = "y" ]; then
1872 1646                  echo "WARNING: VERIFY_ELFSIGN=y requires" \
1873 1647                      "the -t flag; ignoring VERIFY_ELFSIGN\n" | \
1874 1648                      tee -a $mail_msg_file >> $LOGFILE
1875 1649          fi
1876 1650  fi
1877 1651  
1878      -[ "$O_FLAG" = y ] && MULTI_PROTO=yes
1879      -
1880 1652  case $MULTI_PROTO in
1881 1653  yes|no) ;;
1882 1654  *)
1883 1655          echo "WARNING: MULTI_PROTO is \"$MULTI_PROTO\"; " \
1884 1656              "should be \"yes\" or \"no\"." | tee -a $mail_msg_file >> $LOGFILE
1885 1657          echo "Setting MULTI_PROTO to \"no\".\n" | \
1886 1658              tee -a $mail_msg_file >> $LOGFILE
1887 1659          export MULTI_PROTO=no
1888 1660          ;;
1889 1661  esac
↓ open down ↓ 95 lines elided ↑ open up ↑
1985 1757          find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \
1986 1758                  -o -name 'interfaces.*' \) -prune \
1987 1759                  -o -name '.make.*' -print | xargs rm -f
1988 1760  
1989 1761          $MAKE -ek clobber 2>&1 | tee -a $SRC/clobber-${MACH}.out >> $LOGFILE
1990 1762          echo "\n==== Make clobber ERRORS ====\n" >> $mail_msg_file
1991 1763          grep "$MAKE:" $SRC/clobber-${MACH}.out |
1992 1764                  egrep -v "Ignoring unknown host" \
1993 1765                  >> $mail_msg_file
1994 1766  
1995      -        if [[ "$t_FLAG" = "y" || "$O_FLAG" = "y" ]]; then
     1767 +        if [[ "$t_FLAG" = "y" ]]; then
1996 1768                  echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE
1997 1769                  cd ${TOOLS}
1998 1770                  rm -f ${TOOLS}/clobber-${MACH}.out
1999 1771                  $MAKE TOOLS_PROTO=$TOOLS_PROTO -ek clobber 2>&1 | \
2000 1772                          tee -a ${TOOLS}/clobber-${MACH}.out >> $LOGFILE
2001 1773                  echo "\n==== Make tools clobber ERRORS ====\n" \
2002 1774                          >> $mail_msg_file
2003 1775                  grep "$MAKE:" ${TOOLS}/clobber-${MACH}.out \
2004 1776                          >> $mail_msg_file
2005 1777                  rm -rf ${TOOLS_PROTO}
↓ open down ↓ 246 lines elided ↑ open up ↑
2252 2024          [[ $SCM_TYPE = none ]] && SCM_TYPE=$PARENT_SCM_TYPE
2253 2025  
2254 2026          run_hook POST_BRINGOVER
2255 2027  
2256 2028          check_closed_tree
2257 2029  
2258 2030  else
2259 2031          echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
2260 2032  fi
2261 2033  
2262      -if [[ "$O_FLAG" = y ]]; then
2263      -        build_ok=n
2264      -        echo "OpenSolaris binary deliverables need usr/closed." \
2265      -            | tee -a "$mail_msg_file" >> $LOGFILE
2266      -        exit 1
2267      -fi
2268      -
2269 2034  # Safeguards
2270 2035  [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
2271 2036  [[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
2272 2037  [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
2273 2038  
2274 2039  echo "\n==== Build environment ====\n" | tee -a $build_environ_file >> $LOGFILE
2275 2040  
2276 2041  # System
2277 2042  whence uname | tee -a $build_environ_file >> $LOGFILE
2278 2043  uname -a 2>&1 | tee -a $build_environ_file >> $LOGFILE
↓ open down ↓ 54 lines elided ↑ open up ↑
2333 2098  if [ `expr $LDVER \< 422` -eq 1 ]; then
2334 2099          echo "The link-editor needs to be at version 422 or higher to build" | \
2335 2100              tee -a $build_environ_file >> $LOGFILE
2336 2101          echo "the latest stuff.  Hope your build works." | \
2337 2102              tee -a $build_environ_file >> $LOGFILE
2338 2103  fi
2339 2104  
2340 2105  #
2341 2106  # Build and use the workspace's tools if requested
2342 2107  #
2343      -if [[ "$t_FLAG" = "y" || "$O_FLAG" = y ]]; then
     2108 +if [[ "$t_FLAG" = "y" ]]; then
2344 2109          set_non_debug_build_flags
2345 2110  
2346 2111          build_tools ${TOOLS_PROTO}
2347 2112          if [[ $? != 0  && "$t_FLAG" = y ]]; then
2348 2113                  use_tools $TOOLS_PROTO
2349 2114          fi
2350 2115  fi
2351 2116  
2352 2117  #
2353 2118  # copy ihv proto area in addition to the build itself
2354 2119  #
2355 2120  if [ "$X_FLAG" = "y" ]; then
2356 2121          copy_ihv_proto
2357 2122  fi
2358 2123  
2359      -if [ "$i_FLAG" = "y" -a "$SH_FLAG" = "y" ]; then
2360      -        echo "\n==== NOT Building base OS-Net source ====\n" | \
2361      -            tee -a $LOGFILE >> $mail_msg_file
2362      -else
2363      -        # timestamp the start of the normal build; the findunref tool uses it.
2364      -        touch $SRC/.build.tstamp
     2124 +# timestamp the start of the normal build; the findunref tool uses it.
     2125 +touch $SRC/.build.tstamp
2365 2126  
2366      -        normal_build
2367      -fi
2368      -
2369      -#
2370      -# Generate the THIRDPARTYLICENSE files if needed.  This is done after
2371      -# the build, so that dynamically-created license files are there.
2372      -# It's done before findunref to help identify license files that need
2373      -# to be added to tools/opensolaris/license-list.
2374      -#
2375      -if [ "$O_FLAG" = y -a "$build_ok" = y ]; then
2376      -        echo "\n==== Generating THIRDPARTYLICENSE files ====\n" |
2377      -            tee -a "$mail_msg_file" >> "$LOGFILE"
2378      -
2379      -        if [ -d $ROOT/licenses/usr ]; then
2380      -                ( cd $ROOT/licenses ; \
2381      -                    mktpl $SRC/pkg/license-list ) >> "$LOGFILE" 2>&1
2382      -                if (( $? != 0 )) ; then
2383      -                        echo "Couldn't create THIRDPARTYLICENSE files" |
2384      -                            tee -a "$mail_msg_file" >> "$LOGFILE"
2385      -                fi
2386      -        else
2387      -                echo "No licenses found under $ROOT/licenses" |
2388      -                    tee -a "$mail_msg_file" >> "$LOGFILE"
2389      -        fi
2390      -fi
     2127 +normal_build
2391 2128  
2392 2129  ORIG_SRC=$SRC
2393 2130  BINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
2394 2131  
2395      -if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
2396      -        save_binaries
2397      -fi
2398      -
2399      -
2400      -# EXPORT_SRC comes after CRYPT_SRC since a domestic build will need
2401      -# $SRC pointing to the export_source usr/src.
2402      -
2403      -if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
2404      -        if [ "$SD_FLAG" = "y" -a $build_ok = y ]; then
2405      -            set_up_source_build ${CODEMGR_WS} ${CRYPT_SRC} CRYPT_SRC
2406      -        fi
2407      -
2408      -        if [ $build_ok = y ]; then
2409      -            set_up_source_build ${CODEMGR_WS} ${EXPORT_SRC} EXPORT_SRC
2410      -        fi
2411      -fi
2412      -
2413      -if [ "$SD_FLAG" = "y" -a $build_ok = y ]; then
2414      -        # drop the crypt files in place.
2415      -        cd ${EXPORT_SRC}
2416      -        echo "\nextracting crypt_files.cpio.Z onto export_source.\n" \
2417      -            >> ${LOGFILE}
2418      -        zcat ${CODEMGR_WS}/crypt_files.cpio.Z | \
2419      -            cpio -idmucvB 2>/dev/null >> ${LOGFILE}
2420      -        if [ "$?" = "0" ]; then
2421      -                echo "\n==== DOMESTIC extraction succeeded ====\n" \
2422      -                    >> $mail_msg_file
2423      -        else
2424      -                echo "\n==== DOMESTIC extraction failed ====\n" \
2425      -                    >> $mail_msg_file
2426      -        fi
2427      -
2428      -fi
2429      -
2430      -if [ "$SO_FLAG" = "y" -a "$build_ok" = y ]; then
2431      -        #
2432      -        # Copy the open sources into their own tree.
2433      -        # If copy_source fails, it will have already generated an
2434      -        # error message and set build_ok=n, so we don't need to worry
2435      -        # about that here.
2436      -        #
2437      -        copy_source $CODEMGR_WS $OPEN_SRCDIR OPEN_SOURCE usr/src
2438      -fi
2439      -
2440      -if [ "$SO_FLAG" = "y" -a "$build_ok" = y ]; then
2441      -        SRC=$OPEN_SRCDIR/usr/src
2442      -fi
2443      -
2444      -if is_source_build && [ $build_ok = y ] ; then
2445      -        # remove proto area(s) here, since we don't clobber
2446      -        rm -rf `allprotos`
2447      -        if [ "$t_FLAG" = "y" ]; then
2448      -                set_non_debug_build_flags
2449      -                ORIG_TOOLS=$TOOLS
2450      -                #
2451      -                # SRC was set earlier to point to the source build
2452      -                # source tree (e.g., $EXPORT_SRC).
2453      -                #
2454      -                TOOLS=${SRC}/tools
2455      -                TOOLS_PROTO=${TOOLS}/${TOOLS_PROTO_REL}; export TOOLS_PROTO
2456      -                build_tools ${TOOLS_PROTO}
2457      -                if [[ $? != 0 ]]; then
2458      -                        use_tools ${TOOLS_PROTO}
2459      -                fi
2460      -        fi
2461      -
2462      -        normal_build
2463      -fi
2464 2132  
2465 2133  #
2466 2134  # There are several checks that need to look at the proto area, but
2467 2135  # they only need to look at one, and they don't care whether it's
2468 2136  # DEBUG or non-DEBUG.
2469 2137  #
2470 2138  if [[ "$MULTI_PROTO" = yes && "$D_FLAG" = n ]]; then
2471 2139          checkroot=$ROOT-nd
2472 2140  else
2473 2141          checkroot=$ROOT
↓ open down ↓ 355 lines elided ↑ open up ↑
2829 2497          fi
2830 2498  
2831 2499          diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
2832 2500  fi
2833 2501  
2834 2502  #
2835 2503  # Generate the OpenSolaris deliverables if requested.  Some of these
2836 2504  # steps need to come after findunref and are commented below.
2837 2505  #
2838 2506  
2839      -# If we are doing an OpenSolaris _source_ build (-S O) then we do
2840      -# not have usr/closed available to us to generate closedbins from,
2841      -# so skip this part.
2842      -if [ "$SO_FLAG" = n -a "$O_FLAG" = y -a "$build_ok" = y ]; then
2843      -        echo "\n==== Generating OpenSolaris tarballs ====\n" | \
2844      -            tee -a $mail_msg_file >> $LOGFILE
2845      -
2846      -        cd $CODEMGR_WS
2847      -
2848      -        #
2849      -        # This step grovels through the package manifests, so it
2850      -        # must come after findunref.
2851      -        #
2852      -        # We assume no DEBUG vs non-DEBUG package content variation
2853      -        # here; if that changes, then the "make all" in $SRC/pkg will
2854      -        # need to be moved into the conditionals and repeated for each
2855      -        # different build.
2856      -        #
2857      -        echo "Generating closed binaries tarball(s)..." >> $LOGFILE
2858      -        closed_basename=on-closed-bins
2859      -        if [ "$D_FLAG" = y ]; then
2860      -                bindrop "$closed_basename" >>"$LOGFILE" 2>&1
2861      -                if (( $? != 0 )) ; then
2862      -                        echo "Couldn't create DEBUG closed binaries." |
2863      -                            tee -a $mail_msg_file >> $LOGFILE
2864      -                        build_ok=n
2865      -                fi
2866      -        fi
2867      -        if [ "$F_FLAG" = n ]; then
2868      -                bindrop -n "$closed_basename-nd" >>"$LOGFILE" 2>&1
2869      -                if (( $? != 0 )) ; then
2870      -                        echo "Couldn't create non-DEBUG closed binaries." |
2871      -                            tee -a $mail_msg_file >> $LOGFILE
2872      -                        build_ok=n
2873      -                fi
2874      -        fi
2875      -
2876      -        echo "Generating README.opensolaris..." >> $LOGFILE
2877      -        cat $SRC/tools/opensolaris/README.opensolaris.tmpl | \
2878      -            mkreadme_osol $CODEMGR_WS/README.opensolaris >> $LOGFILE 2>&1
2879      -        if (( $? != 0 )) ; then
2880      -                echo "Couldn't create README.opensolaris." |
2881      -                    tee -a $mail_msg_file >> $LOGFILE
2882      -                build_ok=n
2883      -        fi
2884      -fi
2885      -
2886 2507  # Verify that the usual lists of files, such as exception lists,
2887 2508  # contain only valid references to files.  If the build has failed,
2888 2509  # then don't check the proto area.
2889 2510  CHECK_PATHS=${CHECK_PATHS:-y}
2890 2511  if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
2891 2512          echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
2892 2513                  >>$mail_msg_file
2893 2514          arg=-b
2894 2515          [ "$build_ok" = y ] && arg=
2895 2516          checkpaths $arg $checkroot 2>&1 | tee -a $LOGFILE >>$mail_msg_file
↓ open down ↓ 97 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX