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 "Oct 30, 2012"
  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|\fBgit\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.
  54 .LP
  55 To limit checks to files managed by Mercurial, the \fBhg\fP(1) utility must be
  56 present in \fB$PATH\fP and any relevant repositories must be located at or
  57 under \fIsrcroot\fP.  Nested Mercurial repositories are supported.
  58 .LP
  59 To limit checks to files managed by Git, the \fBgit\fP(1) utility must be
  60 present in \fB$PATH\fP and any relevant repositories must be located at or
  61 under \fIsrcroot\fP.  Nested Git repositories are \fInot\fR supported.
  62 .SH OPTIONS
  63 .TP 10
  64 .B -s \fIsubtree\fP
  65 Only look under \fIsubtree\fP for unreferenced files.  By default, all
  66 directories under \fIsrcroot\fP are examined.
  67 .TP 10
  68 .B -t \fItstampfile\fP
  69 Consider files older than \fItstampfile\fP to be unreferenced.
  70 By default, \fIsrcroot\fB/.build.tstamp\fR is used.
  71 .TP 10
  72 .B -S \fBhg\fP|\fBtw\fP|\fBgit\fP
  73 Only check files that are managed by the specified SCM.  To simplify
  74 interaction with \fBwhich_scm\fP(1), the SCM names "mercurial" and
  75 "teamware" may also be specified for "hg" and "tw", respectively.
  76 By default, all files are checked.
  77 .SH SEE ALSO
  78 .LP
  79 \fBgit\fP(1),
  80 \fBhg\fP(1),
  81 \fBnightly\fP(1),
  82 \fBwhich_scm\fP(1)
  83 .SH NOTES
  84 Since many files are only used when building for a particular ISA (e.g.,
  85 Makefiles that are specific to x86 or SPARC), builds must be done on all
  86 applicable ISAs and the results merged.  For instance, if nightly builds
  87 (with \fB-f\fP) are done on both SPARC and x86, \fBusr/src\fP will be
  88 populated with a corresponding \fBunref-\fIisa\fB.out\fR file, which can
  89 be merged with \fBcomm\fP(1):
  90 .LP
  91 .nf
  92 comm -12 /path/to/unref-i386.out
  93          /path/to/unref-sparc.out > unref.out
  94 .fi
  95 .LP
  96 This merged file can then be compared against the gate's latest
  97 unreferenced file list (e.g. \fB/ws/onnv-gate/usr/src/unrefmaster.out\fP).
  98 .LP
  99 Different gates have different unreferenced file policies.  Any changes to
 100 \fIexceptfile\fP that would define new unreferenced file policies for a
 101 given gate must be cleared with the appropriate gatekeepers.