Print this page
10063 basic support for smatch
10153 checkpaths shouldn't check packaging exceptions


   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License (the "License").
   7 # You may not use this file except in compliance with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 
  23 #
  24 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #

  27 
  28 # Quis custodiet ipsos custodies?
  29 
  30 if [ -z "$SRC" ]; then
  31         SRC=$CODEMGR_WS/usr/src
  32 fi
  33 
  34 if [ -z "$CODEMGR_WS" -o ! -d "$CODEMGR_WS" -o ! -d "$SRC" ]; then
  35         echo "$0: must be run from within a workspace."
  36         exit 1
  37 fi
  38 
  39 cd $CODEMGR_WS || exit 1
  40 
  41 # Use -b to tell this script to ignore derived (built) objects.
  42 if [ "$1" = "-b" ]; then
  43         b_flg=y
  44 fi
  45 
  46 # Not currently used; available for temporary workarounds.


  56 elif [ $# -gt 0 ]; then
  57         rootlist=$*
  58 else
  59         rootlist="$CODEMGR_WS/proto/root_sparc $CODEMGR_WS/proto/root_i386"
  60 fi
  61 
  62 for ROOT in $rootlist
  63 do
  64         case "$ROOT" in
  65         *sparc|*sparc-nd)
  66                 arch=sparc
  67                 ;;
  68         *i386|*i386-nd)
  69                 arch=i386
  70                 ;;
  71         *)
  72                 echo "$ROOT has unknown architecture." >&2
  73                 exit 1
  74                 ;;
  75         esac
  76         if [ -d $ROOT ]; then
  77                 #
  78                 # This is the old-style packaging exception list, from
  79                 # the svr4-specific usr/src/pkgdefs
  80                 #
  81                 [ -f $SRC/pkgdefs/etc/exception_list_$arch ] && \
  82                         validate_paths '-s/\s*'$arch'$//'  \
  83                             -e ^usr/include/ike/ -b $ROOT \
  84                             $args $SRC/pkgdefs/etc/exception_list_$arch
  85                 #
  86                 # These are the new-style packaging exception lists,
  87                 # from the repository-wide exception_lists/ directory.
  88                 #
  89                 e="$CODEMGR_WS/exception_lists/packaging"
  90                 for f in $e; do
  91                         if [ -f $f ]; then
  92                                 nawk 'NF == 1 || /[     ]\+'$arch'$/ { print; }' \
  93                                     < $f | validate_paths -b $ROOT -n $f
  94                         fi
  95                 done
  96         fi
  97 done
  98 
  99 # Two entries in the findunref exception_list deal with things created
 100 # by nightly.  Otherwise, this test could be run on an unmodifed (and
 101 # unbuilt) workspace.  We handle this by flagging the one that is
 102 # present only on a built workspace (./*.out) and the one that's
 103 # present only after a run of findunref (./*.ref) with ISUSED, and
 104 # disabling all checks of them.  The assumption is that the entries
 105 # marked with ISUSED are always known to be good, thus the Latin quote
 106 # at the top of the file.
 107 #
 108 # The exception_list is generated from whichever input files are appropriate
 109 # for this workspace, so checking it obviates the need to check the inputs.
 110 
 111 if [ -r $SRC/tools/findunref/exception_list ]; then
 112         validate_paths -k ISUSED -r -e '^\*' $SRC/tools/findunref/exception_list
 113 fi
 114 
 115 if [ -f $SRC/tools/opensolaris/license-list ]; then
 116         sed -e 's/$/.descrip/' < $SRC/tools/opensolaris/license-list | \


   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License (the "License").
   7 # You may not use this file except in compliance with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #


  22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 # Copyright (c) 2018, Joyent, Inc.
  26 
  27 # Quis custodiet ipsos custodies?
  28 
  29 if [ -z "$SRC" ]; then
  30         SRC=$CODEMGR_WS/usr/src
  31 fi
  32 
  33 if [ -z "$CODEMGR_WS" -o ! -d "$CODEMGR_WS" -o ! -d "$SRC" ]; then
  34         echo "$0: must be run from within a workspace."
  35         exit 1
  36 fi
  37 
  38 cd $CODEMGR_WS || exit 1
  39 
  40 # Use -b to tell this script to ignore derived (built) objects.
  41 if [ "$1" = "-b" ]; then
  42         b_flg=y
  43 fi
  44 
  45 # Not currently used; available for temporary workarounds.


  55 elif [ $# -gt 0 ]; then
  56         rootlist=$*
  57 else
  58         rootlist="$CODEMGR_WS/proto/root_sparc $CODEMGR_WS/proto/root_i386"
  59 fi
  60 
  61 for ROOT in $rootlist
  62 do
  63         case "$ROOT" in
  64         *sparc|*sparc-nd)
  65                 arch=sparc
  66                 ;;
  67         *i386|*i386-nd)
  68                 arch=i386
  69                 ;;
  70         *)
  71                 echo "$ROOT has unknown architecture." >&2
  72                 exit 1
  73                 ;;
  74         esac





















  75 done
  76 
  77 # Two entries in the findunref exception_list deal with things created
  78 # by nightly.  Otherwise, this test could be run on an unmodifed (and
  79 # unbuilt) workspace.  We handle this by flagging the one that is
  80 # present only on a built workspace (./*.out) and the one that's
  81 # present only after a run of findunref (./*.ref) with ISUSED, and
  82 # disabling all checks of them.  The assumption is that the entries
  83 # marked with ISUSED are always known to be good, thus the Latin quote
  84 # at the top of the file.
  85 #
  86 # The exception_list is generated from whichever input files are appropriate
  87 # for this workspace, so checking it obviates the need to check the inputs.
  88 
  89 if [ -r $SRC/tools/findunref/exception_list ]; then
  90         validate_paths -k ISUSED -r -e '^\*' $SRC/tools/findunref/exception_list
  91 fi
  92 
  93 if [ -f $SRC/tools/opensolaris/license-list ]; then
  94         sed -e 's/$/.descrip/' < $SRC/tools/opensolaris/license-list | \