Print this page
4526 nightly contains a great deal of effectively dead code

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/nightly.sh
          +++ new/usr/src/tools/scripts/nightly.sh
↓ open down ↓ 38 lines elided ↑ open up ↑
  39   39  #
  40   40  # LINTDIRS can be set in the env file, format is a list of:
  41   41  #
  42   42  #       /dirname-to-run-lint-on flag
  43   43  #
  44   44  #       Where flag is:  y - enable lint noise diff output
  45   45  #                       n - disable lint noise diff output
  46   46  #
  47   47  #       For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
  48   48  #
  49      -# OPTHOME and TEAMWARE may be set in the environment to override /opt
  50      -# and /opt/teamware defaults.
       49 +# OPTHOME  may be set in the environment to override /opt
  51   50  #
  52   51  
  53   52  #
  54   53  # The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
  55   54  # under certain circumstances, which can really screw things up; unset it.
  56   55  #
  57   56  unset CDPATH
  58   57  
  59   58  # Get the absolute path of the nightly script that the user invoked.  This
  60   59  # may be a relative path, and we need to do this before changing directory.
↓ open down ↓ 29 lines elided ↑ open up ↑
  90   89          typeset crypto_signer="$CODESIGN_USER"
  91   90  
  92   91          suffix=""
  93   92  
  94   93          # non-DEBUG build begins
  95   94  
  96   95          if [ "$F_FLAG" = "n" ]; then
  97   96                  set_non_debug_build_flags
  98   97                  CODESIGN_USER="$crypto_signer" \
  99   98                      build "non-DEBUG" "$suffix-nd" "-nd" "$MULTI_PROTO"
 100      -                if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
 101      -                    "$p_FLAG" = "y" ]; then
 102      -                        copy_ihv_pkgs non-DEBUG -nd
 103      -                fi
 104   99          else
 105  100                  echo "\n==== No non-DEBUG $open_only build ====\n" >> "$LOGFILE"
 106  101          fi
 107  102  
 108  103          # non-DEBUG build ends
 109  104  
 110  105          # DEBUG build begins
 111  106  
 112  107          if [ "$D_FLAG" = "y" ]; then
 113  108                  set_debug_build_flags
 114  109                  CODESIGN_USER="$crypto_signer" \
 115  110                      build "DEBUG" "$suffix" "" "$MULTI_PROTO"
 116      -                if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
 117      -                    "$p_FLAG" = "y" ]; then
 118      -                        copy_ihv_pkgs DEBUG ""
 119      -                fi
 120  111          else
 121  112                  echo "\n==== No DEBUG $open_only build ====\n" >> "$LOGFILE"
 122  113          fi
 123  114  
 124  115          # DEBUG build ends
 125  116  
 126  117          p_FLAG="$orig_p_FLAG"
 127  118  }
 128  119  
 129  120  #
↓ open down ↓ 19 lines elided ↑ open up ↑
 149  140  
 150  141                  if [ -f $TMPDIR/abort ]; then
 151  142                          build_ok=n
 152  143                          echo "\nAborting at request of $HOOKNAME" |
 153  144                                  tee -a $mail_msg_file >> $LOGFILE
 154  145                          exit 1
 155  146                  fi
 156  147          fi
 157  148  }
 158  149  
 159      -#
 160      -# usage: filelist DESTDIR PATTERN
 161      -#
 162      -function filelist {
 163      -        DEST=$1
 164      -        PATTERN=$2
 165      -        cd ${DEST}
 166      -}
 167      -
 168      -# function to save off binaries after a full build for later
 169      -# restoration
 170      -function save_binaries {
 171      -        # save off list of binaries
 172      -        echo "\n==== Saving binaries from build at `date` ====\n" | \
 173      -            tee -a $mail_msg_file >> $LOGFILE
 174      -        rm -f ${BINARCHIVE}
 175      -        cd ${CODEMGR_WS}
 176      -        filelist ${CODEMGR_WS} '^preserve:' >> $LOGFILE
 177      -        filelist ${CODEMGR_WS} '^preserve:' | \
 178      -            cpio -ocB 2>/dev/null | compress \
 179      -            > ${BINARCHIVE}
 180      -}
 181      -
 182      -# delete files
 183      -# usage: hybridize_files DESTDIR MAKE_TARGET
 184      -function hybridize_files {
 185      -        DEST=$1
 186      -        MAKETARG=$2
 187      -
 188      -        echo "\n==== Hybridizing files at `date` ====\n" | \
 189      -            tee -a $mail_msg_file >> $LOGFILE
 190      -        for i in `filelist ${DEST} '^delete:'`
 191      -        do
 192      -                echo "removing ${i}." | tee -a $mail_msg_file >> $LOGFILE
 193      -                rm -rf "${i}"
 194      -        done
 195      -        for i in `filelist ${DEST} '^hybridize:' `
 196      -        do
 197      -                echo "hybridizing ${i}." | tee -a $mail_msg_file >> $LOGFILE
 198      -                rm -f ${i}+
 199      -                sed -e "/^# HYBRID DELETE START/,/^# HYBRID DELETE END/d" \
 200      -                    < ${i} > ${i}+
 201      -                mv ${i}+ ${i}
 202      -        done
 203      -}
 204      -
 205      -# restore binaries into the proper source tree.
 206      -# usage: restore_binaries DESTDIR MAKE_TARGET
 207      -function restore_binaries {
 208      -        DEST=$1
 209      -        MAKETARG=$2
 210      -
 211      -        echo "\n==== Restoring binaries to ${MAKETARG} at `date` ====\n" | \
 212      -            tee -a $mail_msg_file >> $LOGFILE
 213      -        cd ${DEST}
 214      -        zcat ${BINARCHIVE} | \
 215      -            cpio -idmucvB 2>/dev/null | tee -a $mail_msg_file >> ${LOGFILE}
 216      -}
 217      -
 218      -# rename files we save binaries of
 219      -# usage: rename_files DESTDIR MAKE_TARGET
 220      -function rename_files {
 221      -        DEST=$1
 222      -        MAKETARG=$2
 223      -        echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
 224      -            tee -a $mail_msg_file >> $LOGFILE
 225      -        for i in `filelist ${DEST} '^rename:'`
 226      -        do
 227      -                echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
 228      -                rm -f ${i}.export
 229      -                mv ${i} ${i}.export
 230      -        done
 231      -}
 232      -
 233  150  # Return library search directive as function of given root.
 234  151  function myldlibs {
 235  152          echo "-L$1/lib -L$1/usr/lib"
 236  153  }
 237  154  
 238  155  # Return header search directive as function of given root.
 239  156  function myheaders {
 240  157          echo "-I$1/usr/include"
 241  158  }
 242  159  
↓ open down ↓ 27 lines elided ↑ open up ↑
 270  187          #       Build OS-Networking source
 271  188          #
 272  189          echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
 273  190                  >> $LOGFILE
 274  191  
 275  192          rm -f $SRC/${INSTALLOG}.out
 276  193          cd $SRC
 277  194          /bin/time $MAKE -e install 2>&1 | \
 278  195              tee -a $SRC/${INSTALLOG}.out >> $LOGFILE
 279  196  
 280      -        if [[ "$SCM_TYPE" = teamware ]]; then
 281      -                echo "\n==== SCCS Noise ($LABEL) ====\n" >> $mail_msg_file
 282      -                egrep 'sccs(check:| *get)' $SRC/${INSTALLOG}.out >> \
 283      -                        $mail_msg_file
 284      -        fi
 285      -
 286  197          echo "\n==== Build errors ($LABEL) ====\n" >> $mail_msg_file
 287  198          egrep ":" $SRC/${INSTALLOG}.out |
 288  199                  egrep -e "(^${MAKE}:|[  ]error[:        \n])" | \
 289  200                  egrep -v "Ignoring unknown host" | \
 290  201                  egrep -v "cc .* -o error " | \
 291  202                  egrep -v "warning" >> $mail_msg_file
 292  203          if [ "$?" = "0" ]; then
 293  204                  build_ok=n
 294  205                  this_build_ok=n
 295  206          fi
 296  207          grep "bootblock image is .* bytes too big" $SRC/${INSTALLOG}.out \
 297  208                  >> $mail_msg_file
 298  209          if [ "$?" = "0" ]; then
 299  210                  build_ok=n
 300  211                  this_build_ok=n
 301  212          fi
 302  213  
 303      -        if [ "$W_FLAG" = "n" ]; then
 304      -                echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
 305      -                egrep -i warning: $SRC/${INSTALLOG}.out \
 306      -                        | egrep -v '^tic:' \
 307      -                        | egrep -v "symbol (\`|')timezone' has differing types:" \
 308      -                        | egrep -v "parameter <PSTAMP> set to" \
 309      -                        | egrep -v "Ignoring unknown host" \
 310      -                        | egrep -v "redefining segment flags attribute for" \
 311      -                        >> $mail_msg_file
 312      -        fi
      214 +        echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
      215 +        egrep -i warning: $SRC/${INSTALLOG}.out \
      216 +                | egrep -v '^tic:' \
      217 +                | egrep -v "symbol (\`|')timezone' has differing types:" \
      218 +                | egrep -v "parameter <PSTAMP> set to" \
      219 +                | egrep -v "Ignoring unknown host" \
      220 +                | egrep -v "redefining segment flags attribute for" \
      221 +                >> $mail_msg_file
 313  222  
 314  223          echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" \
 315  224                  >> $LOGFILE
 316  225  
 317  226          echo "\n==== Elapsed build time ($LABEL) ====\n" >>$mail_msg_file
 318  227          tail -3  $SRC/${INSTALLOG}.out >>$mail_msg_file
 319  228  
 320      -        if [ "$i_FLAG" = "n" -a "$W_FLAG" = "n" ]; then
      229 +        if [ "$i_FLAG" = "n" ]; then
 321  230                  rm -f $SRC/${NOISE}.ref
 322  231                  if [ -f $SRC/${NOISE}.out ]; then
 323  232                          mv $SRC/${NOISE}.out $SRC/${NOISE}.ref
 324  233                  fi
 325  234                  grep : $SRC/${INSTALLOG}.out \
 326  235                          | egrep -v '^/' \
 327  236                          | egrep -v '^(Start|Finish|real|user|sys|./bld_awk)' \
 328  237                          | egrep -v '^tic:' \
 329  238                          | egrep -v '^mcs' \
 330  239                          | egrep -v '^LD_LIBRARY_PATH=' \
↓ open down ↓ 68 lines elided ↑ open up ↑
 399  308                  if (( $? == 0 )) ; then
 400  309                          build_ok=n
 401  310                          this_build_ok=n
 402  311                  fi
 403  312          fi
 404  313  
 405  314          #
 406  315          #       Building Packages
 407  316          #
 408  317          if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
 409      -                if [ -d $SRC/pkg -o -d $SRC/pkgdefs ]; then
      318 +                if [ -d $SRC/pkg ]; then
 410  319                          echo "\n==== Creating $LABEL packages at `date` ====\n" \
 411  320                                  >> $LOGFILE
 412  321                          echo "Clearing out $PKGARCHIVE ..." >> $LOGFILE
 413  322                          rm -rf $PKGARCHIVE >> "$LOGFILE" 2>&1
 414  323                          mkdir -p $PKGARCHIVE >> "$LOGFILE" 2>&1
 415  324  
 416      -                        for d in pkg pkgdefs; do
 417      -                                if [ ! -f "$SRC/$d/Makefile" ]; then
 418      -                                        continue
 419      -                                fi
 420      -                                rm -f $SRC/$d/${INSTALLOG}.out
 421      -                                cd $SRC/$d
 422      -                                /bin/time $MAKE -e install 2>&1 | \
 423      -                                        tee -a $SRC/$d/${INSTALLOG}.out >> $LOGFILE
 424      -                        done
      325 +                        rm -f $SRC/pkg/${INSTALLOG}.out
      326 +                        cd $SRC/pkg
      327 +                        /bin/time $MAKE -e install 2>&1 | \
      328 +                            tee -a $SRC/pkg/${INSTALLOG}.out >> $LOGFILE
 425  329  
 426  330                          echo "\n==== package build errors ($LABEL) ====\n" \
 427  331                                  >> $mail_msg_file
 428  332  
 429      -                        for d in pkg pkgdefs; do
 430      -                                if [ ! -f "$SRC/$d/Makefile" ]; then
 431      -                                        continue
 432      -                                fi
 433      -
 434      -                                egrep "${MAKE}|ERROR|WARNING" $SRC/$d/${INSTALLOG}.out | \
 435      -                                        grep ':' | \
 436      -                                        grep -v PSTAMP | \
 437      -                                        egrep -v "Ignoring unknown host" \
 438      -                                        >> $mail_msg_file
 439      -                        done
      333 +                        egrep "${MAKE}|ERROR|WARNING" $SRC/pkg/${INSTALLOG}.out | \
      334 +                                grep ':' | \
      335 +                                grep -v PSTAMP | \
      336 +                                egrep -v "Ignoring unknown host" \
      337 +                                >> $mail_msg_file
 440  338                  else
 441  339                          #
 442  340                          # Handle it gracefully if -p was set but there are
 443      -                        # neither pkg nor pkgdefs directories.
      341 +                        # neither pkg directories.
 444  342                          #
 445  343                          echo "\n==== No $LABEL packages to build ====\n" \
 446  344                                  >> $LOGFILE
 447  345                  fi
 448  346          else
 449  347                  echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE
 450  348          fi
 451  349  
 452  350          ROOT=$ORIGROOT
 453  351  }
↓ open down ↓ 75 lines elided ↑ open up ↑
 529  427                  # above
 530  428                  egrep -i '(warning|lint):' ${LINTNOISE}.out \
 531  429                          | sort | uniq >> $mail_msg_file
 532  430                  echo "\n==== lint noise differences $base ====\n" \
 533  431                          >> $mail_msg_file
 534  432                  diff ${LINTNOISE}.ref ${LINTNOISE}.out \
 535  433                          >> $mail_msg_file
 536  434          fi
 537  435  }
 538  436  
 539      -# Install proto area from IHV build
 540      -
 541      -function copy_ihv_proto {
 542      -
 543      -        echo "\n==== Installing IHV proto area ====\n" \
 544      -                >> $LOGFILE
 545      -        if [ -d "$IA32_IHV_ROOT" ]; then
 546      -                if [ ! -d "$ROOT" ]; then
 547      -                        echo "mkdir -p $ROOT" >> $LOGFILE
 548      -                        mkdir -p $ROOT
 549      -                fi
 550      -                echo "copying $IA32_IHV_ROOT to $ROOT\n" >> $LOGFILE
 551      -                cd $IA32_IHV_ROOT
 552      -                tar cf - . | (cd $ROOT; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
 553      -        else
 554      -                echo "$IA32_IHV_ROOT: not found" >> $LOGFILE
 555      -        fi
 556      -
 557      -        if [ "$MULTI_PROTO" = yes ]; then
 558      -                if [ ! -d "$ROOT-nd" ]; then
 559      -                        echo "mkdir -p $ROOT-nd" >> $LOGFILE
 560      -                        mkdir -p $ROOT-nd
 561      -                fi
 562      -                # If there's a non-DEBUG version of the IHV proto area,
 563      -                # copy it, but copy something if there's not.
 564      -                if [ -d "$IA32_IHV_ROOT-nd" ]; then
 565      -                        echo "copying $IA32_IHV_ROOT-nd to $ROOT-nd\n" >> $LOGFILE
 566      -                        cd $IA32_IHV_ROOT-nd
 567      -                elif [ -d "$IA32_IHV_ROOT" ]; then
 568      -                        echo "copying $IA32_IHV_ROOT to $ROOT-nd\n" >> $LOGFILE
 569      -                        cd $IA32_IHV_ROOT
 570      -                else
 571      -                        echo "$IA32_IHV_ROOT{-nd,}: not found" >> $LOGFILE
 572      -                        return
 573      -                fi
 574      -                tar cf - . | (cd $ROOT-nd; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
 575      -        fi
 576      -}
 577      -
 578      -# Install IHV packages in PKGARCHIVE
 579      -# usage: copy_ihv_pkgs LABEL SUFFIX
 580      -function copy_ihv_pkgs {
 581      -        LABEL=$1
 582      -        SUFFIX=$2
 583      -        # always use non-DEBUG IHV packages
 584      -        IA32_IHV_PKGS=${IA32_IHV_PKGS_ORIG}-nd
 585      -        PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
 586      -
 587      -        echo "\n==== Installing IHV packages from $IA32_IHV_PKGS ($LABEL) ====\n" \
 588      -                >> $LOGFILE
 589      -        if [ -d "$IA32_IHV_PKGS" ]; then
 590      -                cd $IA32_IHV_PKGS
 591      -                tar cf - * | \
 592      -                   (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
 593      -        else
 594      -                echo "$IA32_IHV_PKGS: not found" >> $LOGFILE
 595      -        fi
 596      -
 597      -        echo "\n==== Installing IHV packages from $IA32_IHV_BINARY_PKGS ($LABEL) ====\n" \
 598      -                >> $LOGFILE
 599      -        if [ -d "$IA32_IHV_BINARY_PKGS" ]; then
 600      -                cd $IA32_IHV_BINARY_PKGS
 601      -                tar cf - * | \
 602      -                    (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
 603      -        else
 604      -                echo "$IA32_IHV_BINARY_PKGS: not found" >> $LOGFILE
 605      -        fi
 606      -}
 607      -
 608  437  #
 609  438  # Build and install the onbld tools.
 610  439  #
 611  440  # usage: build_tools DESTROOT
 612  441  #
 613  442  # returns non-zero status if the build was successful.
 614  443  #
 615  444  function build_tools {
 616  445          DESTROOT=$1
 617  446  
↓ open down ↓ 94 lines elided ↑ open up ↑
 712  541                  shift
 713  542                  for i
 714  543                  do
 715  544                          arg="$arg \"$i\""
 716  545                  done
 717  546                  eval su $STAFFER -c \'$arg\'
 718  547          fi
 719  548  }
 720  549  
 721  550  #
 722      -# Verify that the closed tree is present if it needs to be.
      551 +# Verify that the closed bins are present
 723  552  #
 724      -function check_closed_tree {
      553 +function check_closed_bins {
 725  554          if [[ ! -d "$ON_CLOSED_BINS" ]]; then
 726  555                  echo "ON_CLOSED_BINS must point to the closed binaries tree."
 727  556                  build_ok=n
 728  557                  exit 1
 729  558          fi
 730  559  }
 731  560  
 732      -function obsolete_build {
 733      -        echo "WARNING: Obsolete $1 build requested; request will be ignored"
 734      -}
 735      -
 736  561  #
 737  562  # wrapper over wsdiff.
 738  563  # usage: do_wsdiff LABEL OLDPROTO NEWPROTO
 739  564  #
 740  565  function do_wsdiff {
 741  566          label=$1
 742  567          oldproto=$2
 743  568          newproto=$3
 744  569  
 745  570          wsdiff="wsdiff"
↓ open down ↓ 24 lines elided ↑ open up ↑
 770  595          unset EXTRA_CFLAGS
 771  596  }
 772  597  
 773  598  
 774  599  MACH=`uname -p`
 775  600  
 776  601  if [ "$OPTHOME" = "" ]; then
 777  602          OPTHOME=/opt
 778  603          export OPTHOME
 779  604  fi
 780      -if [ "$TEAMWARE" = "" ]; then
 781      -        TEAMWARE=$OPTHOME/teamware
 782      -        export TEAMWARE
 783      -fi
 784  605  
 785  606  USAGE='Usage: nightly [-in] [+t] [-V VERS ] <env_file>
 786  607  
 787  608  Where:
 788  609          -i      Fast incremental options (no clobber, lint, check)
 789  610          -n      Do not do a bringover
 790  611          +t      Use the build tools in $ONBLD_TOOLS/bin
 791  612          -V VERS set the build version string to VERS
 792  613  
 793  614          <env_file>  file in Bourne shell syntax that sets and exports
↓ open down ↓ 8 lines elided ↑ open up ↑
 802  623          -C      check for cstyle/hdrchk errors
 803  624          -D      do a build with DEBUG on
 804  625          -F      do _not_ do a non-DEBUG build
 805  626          -G      gate keeper default group of options (-au)
 806  627          -I      integration engineer default group of options (-ampu)
 807  628          -M      do not run pmodes (safe file permission checker)
 808  629          -N      do not run protocmp
 809  630          -R      default group of options for building a release (-mp)
 810  631          -U      update proto area in the parent
 811  632          -V VERS set the build version string to VERS
 812      -        -X      copy x86 IHV proto area
 813  633          -f      find unreferenced files
 814  634          -i      do an incremental build (no "make clobber")
 815  635          -l      do "make lint" in $LINTDIRS (default: $SRC y)
 816  636          -m      send mail to $MAILTO at end of build
 817  637          -n      do not do a bringover
 818      -        -o      build using root privileges to set OWNER/GROUP (old style)
 819  638          -p      create packages
 820  639          -r      check ELF runtime attributes in the proto area
 821  640          -t      build and use the tools in $SRC/tools (default setting)
 822  641          +t      Use the build tools in $ONBLD_TOOLS/bin
 823  642          -u      update proto_list_$MACH and friends in the parent workspace;
 824  643                  when used with -f, also build an unrefmaster.out in the parent
 825  644          -w      report on differences between previous and current proto areas
 826      -        -z      compress cpio archives with gzip
 827      -        -W      Do not report warnings (freeware gate ONLY)
 828  645  '
 829  646  #
 830  647  #       A log file will be generated under the name $LOGFILE
 831  648  #       for partially completed build and log.`date '+%F'`
 832  649  #       in the same directory for fully completed builds.
 833  650  #
 834  651  
 835  652  # default values for low-level FLAGS; G I R are group FLAGS
 836  653  A_FLAG=n
 837  654  C_FLAG=n
 838  655  D_FLAG=n
 839  656  F_FLAG=n
 840  657  f_FLAG=n
 841  658  i_FLAG=n; i_CMD_LINE_FLAG=n
 842  659  l_FLAG=n
 843  660  M_FLAG=n
 844  661  m_FLAG=n
 845  662  N_FLAG=n
 846  663  n_FLAG=n
 847      -o_FLAG=n
 848      -P_FLAG=n
 849  664  p_FLAG=n
 850  665  r_FLAG=n
 851      -T_FLAG=n
 852  666  t_FLAG=y
 853  667  U_FLAG=n
 854  668  u_FLAG=n
 855  669  V_FLAG=n
 856      -W_FLAG=n
 857  670  w_FLAG=n
 858      -X_FLAG=n
 859      -#
 860      -XMOD_OPT=
 861  671  #
 862  672  build_ok=y
 863  673  
 864  674  #
 865  675  # examine arguments
 866  676  #
 867  677  
 868  678  OPTIND=1
 869  679  while getopts +intV: FLAG
 870  680  do
↓ open down ↓ 132 lines elided ↑ open up ↑
1003  813  fi
1004  814  
1005  815  #
1006  816  # If BRINGOVER_WS was not specified, let it default to CLONE_WS
1007  817  #
1008  818  if [ "$BRINGOVER_WS" = "" ]; then
1009  819          BRINGOVER_WS=$CLONE_WS
1010  820  fi
1011  821  
1012  822  #
1013      -# If CLOSED_BRINGOVER_WS was not specified, let it default to CLOSED_CLONE_WS
1014      -#
1015      -if [ "$CLOSED_BRINGOVER_WS" = "" ]; then
1016      -        CLOSED_BRINGOVER_WS=$CLOSED_CLONE_WS
1017      -fi
1018      -
1019      -#
1020  823  # If BRINGOVER_FILES was not specified, default to usr
1021  824  #
1022  825  if [ "$BRINGOVER_FILES" = "" ]; then
1023  826          BRINGOVER_FILES="usr"
1024  827  fi
1025  828  
1026      -check_closed_tree
      829 +check_closed_bins
1027  830  
1028  831  #
1029  832  # Note: changes to the option letters here should also be applied to the
1030  833  #       bldenv script.  `d' is listed for backward compatibility.
1031  834  #
1032  835  NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
1033  836  OPTIND=1
1034      -while getopts +ABCDdFfGIilMmNnoPpRrTtUuWwXxz FLAG $NIGHTLY_OPTIONS
      837 +while getopts +ABCDdFfGIilMmNnpRrtUuw FLAG $NIGHTLY_OPTIONS
1035  838  do
1036  839          case $FLAG in
1037  840            A )   A_FLAG=y
1038  841                  ;;
1039  842            B )   D_FLAG=y
1040  843                  ;; # old version of D
1041  844            C )   C_FLAG=y
1042  845                  ;;
1043  846            D )   D_FLAG=y
1044  847                  ;;
↓ open down ↓ 12 lines elided ↑ open up ↑
1057  860            l )   l_FLAG=y
1058  861                  ;;
1059  862            M )   M_FLAG=y
1060  863                  ;;
1061  864            m )   m_FLAG=y
1062  865                  ;;
1063  866            N )   N_FLAG=y
1064  867                  ;;
1065  868            n )   n_FLAG=y
1066  869                  ;;
1067      -          o )   o_FLAG=y
1068      -                ;;
1069      -          P )   P_FLAG=y
1070      -                ;; # obsolete
1071  870            p )   p_FLAG=y
1072  871                  ;;
1073  872            R )   m_FLAG=y
1074  873                  p_FLAG=y
1075  874                  ;;
1076  875            r )   r_FLAG=y
1077  876                  ;;
1078      -          T )   T_FLAG=y
1079      -                ;; # obsolete
1080  877           +t )   t_FLAG=n
1081  878                  ;;
1082  879            U )   if [ -z "${PARENT_ROOT}" ]; then
1083  880                          echo "PARENT_ROOT must be set if the U flag is" \
1084  881                              "present in NIGHTLY_OPTIONS."
1085  882                          exit 1
1086  883                  fi
1087  884                  NIGHTLY_PARENT_ROOT=$PARENT_ROOT
1088  885                  if [ -n "${PARENT_TOOLS_ROOT}" ]; then
1089  886                          NIGHTLY_PARENT_TOOLS_ROOT=$PARENT_TOOLS_ROOT
1090  887                  fi
1091  888                  U_FLAG=y
1092  889                  ;;
1093  890            u )   u_FLAG=y
1094  891                  ;;
1095      -          W )   W_FLAG=y
1096      -                ;;
1097      -
1098  892            w )   w_FLAG=y
1099  893                  ;;
1100      -          X )   # now that we no longer need realmode builds, just
1101      -                # copy IHV packages.  only meaningful on x86.
1102      -                if [ "$MACH" = "i386" ]; then
1103      -                        X_FLAG=y
1104      -                fi
1105      -                ;;
1106      -          x )   XMOD_OPT="-x"
1107      -                ;;
1108  894           \? )   echo "$USAGE"
1109  895                  exit 1
1110  896                  ;;
1111  897          esac
1112  898  done
1113  899  
1114  900  if [ $ISUSER -ne 0 ]; then
1115      -        if [ "$o_FLAG" = "y" ]; then
1116      -                echo "Old-style build requires root permission."
1117      -                exit 1
1118      -        fi
1119      -
1120  901          # Set default value for STAFFER, if needed.
1121  902          if [ -z "$STAFFER" -o "$STAFFER" = "nobody" ]; then
1122  903                  STAFFER=`/usr/xpg4/bin/id -un`
1123  904                  export STAFFER
1124  905          fi
1125  906  fi
1126  907  
1127  908  if [ -z "$MAILTO" -o "$MAILTO" = "nobody" ]; then
1128  909          MAILTO=$STAFFER
1129  910          export MAILTO
1130  911  fi
1131  912  
1132  913  PATH="$OPTHOME/onbld/bin:$OPTHOME/onbld/bin/${MACH}:/usr/ccs/bin"
1133      -PATH="$PATH:$OPTHOME/SUNWspro/bin:$TEAMWARE/bin:/usr/bin:/usr/sbin:/usr/ucb"
      914 +PATH="$PATH:$OPTHOME/SUNWspro/bin:/usr/bin:/usr/sbin:/usr/ucb"
1134  915  PATH="$PATH:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
1135  916  export PATH
1136  917  
1137  918  # roots of source trees, both relative to $SRC and absolute.
1138  919  relsrcdirs="."
1139  920  abssrcdirs="$SRC"
1140  921  
1141      -unset CH
1142      -if [ "$o_FLAG" = "y" ]; then
1143      -# root invoked old-style build -- make sure it works as it always has
1144      -# by exporting 'CH'.  The current Makefile.master doesn't use this, but
1145      -# the old ones still do.
1146      -        PROTOCMPTERSE="protocmp.terse"
1147      -        CH=
1148      -        export CH
1149      -else
1150      -        PROTOCMPTERSE="protocmp.terse -gu"
1151      -fi
      922 +PROTOCMPTERSE="protocmp.terse -gu"
1152  923  POUND_SIGN="#"
1153  924  # have we set RELEASE_DATE in our env file?
1154  925  if [ -z "$RELEASE_DATE" ]; then
1155  926          RELEASE_DATE=$(LC_ALL=C date +"%B %Y")
1156  927  fi
1157  928  BUILD_DATE=$(LC_ALL=C date +%Y-%b-%d)
1158  929  BASEWSDIR=$(basename $CODEMGR_WS)
1159  930  DEV_CM="\"@(#)SunOS Internal Development: $LOGNAME $BUILD_DATE [$BASEWSDIR]\""
1160  931  
1161  932  # we export POUND_SIGN, RELEASE_DATE and DEV_CM to speed up the build process
1162      -# by avoiding repeated shell invocations to evaluate Makefile.master definitions.
1163      -# we export o_FLAG and X_FLAG for use by makebfu, and by usr/src/pkg/Makefile
1164      -export o_FLAG X_FLAG POUND_SIGN RELEASE_DATE DEV_CM
      933 +# by avoiding repeated shell invocations to evaluate Makefile.master
      934 +# definitions.
      935 +export POUND_SIGN RELEASE_DATE DEV_CM
1165  936  
1166  937  maketype="distributed"
1167  938  if [[ -z "$MAKE" ]]; then
1168  939          MAKE=dmake
1169  940  elif [[ ! -x "$MAKE" ]]; then
1170  941          echo "\$MAKE is set to garbage in the environment"
1171  942          exit 1  
1172  943  fi
1173  944  # get the dmake version string alone
1174  945  DMAKE_VERSION=$( $MAKE -v )
↓ open down ↓ 14 lines elided ↑ open up ↑
1189  960       "$DMAKE_MAJOR" -lt 7 -o \
1190  961       "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
1191  962          if [ -z "$DMAKE_VERSION" ]; then
1192  963                  echo "$MAKE is missing."
1193  964                  exit 1
1194  965          fi
1195  966          echo `whence $MAKE`" version is:"
1196  967          echo "  ${DMAKE_VERSION}"
1197  968          cat <<EOF
1198  969  
1199      -This version may not be safe for use.  Either set TEAMWARE to a better
1200      -path or (if you really want to use this version of dmake anyway), add
1201      -the following to your environment to disable this check:
      970 +This version may not be safe for use, if you really want to use this version
      971 +anyway add the following to your environment to disable this check:
1202  972  
1203  973    CHECK_DMAKE=n
1204  974  EOF
1205  975          exit 1
1206  976  fi
1207  977  export PATH
1208  978  export MAKE
1209  979  
1210  980  if [ "${SUNWSPRO}" != "" ]; then
1211  981          PATH="${SUNWSPRO}/bin:$PATH"
↓ open down ↓ 30 lines elided ↑ open up ↑
1242 1012          exit 1
1243 1013  fi
1244 1014  
1245 1015  #
1246 1016  # if -V flag was given, reset VERSION to V_ARG
1247 1017  #
1248 1018  if [ "$V_FLAG" = "y" ]; then
1249 1019          VERSION=$V_ARG
1250 1020  fi
1251 1021  
1252      -#
1253      -# Check for IHV root for copying ihv proto area
1254      -#
1255      -if [ "$X_FLAG" = "y" ]; then
1256      -        if [ "$IA32_IHV_ROOT" = "" ]; then
1257      -                echo "IA32_IHV_ROOT: must be set for copying ihv proto"
1258      -                args_ok=n
1259      -        fi
1260      -        if [ ! -d "$IA32_IHV_ROOT" ]; then
1261      -                echo "$IA32_IHV_ROOT: not found"
1262      -                args_ok=n
1263      -        fi
1264      -        if [ "$IA32_IHV_WS" = "" ]; then
1265      -                echo "IA32_IHV_WS: must be set for copying ihv proto"
1266      -                args_ok=n
1267      -        fi
1268      -        if [ ! -d "$IA32_IHV_WS" ]; then
1269      -                echo "$IA32_IHV_WS: not found"
1270      -                args_ok=n
1271      -        fi
1272      -fi
1273      -
1274 1022  TMPDIR="/tmp/nightly.tmpdir.$$"
1275 1023  export TMPDIR
1276 1024  rm -rf ${TMPDIR}
1277 1025  mkdir -p $TMPDIR || exit 1
1278 1026  chmod 777 $TMPDIR
1279 1027  
1280 1028  #
1281 1029  # Keep elfsign's use of pkcs11_softtoken from looking in the user home
1282 1030  # directory, which doesn't always work.   Needed until all build machines
1283 1031  # have the fix for 6271754
↓ open down ↓ 53 lines elided ↑ open up ↑
1337 1085  ENVCPPFLAGS1=
1338 1086  ENVCPPFLAGS2=
1339 1087  ENVCPPFLAGS3=
1340 1088  ENVCPPFLAGS4=
1341 1089  PARENT_ROOT=
1342 1090  
1343 1091  export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
1344 1092          ENVLDLIBS1 ENVLDLIBS2 PARENT_ROOT
1345 1093  
1346 1094  PKGARCHIVE_ORIG=$PKGARCHIVE
1347      -IA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS
1348 1095  
1349 1096  #
1350 1097  # Juggle the logs and optionally send mail on completion.
1351 1098  #
1352 1099  
1353 1100  function logshuffle {
1354 1101          LLOG="$ATLOG/log.`date '+%F.%H:%M'`"
1355 1102          if [ -f $LLOG -o -d $LLOG ]; then
1356 1103                  LLOG=$LLOG.$$
1357 1104          fi
↓ open down ↓ 212 lines elided ↑ open up ↑
1570 1317  exec </dev/null >$build_noise_file 2>&1
1571 1318  
1572 1319  run_hook SYS_PRE_NIGHTLY
1573 1320  run_hook PRE_NIGHTLY
1574 1321  
1575 1322  echo "\n==== list of environment variables ====\n" >> $LOGFILE
1576 1323  env >> $LOGFILE
1577 1324  
1578 1325  echo "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
1579 1326  
1580      -if [ "$P_FLAG" = "y" ]; then
1581      -        obsolete_build GPROF | tee -a $mail_msg_file >> $LOGFILE
1582      -fi
1583      -
1584      -if [ "$T_FLAG" = "y" ]; then
1585      -        obsolete_build TRACE | tee -a $mail_msg_file >> $LOGFILE
1586      -fi
1587      -
1588 1327  if [ "$N_FLAG" = "y" ]; then
1589 1328          if [ "$p_FLAG" = "y" ]; then
1590 1329                  cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1591 1330  WARNING: the p option (create packages) is set, but so is the N option (do
1592 1331           not run protocmp); this is dangerous; you should unset the N option
1593 1332  EOF
1594 1333          else
1595 1334                  cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1596 1335  Warning: the N option (do not run protocmp) is set; it probably shouldn't be
1597 1336  EOF
↓ open down ↓ 88 lines elided ↑ open up ↑
1686 1425  # Echo the SCM type of the parent workspace, this can't just be which_scm
1687 1426  # as that does not know how to identify various network repositories.
1688 1427  #
1689 1428  function parent_wstype {
1690 1429          typeset scm_type junk
1691 1430  
1692 1431          CODEMGR_WS="$BRINGOVER_WS" "$WHICH_SCM" 2>/dev/null \
1693 1432              | read scm_type junk
1694 1433          if [[ -z "$scm_type" || "$scm_type" == unknown ]]; then
1695 1434                  # Probe BRINGOVER_WS to determine its type
1696      -                if [[ $BRINGOVER_WS == svn*://* ]]; then
1697      -                        scm_type="subversion"
1698      -                elif [[ $BRINGOVER_WS == file://* ]] &&
1699      -                    egrep -s "This is a Subversion repository" \
1700      -                    ${BRINGOVER_WS#file://}/README.txt 2> /dev/null; then
1701      -                        scm_type="subversion"
1702      -                elif [[ $BRINGOVER_WS == ssh://* ]]; then
     1435 +                if [[ $BRINGOVER_WS == ssh://* ]]; then
1703 1436                          scm_type="mercurial"
1704 1437                  elif [[ $BRINGOVER_WS == http://* ]] && \
1705 1438                      wget -q -O- --save-headers "$BRINGOVER_WS/?cmd=heads" | \
1706 1439                      egrep -s "application/mercurial" 2> /dev/null; then
1707 1440                          scm_type="mercurial"
1708      -                elif svn info $BRINGOVER_WS > /dev/null 2>&1; then
1709      -                        scm_type="subversion"
1710 1441                  else
1711 1442                          scm_type="none"
1712 1443                  fi
1713 1444          fi    
1714 1445  
1715 1446          # fold both unsupported and unrecognized results into "none"
1716 1447          case "$scm_type" in
1717      -        none|subversion|teamware|mercurial)
     1448 +        mercurial)
1718 1449                  ;;
1719 1450          *)      scm_type=none
1720 1451                  ;;
1721 1452          esac
1722 1453  
1723 1454          echo $scm_type
1724 1455  }
1725 1456  
1726 1457  # Echo the SCM types of $CODEMGR_WS and $BRINGOVER_WS
1727 1458  function child_wstype {
1728 1459          typeset scm_type junk
1729 1460  
1730 1461          # Probe CODEMGR_WS to determine its type
1731 1462          if [[ -d $CODEMGR_WS ]]; then
1732 1463                  $WHICH_SCM | read scm_type junk || exit 1
1733 1464          fi
1734 1465  
1735 1466          case "$scm_type" in
1736      -        none|subversion|git|teamware|mercurial)
     1467 +        none|git|mercurial)
1737 1468                  ;;
1738 1469          *)      scm_type=none
1739 1470                  ;;
1740 1471          esac
1741 1472  
1742 1473          echo $scm_type
1743 1474  }
1744 1475  
1745 1476  SCM_TYPE=$(child_wstype)
1746 1477  
↓ open down ↓ 47 lines elided ↑ open up ↑
1794 1525          cd $SRC
1795 1526          find $relsrcdirs \( -name SCCS -o -name .hg -o -name .svn \
1796 1527              -o -name .git -o -name 'interfaces.*' \) -prune -o \
1797 1528              \( -name '.make.*' -o -name 'lib*.a' -o -name 'lib*.so*' -o \
1798 1529                 -name '*.o' \) -print | \
1799 1530              grep -v 'tools/ctf/dwarf/.*/libdwarf' | xargs rm -f
1800 1531  else
1801 1532          echo "\n==== No clobber at `date` ====\n" >> $LOGFILE
1802 1533  fi
1803 1534  
1804      -type bringover_teamware > /dev/null 2>&1 || function bringover_teamware {
1805      -        # sleep on the parent workspace's lock
1806      -        while egrep -s write $BRINGOVER_WS/Codemgr_wsdata/locks
1807      -        do
1808      -                sleep 120
1809      -        done
1810      -
1811      -        if [[ -z $BRINGOVER ]]; then
1812      -                BRINGOVER=$TEAMWARE/bin/bringover
1813      -        fi
1814      -
1815      -        staffer $BRINGOVER -c "nightly update" -p $BRINGOVER_WS \
1816      -            -w $CODEMGR_WS $BRINGOVER_FILES < /dev/null 2>&1 ||
1817      -                touch $TMPDIR/bringover_failed
1818      -
1819      -        staffer bringovercheck $CODEMGR_WS >$TMPDIR/bringovercheck.out 2>&1
1820      -        if [ -s $TMPDIR/bringovercheck.out ]; then
1821      -                echo "\n==== POST-BRINGOVER CLEANUP NOISE ====\n"
1822      -                cat $TMPDIR/bringovercheck.out
1823      -        fi
1824      -}
1825      -
1826 1535  type bringover_mercurial > /dev/null 2>&1 || function bringover_mercurial {
1827 1536          typeset -x PATH=$PATH
1828 1537  
1829 1538          # If the repository doesn't exist yet, then we want to populate it.
1830 1539          if [[ ! -d $CODEMGR_WS/.hg ]]; then
1831 1540                  staffer hg init $CODEMGR_WS
1832 1541                  staffer echo "[paths]" > $CODEMGR_WS/.hg/hgrc
1833 1542                  staffer echo "default=$BRINGOVER_WS" >> $CODEMGR_WS/.hg/hgrc
1834 1543                  touch $TMPDIR/new_repository
1835 1544          fi
↓ open down ↓ 98 lines elided ↑ open up ↑
1934 1643          #
1935 1644          # Per-changeset output is neither useful nor manageable for a
1936 1645          # newly-created repository.
1937 1646          #
1938 1647          if [ -f $TMPDIR/new_repository ]; then
1939 1648                  return
1940 1649          fi
1941 1650  
1942 1651          printf "\nadded the following changesets to open repository:\n"
1943 1652          cat $TMPDIR/incoming_open.out
1944      -
1945      -        #
1946      -        # The closed repository could have been newly created, even though
1947      -        # the open one previously existed...
1948      -        #
1949      -        if [ -f $TMPDIR/new_closed ]; then
1950      -                return
1951      -        fi
1952      -
1953      -        if [ -f $TMPDIR/incoming_closed.out ]; then
1954      -                printf "\nadded the following changesets to closed repository:\n"
1955      -                cat $TMPDIR/incoming_closed.out
1956      -        fi
1957      -}
1958      -
1959      -type bringover_subversion > /dev/null 2>&1 || function bringover_subversion {
1960      -        typeset -x PATH=$PATH
1961      -
1962      -        if [[ ! -d $CODEMGR_WS/.svn ]]; then
1963      -                staffer svn checkout $BRINGOVER_WS $CODEMGR_WS ||
1964      -                        touch $TMPDIR/bringover_failed
1965      -        else
1966      -                typeset root
1967      -                root=$(staffer svn info $CODEMGR_WS |
1968      -                        nawk '/^Repository Root:/ {print $NF}')
1969      -                if [[ $root != $BRINGOVER_WS ]]; then
1970      -                        # We fail here because there's no way to update
1971      -                        # from a named repo.
1972      -                        cat <<-EOF
1973      -                        \$BRINGOVER_WS doesn't match repository root:
1974      -                          \$BRINGOVER_WS:  $BRINGOVER_WS
1975      -                          Repository root: $root
1976      -                        EOF
1977      -                        touch $TMPDIR/bringover_failed
1978      -                else
1979      -                        # If a conflict happens, svn still exits 0.
1980      -                        staffer svn update $CODEMGR_WS | tee $TMPDIR/pull.out ||
1981      -                                touch $TMPDIR/bringover_failed
1982      -                        if grep "^C" $TMPDIR/pull.out > /dev/null 2>&1; then
1983      -                                touch $TMPDIR/bringover_failed
1984      -                        fi
1985      -                fi
1986      -        fi
1987 1653  }
1988 1654  
1989 1655  type bringover_none > /dev/null 2>&1 || function bringover_none {
1990 1656          echo "Couldn't figure out what kind of SCM to use for $BRINGOVER_WS."
1991 1657          touch $TMPDIR/bringover_failed
1992 1658  }
1993 1659  
1994 1660  #
1995 1661  #       Decide whether to bringover to the codemgr workspace
1996 1662  #
↓ open down ↓ 24 lines elided ↑ open up ↑
2021 1687  
2022 1688          #
2023 1689          # It's possible that we used the bringover above to create
2024 1690          # $CODEMGR_WS.  If so, then SCM_TYPE was previously "none,"
2025 1691          # but should now be the same as $BRINGOVER_WS.
2026 1692          #
2027 1693          [[ $SCM_TYPE = none ]] && SCM_TYPE=$PARENT_SCM_TYPE
2028 1694  
2029 1695          run_hook POST_BRINGOVER
2030 1696  
2031      -        check_closed_tree
     1697 +        check_closed_bins
2032 1698  
2033 1699  else
2034 1700          echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
2035 1701  fi
2036 1702  
2037 1703  # Safeguards
2038 1704  [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
2039 1705  [[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
2040 1706  [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
2041 1707  
↓ open down ↓ 68 lines elided ↑ open up ↑
2110 1776  #
2111 1777  if [[ "$t_FLAG" = "y" ]]; then
2112 1778          set_non_debug_build_flags
2113 1779  
2114 1780          build_tools ${TOOLS_PROTO}
2115 1781          if [[ $? != 0  && "$t_FLAG" = y ]]; then
2116 1782                  use_tools $TOOLS_PROTO
2117 1783          fi
2118 1784  fi
2119 1785  
2120      -#
2121      -# copy ihv proto area in addition to the build itself
2122      -#
2123      -if [ "$X_FLAG" = "y" ]; then
2124      -        copy_ihv_proto
2125      -fi
2126      -
2127 1786  # timestamp the start of the normal build; the findunref tool uses it.
2128 1787  touch $SRC/.build.tstamp
2129 1788  
2130 1789  normal_build
2131 1790  
2132 1791  ORIG_SRC=$SRC
2133 1792  BINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
2134 1793  
2135 1794  
2136 1795  #
↓ open down ↓ 11 lines elided ↑ open up ↑
2148 1807          echo "\n==== Creating protolist system file at `date` ====" \
2149 1808                  >> $LOGFILE
2150 1809          protolist $checkroot > $ATLOG/proto_list_${MACH}
2151 1810          echo "==== protolist system file created at `date` ====\n" \
2152 1811                  >> $LOGFILE
2153 1812  
2154 1813          if [ "$N_FLAG" != "y" ]; then
2155 1814  
2156 1815                  E1=
2157 1816                  f1=
2158      -                if [ -d "$SRC/pkgdefs" ]; then
2159      -                        f1="$SRC/pkgdefs/etc/exception_list_$MACH"
2160      -                        if [ "$X_FLAG" = "y" ]; then
2161      -                                f1="$f1 $IA32_IHV_WS/usr/src/pkgdefs/etc/exception_list_$MACH"
2162      -                        fi
2163      -                fi
2164      -
2165 1817                  for f in $f1; do
2166 1818                          if [ -f "$f" ]; then
2167 1819                                  E1="$E1 -e $f"
2168 1820                          fi
2169 1821                  done
2170 1822  
2171 1823                  E2=
2172 1824                  f2=
2173 1825                  if [ -d "$SRC/pkg" ]; then
2174 1826                          f2="$f2 exceptions/packaging"
2175 1827                  fi
2176 1828  
2177 1829                  for f in $f2; do
2178 1830                          if [ -f "$f" ]; then
2179 1831                                  E2="$E2 -e $f"
2180 1832                          fi
2181 1833                  done
2182      -
2183      -                if [ -f "$REF_PROTO_LIST" ]; then
2184      -                        #
2185      -                        # For builds that copy the IHV proto area (-X), add the
2186      -                        # IHV proto list to the reference list if the reference
2187      -                        # was built without -X.
2188      -                        #
2189      -                        # For builds that don't copy the IHV proto area, add the
2190      -                        # IHV proto list to the build's proto list if the
2191      -                        # reference was built with -X.
2192      -                        #
2193      -                        # Use the presence of the first file entry of the cached
2194      -                        # IHV proto list in the reference list to determine
2195      -                        # whether it was built with -X or not.
2196      -                        #
2197      -                        IHV_REF_PROTO_LIST=$SRC/pkg/proto_list_ihv_$MACH
2198      -                        grepfor=$(nawk '$1 == "f" { print $2; exit }' \
2199      -                                $IHV_REF_PROTO_LIST 2> /dev/null)
2200      -                        if [ $? = 0 -a -n "$grepfor" ]; then
2201      -                                if [ "$X_FLAG" = "y" ]; then
2202      -                                        grep -w "$grepfor" \
2203      -                                                $REF_PROTO_LIST > /dev/null
2204      -                                        if [ ! "$?" = "0" ]; then
2205      -                                                REF_IHV_PROTO="-d $IHV_REF_PROTO_LIST"
2206      -                                        fi
2207      -                                else
2208      -                                        grep -w "$grepfor" \
2209      -                                                $REF_PROTO_LIST > /dev/null
2210      -                                        if [ "$?" = "0" ]; then
2211      -                                                IHV_PROTO_LIST="$IHV_REF_PROTO_LIST"
2212      -                                        fi
2213      -                                fi
2214      -                        fi
2215      -                fi
2216      -        fi
2217      -
2218      -        if [ "$N_FLAG" != "y" -a -f $SRC/pkgdefs/Makefile ]; then
2219      -                echo "\n==== Impact on SVr4 packages ====\n" >> $mail_msg_file
2220      -                #
2221      -                # Compare the build's proto list with current package
2222      -                # definitions to audit the quality of package
2223      -                # definitions and makefile install targets. Use the
2224      -                # current exception list.
2225      -                #
2226      -                PKGDEFS_LIST=""
2227      -                for d in $abssrcdirs; do
2228      -                        if [ -d $d/pkgdefs ]; then
2229      -                                PKGDEFS_LIST="$PKGDEFS_LIST -d $d/pkgdefs"
2230      -                        fi
2231      -                done
2232      -                if [ "$X_FLAG" = "y" -a \
2233      -                    -d $IA32_IHV_WS/usr/src/pkgdefs ]; then
2234      -                        PKGDEFS_LIST="$PKGDEFS_LIST -d $IA32_IHV_WS/usr/src/pkgdefs"
2235      -                fi
2236      -                $PROTOCMPTERSE \
2237      -                    "Files missing from the proto area:" \
2238      -                    "Files missing from packages:" \
2239      -                    "Inconsistencies between pkgdefs and proto area:" \
2240      -                    ${E1} \
2241      -                    ${PKGDEFS_LIST} \
2242      -                    $ATLOG/proto_list_${MACH} \
2243      -                    >> $mail_msg_file
2244 1834          fi
2245 1835  
2246 1836          if [ "$N_FLAG" != "y" -a -d $SRC/pkg ]; then
2247 1837                  echo "\n==== Validating manifests against proto area ====\n" \
2248 1838                      >> $mail_msg_file
2249 1839                  ( cd $SRC/pkg ; $MAKE -e protocmp ROOT="$checkroot" ) \
2250 1840                      >> $mail_msg_file
2251 1841  
2252 1842          fi
2253 1843  
↓ open down ↓ 3 lines elided ↑ open up ↑
2257 1847                          ELIST=$E2
2258 1848                  else
2259 1849                          ELIST=$E1
2260 1850                  fi
2261 1851                  $PROTOCMPTERSE \
2262 1852                          "Files in yesterday's proto area, but not today's:" \
2263 1853                          "Files in today's proto area, but not yesterday's:" \
2264 1854                          "Files that changed between yesterday and today:" \
2265 1855                          ${ELIST} \
2266 1856                          -d $REF_PROTO_LIST \
2267      -                        $REF_IHV_PROTO \
2268 1857                          $ATLOG/proto_list_${MACH} \
2269      -                        $IHV_PROTO_LIST \
2270 1858                          >> $mail_msg_file
2271 1859          fi
2272 1860  fi
2273 1861  
2274 1862  if [ "$u_FLAG" = "y"  -a "$build_ok" = "y" ]; then
2275 1863          staffer cp $ATLOG/proto_list_${MACH} \
2276 1864                  $PARENT_WS/usr/src/proto_list_${MACH}
2277 1865  fi
2278 1866  
2279 1867  # Update parent proto area if necessary. This is done now
↓ open down ↓ 215 lines elided ↑ open up ↑
2495 2083              ${TOOLS}/findunref/exception_list 2>> $mail_msg_file | \
2496 2084              sort > $SRC/unref-${MACH}.out
2497 2085  
2498 2086          if [ ! -f $SRC/unref-${MACH}.ref ]; then
2499 2087                  cp $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
2500 2088          fi
2501 2089  
2502 2090          diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
2503 2091  fi
2504 2092  
2505      -#
2506      -# Generate the OpenSolaris deliverables if requested.  Some of these
2507      -# steps need to come after findunref and are commented below.
2508      -#
2509      -
2510 2093  # Verify that the usual lists of files, such as exception lists,
2511 2094  # contain only valid references to files.  If the build has failed,
2512 2095  # then don't check the proto area.
2513 2096  CHECK_PATHS=${CHECK_PATHS:-y}
2514 2097  if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
2515 2098          echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
2516 2099                  >>$mail_msg_file
2517 2100          arg=-b
2518 2101          [ "$build_ok" = y ] && arg=
2519 2102          checkpaths $arg $checkroot 2>&1 | tee -a $LOGFILE >>$mail_msg_file
2520 2103  fi
2521 2104  
2522 2105  if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
2523 2106          echo "\n==== Impact on file permissions ====\n" \
2524 2107                  >> $mail_msg_file
2525 2108  
2526      -        abspkgdefs=
2527 2109          abspkg=
2528 2110          for d in $abssrcdirs; do
2529      -                if [ -d "$d/pkgdefs" ]; then
2530      -                        abspkgdefs="$abspkgdefs $d"
2531      -                fi
2532 2111                  if [ -d "$d/pkg" ]; then
2533 2112                          abspkg="$abspkg $d"
2534 2113                  fi
2535 2114          done
2536 2115  
2537      -        if [ -n "$abspkgdefs" ]; then
2538      -                pmodes -qvdP \
2539      -                    `find $abspkgdefs -name pkginfo.tmpl -print -o \
2540      -                    -name .del\* -prune | sed -e 's:/pkginfo.tmpl$::' | \
2541      -                    sort -u` >> $mail_msg_file
2542      -        fi
2543      -
2544 2116          if [ -n "$abspkg" ]; then
2545 2117                  for d in "$abspkg"; do
2546 2118                          ( cd $d/pkg ; $MAKE -e pmodes ) >> $mail_msg_file
2547 2119                  done
2548 2120          fi
2549 2121  fi
2550 2122  
2551 2123  if [ "$w_FLAG" = "y" -a "$build_ok" = "y" ]; then
2552 2124          if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2553 2125                  do_wsdiff DEBUG $ROOT.prev $ROOT
↓ open down ↓ 63 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX