Annotation of src/usr.bin/lndir/lndir.1, Revision 1.19
1.19 ! matthieu 1: .\" $OpenBSD: lndir.1,v 1.18 2003/06/03 21:09:02 deraadt Exp $
1.2 downsj 2: .\"
3: .\" Copyright (c) 1997, Jason Downs. All rights reserved.
4: .\"
5: .\" Redistribution and use in source and binary forms, with or without
6: .\" modification, are permitted provided that the following conditions
7: .\" are met:
8: .\" 1. Redistributions of source code must retain the above copyright
9: .\" notice, this list of conditions and the following disclaimer.
10: .\" 2. Redistributions in binary form must reproduce the above copyright
11: .\" notice, this list of conditions and the following disclaimer in the
12: .\" documentation and/or other materials provided with the distribution.
13: .\"
14: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
15: .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17: .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
18: .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19: .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20: .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21: .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24: .\" SUCH DAMAGE.
25: .\"
1.1 downsj 26: .\" $XConsortium: lndir.man /main/9 1995/12/15 14:00:35 gildea $
27: .\"
28: .\" Copyright (c) 1993, 1994 X Consortium
1.8 aaron 29: .\"
1.1 downsj 30: .\" Permission is hereby granted, free of charge, to any person obtaining
31: .\" a copy of this software and associated documentation files (the
32: .\" "Software"), to deal in the Software without restriction, including
33: .\" without limitation the rights to use, copy, modify, merge, publish,
34: .\" distribute, sublicense, and/or sell copies of the Software, and to
35: .\" permit persons to whom the Software is furnished to do so, subject to
36: .\" the following conditions:
1.8 aaron 37: .\"
1.1 downsj 38: .\" The above copyright notice and this permission notice shall be
39: .\" included in all copies or substantial portions of the Software.
1.8 aaron 40: .\"
1.1 downsj 41: .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
42: .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43: .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
44: .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
45: .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46: .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
47: .\" OTHER DEALINGS IN THE SOFTWARE.
1.8 aaron 48: .\"
1.1 downsj 49: .\" Except as contained in this notice, the name of the X Consortium shall
50: .\" not be used in advertising or otherwise to promote the sale, use or
51: .\" other dealings in this Software without prior written authorization
52: .\" from the X Consortium.
1.8 aaron 53: .\"
1.2 downsj 54: .Dd June 21, 1997
55: .Dt LNDIR 1
1.8 aaron 56: .Os
1.2 downsj 57: .Sh NAME
58: .Nm lndir
1.17 jmc 59: .Nd "create a shadow directory of symbolic links to another directory tree"
1.2 downsj 60: .Sh SYNOPSIS
61: .Nm lndir
62: .Op Fl e Ar exceptfile
63: .Op Fl s
64: .Op Fl i
1.16 millert 65: .Ar fromdir
1.2 downsj 66: .Op Ar todir
67: .Sh DESCRIPTION
1.1 downsj 68: The
1.12 aaron 69: .Nm
1.8 aaron 70: program makes a shadow copy
71: .Ar todir
1.1 downsj 72: of a directory tree
1.10 aaron 73: .Ar fromdir ,
1.1 downsj 74: except that the shadow is not
75: populated with real files but instead with symbolic links pointing at
1.8 aaron 76: the real files in the
1.2 downsj 77: .Ar fromdir
1.9 aaron 78: directory tree.
79: This is usually useful for maintaining source code for
80: different machine architectures.
81: You create a shadow directory
1.1 downsj 82: containing links to the real source, which you will have usually
1.9 aaron 83: mounted from a remote machine.
84: You can build in the shadow tree, and
1.1 downsj 85: the object files will be in the shadow directory, while the
86: source files in the shadow directory are just symlinks to the real
87: files.
1.2 downsj 88: .Pp
1.8 aaron 89: This scheme has the advantage that if you update the source, you need not
1.1 downsj 90: propagate the change to the other architectures by hand, since all
91: source in all shadow directories are symlinks to the real thing: just cd
92: to the shadow directory and recompile away.
1.2 downsj 93: .Pp
1.1 downsj 94: The
1.2 downsj 95: .Ar todir
1.9 aaron 96: argument is optional and defaults to the current directory.
97: The
1.2 downsj 98: .Ar fromdir
1.9 aaron 99: argument may be relative (e.g.,
100: .Pa \&.\&./src )
101: and is relative to
1.2 downsj 102: .Ar todir
1.1 downsj 103: (not the current directory).
1.8 aaron 104: .Pp
1.1 downsj 105: .\" CVS.adm is used by the Concurrent Versions System.
1.19 ! matthieu 106: Note that files whose names end in '~' or start with '.#' and
! 107: RCS, SCCS, CVS and CVS.adm directories are not shadowed, in
1.2 downsj 108: addition to any specified on the command line with
1.3 downsj 109: .Fl e
1.2 downsj 110: arguments.
111: .Pp
1.1 downsj 112: If you add files, simply run
1.12 aaron 113: .Nm
1.9 aaron 114: again.
115: New files will be silently added.
116: Old files will be
1.1 downsj 117: checked that they have the correct link.
1.2 downsj 118: .Pp
1.1 downsj 119: Deleting files is a more painful problem; the symlinks will
120: just point into never never land.
1.2 downsj 121: .Pp
1.8 aaron 122: If a file in
1.2 downsj 123: .Ar fromdir
1.8 aaron 124: is a symbolic link,
1.12 aaron 125: .Nm
1.8 aaron 126: will make the same link in
1.2 downsj 127: .Ar todir
1.8 aaron 128: rather than making a link back to the (symbolic link) entry in
1.2 downsj 129: .Ar fromdir .
130: The
1.3 downsj 131: .Fl i
1.2 downsj 132: flag changes this behavior.
1.9 aaron 133: .Pp
134: The options are as follows:
1.11 aaron 135: .Bl -tag -width Ds
1.2 downsj 136: .It Fl e Ar exceptfile
1.9 aaron 137: Add the specified file to the list of excluded files/directories.
1.12 aaron 138: This is effective in all directories searched by
1.2 downsj 139: .Nm lndir .
140: This option may be specified as many times as needed.
141: .It Fl s
142: Suppresses status messages normally output as
1.12 aaron 143: .Nm
1.2 downsj 144: descends into each subdirectory.
145: .It Fl i
1.8 aaron 146: Causes the program to not treat symbolic links in
1.2 downsj 147: .Ar fromdir
1.9 aaron 148: specially.
149: The link created in
1.2 downsj 150: .Ar todir
1.8 aaron 151: will point back to the corresponding (symbolic link) file in
1.2 downsj 152: .Ar fromdir .
1.1 downsj 153: If the link is to a directory, this is almost certainly the wrong thing.
1.2 downsj 154: .Pp
1.1 downsj 155: This option exists mostly to emulate the behavior the C version of
1.12 aaron 156: .Nm
1.9 aaron 157: had in X11R6.
158: Its use is not recommended.
1.2 downsj 159: .El
160: .Sh DIAGNOSTICS
1.1 downsj 161: The program displays the name of each subdirectory it enters, followed
1.9 aaron 162: by a colon.
163: The
1.3 downsj 164: .Fl s
1.2 downsj 165: option suppresses these messages.
166: .Pp
1.1 downsj 167: A warning message is displayed if the symbolic link cannot be created.
168: The usual problem is that a regular file of the same name already
169: exists.
1.2 downsj 170: .Pp
1.1 downsj 171: If the link already exists but doesn't point to the correct file, the
172: program prints the link name and the location where it does point.
1.12 aaron 173: .Sh SEE ALSO
174: .Xr find 1 ,
175: .Xr ln 1 ,
176: .Xr patch 1
177: .Sh HISTORY
178: .Nm
179: was first distributed as part of X11.
180: .Pp
181: This version first appeared in
1.14 mickey 182: .Ox 1.2 .
1.2 downsj 183: .Sh BUGS
1.1 downsj 184: The
1.4 downsj 185: .Xr patch 1
1.9 aaron 186: program gets upset if it cannot change the files.
187: You should never run
1.4 downsj 188: .Xr patch 1
1.1 downsj 189: from a shadow directory anyway.
1.4 downsj 190: .Pp
191: You need to use something like
192: .Bd -unfilled -offset indent
1.15 mpech 193: $ find todir \|\-type l \|\-print \||\| xargs rm
1.4 downsj 194: .Ed
1.5 downsj 195: .Pp
1.4 downsj 196: to clear out all files before you can relink (if fromdir moved, for instance).
197: Something like
198: .Bd -unfilled -offset indent
1.15 mpech 199: $ find . \|\\! \|\-type d \|\-print
1.4 downsj 200: .Ed
1.5 downsj 201: .Pp
1.4 downsj 202: will find all files that are not directories.