Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/scripts/checkpaths.sh
+++ new/usr/src/tools/scripts/checkpaths.sh
1 1 #!/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28 # Quis custodiet ipsos custodies?
29 29
30 30 if [ -z "$SRC" ]; then
31 31 SRC=$CODEMGR_WS/usr/src
32 32 fi
33 33
34 34 if [ -z "$CODEMGR_WS" -o ! -d "$CODEMGR_WS" -o ! -d "$SRC" ]; then
35 35 echo "$0: must be run from within a workspace."
36 36 exit 1
37 37 fi
38 38
39 39 cd $CODEMGR_WS || exit 1
40 40
41 41 # Use -b to tell this script to ignore derived (built) objects.
42 42 if [ "$1" = "-b" ]; then
43 43 b_flg=y
44 44 fi
45 45
46 46 # Not currently used; available for temporary workarounds.
47 47 args="-k NEVER_CHECK"
48 48
49 49 # We intentionally don't depend on $MACH here, and thus no $ROOT. If
50 50 # a proto area exists, then we use it. This allows this script to be
51 51 # run against gates (which should contain both SPARC and x86 proto
52 52 # areas), build workspaces (which should contain just one proto area),
53 53 # and unbuilt workspaces (which contain no proto areas).
54 54 if [ "$b_flg" = y ]; then
55 55 rootlist=
56 56 elif [ $# -gt 0 ]; then
57 57 rootlist=$*
58 58 else
59 59 rootlist="$CODEMGR_WS/proto/root_sparc $CODEMGR_WS/proto/root_i386"
60 60 fi
61 61
62 62 # If the closed source is not present, then exclude IKE from validation.
63 63 if [ "$CLOSED_IS_PRESENT" = no ]; then
64 64 excl="-e ^usr/include/ike/"
65 65 fi
66 66
67 67 for ROOT in $rootlist
68 68 do
69 69 case "$ROOT" in
70 70 *sparc|*sparc-nd)
71 71 arch=sparc
72 72 ;;
73 73 *i386|*i386-nd)
74 74 arch=i386
75 75 ;;
76 76 *)
77 77 echo "$ROOT has unknown architecture." >&2
78 78 exit 1
79 79 ;;
80 80 esac
81 81 if [ -d $ROOT ]; then
82 82 #
83 83 # This is the old-style packaging exception list, from
84 84 # the svr4-specific usr/src/pkgdefs
85 85 #
↓ open down ↓ |
85 lines elided |
↑ open up ↑ |
86 86 [ -f $SRC/pkgdefs/etc/exception_list_$arch ] && \
87 87 validate_paths '-s/\s*'$arch'$//' $excl -b $ROOT \
88 88 $args $SRC/pkgdefs/etc/exception_list_$arch
89 89 #
90 90 # These are the new-style packaging exception lists,
91 91 # from the repository-wide exception_lists/ directory.
92 92 #
93 93 e="$CODEMGR_WS/exception_lists/packaging"
94 94 for f in $e; do
95 95 if [ -f $f ]; then
96 - nawk 'NF == 1 || /[ ]\+'$arch'$/ { print; }' \
96 + /usr/xpg4/bin/awk 'NF == 1 || /[ ]\+'$arch'$/ { print; }' \
97 97 < $f | validate_paths -b $ROOT -n $f
98 98 fi
99 99 done
100 100 fi
101 101 done
102 102
103 103 # Two entries in the findunref exception_list deal with things created
104 104 # by nightly. Otherwise, this test could be run on an unmodifed (and
105 105 # unbuilt) workspace. We handle this by flagging the one that is
106 106 # present only on a built workspace (./*.out) and the one that's
107 107 # present only after a run of findunref (./*.ref) with ISUSED, and
108 108 # disabling all checks of them. The assumption is that the entries
109 109 # marked with ISUSED are always known to be good, thus the Latin quote
110 110 # at the top of the file.
111 111 #
112 112 # The exception_list is generated from whichever input files are appropriate
113 113 # for this workspace, so checking it obviates the need to check the inputs.
114 114
115 115 if [ -r $SRC/tools/findunref/exception_list ]; then
116 116 validate_paths -k ISUSED -r -e '^\*' $SRC/tools/findunref/exception_list
117 117 fi
118 118
119 119 # These are straightforward.
120 120 if [ -d $SRC/xmod ]; then
121 121 # If the closed source is not present, then don't validate it.
122 122 if [ "$CLOSED_IS_PRESENT" = no ]; then
123 123 excl_cry="-e ^usr/closed"
124 124 excl_xmod="-e ^../closed"
125 125 fi
126 126 validate_paths $excl_cry $SRC/xmod/cry_files
127 127 validate_paths $excl_xmod -b $SRC $SRC/xmod/xmod_files
128 128 fi
129 129
130 130 if [ -f $SRC/tools/opensolaris/license-list ]; then
131 131 excl=
132 132 if [ "$CLOSED_IS_PRESENT" = no ]; then
133 133 excl="-e ^usr/closed"
134 134 fi
135 135 sed -e 's/$/.descrip/' < $SRC/tools/opensolaris/license-list | \
136 136 validate_paths -n SRC/tools/opensolaris/license-list $excl
137 137 fi
138 138
139 139 # Finally, make sure the that (req|inc).flg files are in good shape.
140 140 # If SCCS files are not expected to be present, though, then don't
141 141 # check them.
142 142 if [ ! -d "$CODEMGR_WS/Codemgr_wsdata" ]; then
143 143 f_flg='-f'
144 144 fi
145 145 # If the closed source is not present, then don't validate it.
146 146 if [ "$CLOSED_IS_PRESENT" = no ]; then
147 147 excl="-e ^usr/closed/"
148 148 fi
149 149
150 150 validate_flg $f_flg $excl
151 151
152 152 exit 0
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX