1 .\" " CDDL HEADER START 2 .\" " 3 .\" " The contents of this file are subject to the terms of the 4 .\" " Common Development and Distribution License (the "License"). 5 .\" " You may not use this file except in compliance with the License. 6 .\" " 7 .\" " You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 8 .\" " or http://www.opensolaris.org/os/licensing. 9 .\" " See the License for the specific language governing permissions 10 .\" " and limitations under the License. 11 .\" " 12 .\" " When distributing Covered Code, include this CDDL HEADER in each 13 .\" " file and include the License file at usr/src/OPENSOLARIS.LICENSE. 14 .\" " If applicable, add the following below this CDDL HEADER, with the 15 .\" " fields enclosed by brackets "[]" replaced with your own identifying 16 .\" " information: Portions Copyright [yyyy] [name of copyright owner] 17 .\" " 18 .\" " CDDL HEADER END 19 .\" " 20 .\" "Copyright 2009 Sun Microsystems, Inc. All rights reserved. 21 .\" "Use is subject to license terms. 22 .TH findunref 1 "11 Aug 2009" 23 .I findunref 24 \- find unused files in a source tree 25 .SH SYNOPSIS 26 findunref [\fB-s\fP \fIsubtree\fP] [\fB-t\fP \fItstampfile\fP] 27 [\fB-S\fP \fBhg\fP|\fBtw\fP] \fIsrcroot\fP \fIexceptfile\fP 28 .LP 29 .SH DESCRIPTION 30 .IX "OS-Net build tools" "findunref" "" "\fBfindunref\fP" 31 .LP 32 The findunref utility lists the files in a source tree which have not been 33 accessed more recently than a particular timestamp file. Although 34 findunref may be used on its own, it is usually invoked by 35 \fBnightly\fP(1) to find files that are never referenced during a given 36 build (see \fB-f\fP in \fBnightly\fP(1)). 37 .LP 38 The root of the source tree to examine is specified by \fIsrcroot\fP. To 39 simplify comparing findunref output from different source trees, findunref 40 outputs all filenames relative to \fIsrcroot\fP. 41 .LP 42 Some files in a source tree may be intentionally unreferenced (e.g., 43 documentation) or only referenced during specialized types of builds. 44 Accordingly, \fIexceptfile\fP names a file containing a list of pathname 45 globs that will be ignored by findunref. Within \fIexceptfile\fP, any 46 lines consisting solely of whitespace or starting with \fB#\fP will be 47 ignored. Directory globs may also be specified, which will cause any 48 matching directories to be skipped entirely. If no exceptions are 49 desired, \fIexceptfile\fP can be \fB/dev/null\fP. 50 .LP 51 Depending on how findunref is invoked, it can either check all files, or 52 limit its checks to files under control of a specific source code 53 management (SCM) system. To limit checks to files managed by Mercurial, 54 the \fBhg\fP(1) utility must be present in \fB/usr/bin\fP and any relevant 55 repositories must be located at or under \fIsrcroot\fP. Nested Mercurial 56 repositories are supported. 57 .SH OPTIONS 58 .TP 10 59 .B -s \fIsubtree\fP 60 Only look under \fIsubtree\fP for unreferenced files. By default, all 61 directories under \fIsrcroot\fP are examined. 62 .TP 10 63 .B -t \fItstampfile\fP 64 Consider files older than \fItstampfile\fP to be unreferenced. 65 By default, \fIsrcroot\fB/.build.tstamp\fR is used. 66 .TP 10 67 .B -S \fBhg\fP|\fBtw\fP 68 Only check files that are managed by the specified SCM. To simplify 69 interaction with \fBwhich_scm\fP(1), the SCM names "mercurial" and 70 "teamware" may also be specified. By default, all files are checked. 71 .SH SEE ALSO 72 .LP 73 \fBhg\fP(1), 74 \fBnightly\fP(1), 75 \fBwhich_scm\fP(1) 76 .SH NOTES 77 Since many files are only used when building for a particular ISA (e.g., 78 Makefiles that are specific to x86 or SPARC), builds must be done on all 79 applicable ISAs and the results merged. For instance, if nightly builds 80 (with \fB-f\fP) are done on both SPARC and x86, \fBusr/src\fP will be 81 populated with a corresponding \fBunref-\fIisa\fB.out\fR file, which can 82 be merged with \fBcomm\fP(1): 83 .LP 84 .nf 85 comm -12 /path/to/unref-i386.out 86 /path/to/unref-sparc.out > unref.out 87 .fi 88 .LP 89 This merged file can then be compared against the gate's latest 90 unreferenced file list (e.g. \fB/ws/onnv-gate/usr/src/unrefmaster.out\fP). 91 .LP 92 Different gates have different unreferenced file policies. Any changes to 93 \fIexceptfile\fP that would define new unreferenced file policies for a 94 given gate must be cleared with the appropriate gatekeepers.