Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/webrev.sh
          +++ new/usr/src/tools/scripts/webrev.sh
↓ open down ↓ 1452 lines elided ↑ open up ↑
1453 1453  
1454 1454          if [[ -f $pfile ]]; then
1455 1455                  psid=$($SCCS prs -d:I: $pfile 2>/dev/null)
1456 1456          else
1457 1457                  psid=1.1
1458 1458          fi
1459 1459  
1460 1460          set -A sids $($SCCS prs -l -r$psid -d:I: $cfile 2>/dev/null)
1461 1461          N=${#sids[@]}
1462 1462  
1463      -        nawkprg='
     1463 +        awkprg='
1464 1464                  /^COMMENTS:/    {p=1; continue}
1465 1465                  /^D [0-9]+\.[0-9]+/ {printf "--- %s ---\n", $2; p=0; }
1466 1466                  NF == 0u        { continue }
1467 1467                  {if (p==0) continue; print $0 }'
1468 1468  
1469 1469          if [[ $N -ge 2 ]]; then
1470 1470                  sid1=${sids[$((N-2))]}  # Gets 2nd to last sid
1471 1471  
1472 1472                  if [[ $fmt == "text" ]]; then
1473 1473                          $SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
1474      -                            $AWK "$nawkprg"
     1474 +                            $AWK "$awkprg"
1475 1475                          return
1476 1476                  fi
1477 1477  
1478 1478                  $SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
1479      -                    html_quote | its2url | $AWK "$nawkprg"
     1479 +                    html_quote | its2url | $AWK "$awkprg"
1480 1480          fi
1481 1481  }
1482 1482  
1483 1483  #
1484 1484  # comments_from_wx {text|html} filepath
1485 1485  #
1486 1486  # Given the pathname of a file, find its location in a "wx" active
1487 1487  # file list and print the following comment.  Output is either text or
1488 1488  # HTML; if the latter, embedded bugids (sequence of 5 or more digits)
1489 1489  # are turned into URLs.
↓ open down ↓ 1302 lines elided ↑ open up ↑
2792 2792          # Parent can either be specified with -p, or specified with
2793 2793          # CODEMGR_PARENT in the environment.
2794 2794          #
2795 2795  
2796 2796          if [[ -z $codemgr_parent && -n $CODEMGR_PARENT ]]; then
2797 2797                  codemgr_parent=$CODEMGR_PARENT
2798 2798          fi
2799 2799  
2800 2800          # Try to figure out the parent based on the branch the current
2801 2801          # branch is tracking, if we fail, use origin/master
2802      -        this_branch=$($GIT branch | nawk '$1 == "*" { print $2 }')
     2802 +        this_branch=$($GIT branch | /usr/xpg4/bin/awk '$1 == "*" { print $2 }')
2803 2803          par_branch="origin/master"
2804 2804  
2805 2805          # If we're not on a branch there's nothing we can do
2806 2806          if [[ $this_branch != "(no branch)" ]]; then
2807 2807                  $GIT for-each-ref                                                 \
2808 2808                      --format='%(refname:short) %(upstream:short)' refs/heads/ |   \
2809 2809                      while read local remote; do                                   \
2810 2810                          [[ "$local" == "$this_branch" ]] && par_branch="$remote"; \
2811 2811                      done
2812 2812          fi
↓ open down ↓ 940 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX