Print this page
allow webrev to be run directly from usr/src/tools/scripts/webrev

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/webrev.sh
          +++ new/usr/src/tools/scripts/webrev.sh
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24   24  # Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  25   25  #
  26   26  
  27   27  # Copyright 2008, 2010, Richard Lowe
  28   28  # Copyright 2012 Marcel Telka <marcel@telka.sk>
       29 +# Copyright 2013 PALO, Richard. All rights reserved.
  29   30  
  30   31  #
  31   32  # This script takes a file list and a workspace and builds a set of html files
  32   33  # suitable for doing a code review of source changes via a web page.
  33   34  # Documentation is available via the manual page, webrev.1, or just
  34   35  # type 'webrev -h'.
  35   36  #
  36   37  # Acknowledgements to contributors to webrev are listed in the webrev(1)
  37   38  # man page.
  38   39  #
↓ open down ↓ 2892 lines elided ↑ open up ↑
2931 2932  # DO_EVERYTHING: break point
2932 2933  if [[ -n $Nflag ]]; then
2933 2934          break
2934 2935  fi
2935 2936  
2936 2937  typeset -A itsinfo
2937 2938  typeset -r its_sed_script=/tmp/$$.its_sed
2938 2939  valid_prefixes=
2939 2940  if [[ -z $nflag ]]; then
2940 2941          DEFREGFILE="$(/bin/dirname "$(whence $0)")/../etc/its.reg"
     2942 +        DEFREGFILE0="$(/bin/dirname "$(whence $0)")/its.reg"
2941 2943          if [[ -n $Iflag ]]; then
2942 2944                  REGFILE=$ITSREG
2943 2945          elif [[ -r $HOME/.its.reg ]]; then
2944 2946                  REGFILE=$HOME/.its.reg
2945      -        else
     2947 +        elif [[ -r $DEFREGFILE ]]; then
2946 2948                  REGFILE=$DEFREGFILE
     2949 +        else
     2950 +                REGFILE=$DEFREGFILE0
2947 2951          fi
2948 2952          if [[ ! -r $REGFILE ]]; then
2949 2953                  print "ERROR: Unable to read database registry file $REGFILE"
2950 2954                  exit 1
2951 2955          elif [[ $REGFILE != $DEFREGFILE ]]; then
2952 2956                  print "   its.reg from: $REGFILE"
2953 2957          fi
2954 2958  
2955 2959          $SED -e '/^#/d' -e '/^[         ]*$/d' $REGFILE | while read LINE; do
2956 2960  
↓ open down ↓ 3 lines elided ↑ open up ↑
2960 2964                  if [[ $name == PREFIX ]]; then
2961 2965                          p=${value}
2962 2966                          valid_prefixes="${p} ${valid_prefixes}"
2963 2967                  else
2964 2968                          itsinfo["${p}_${name}"]="${value}"
2965 2969                  fi
2966 2970          done
2967 2971  
2968 2972  
2969 2973          DEFCONFFILE="$(/bin/dirname "$(whence $0)")/../etc/its.conf"
2970      -        CONFFILES=$DEFCONFFILE
     2974 +        DEFCONFFILE0="$(/bin/dirname "$(whence $0)")/its.conf"
     2975 +        if [[ -r $DEFCONFFILE ]]; then
     2976 +                CONFFILES=$DEFCONFFILE
     2977 +        else
     2978 +                CONFFILES=$DEFCONFFILE0
     2979 +        fi
2971 2980          if [[ -r $HOME/.its.conf ]]; then
2972 2981                  CONFFILES="${CONFFILES} $HOME/.its.conf"
2973 2982          fi
2974 2983          if [[ -n $Cflag ]]; then
2975 2984                  CONFFILES="${CONFFILES} ${ITSCONF}"
2976 2985          fi
2977 2986          its_domain=
2978 2987          its_priority=
2979 2988          for cf in ${CONFFILES}; do
2980 2989                  if [[ ! -r $cf ]]; then
↓ open down ↓ 772 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX