Annotation of src/usr.bin/lndir/lndir.1, Revision 1.20
1.20 ! jmc 1: .\" $OpenBSD: lndir.1,v 1.19 2005/10/04 18:39:57 matthieu 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
1.20 ! jmc 62: .Op Fl is
1.2 downsj 63: .Op Fl e Ar exceptfile
1.16 millert 64: .Ar fromdir
1.2 downsj 65: .Op Ar todir
66: .Sh DESCRIPTION
1.1 downsj 67: The
1.12 aaron 68: .Nm
1.8 aaron 69: program makes a shadow copy
70: .Ar todir
1.1 downsj 71: of a directory tree
1.10 aaron 72: .Ar fromdir ,
1.1 downsj 73: except that the shadow is not
74: populated with real files but instead with symbolic links pointing at
1.8 aaron 75: the real files in the
1.2 downsj 76: .Ar fromdir
1.9 aaron 77: directory tree.
78: This is usually useful for maintaining source code for
79: different machine architectures.
80: You create a shadow directory
1.1 downsj 81: containing links to the real source, which you will have usually
1.9 aaron 82: mounted from a remote machine.
83: You can build in the shadow tree, and
1.1 downsj 84: the object files will be in the shadow directory, while the
85: source files in the shadow directory are just symlinks to the real
86: files.
1.2 downsj 87: .Pp
1.8 aaron 88: This scheme has the advantage that if you update the source, you need not
1.1 downsj 89: propagate the change to the other architectures by hand, since all
90: source in all shadow directories are symlinks to the real thing: just cd
91: to the shadow directory and recompile away.
1.2 downsj 92: .Pp
1.1 downsj 93: The
1.2 downsj 94: .Ar todir
1.9 aaron 95: argument is optional and defaults to the current directory.
96: The
1.2 downsj 97: .Ar fromdir
1.9 aaron 98: argument may be relative (e.g.,
99: .Pa \&.\&./src )
100: and is relative to
1.2 downsj 101: .Ar todir
1.1 downsj 102: (not the current directory).
1.8 aaron 103: .Pp
1.1 downsj 104: .\" CVS.adm is used by the Concurrent Versions System.
1.19 matthieu 105: Note that files whose names end in '~' or start with '.#' and
106: RCS, SCCS, CVS and CVS.adm directories are not shadowed, in
1.2 downsj 107: addition to any specified on the command line with
1.3 downsj 108: .Fl e
1.2 downsj 109: arguments.
110: .Pp
1.1 downsj 111: If you add files, simply run
1.12 aaron 112: .Nm
1.9 aaron 113: again.
114: New files will be silently added.
115: Old files will be
1.1 downsj 116: checked that they have the correct link.
1.2 downsj 117: .Pp
1.1 downsj 118: Deleting files is a more painful problem; the symlinks will
119: just point into never never land.
1.2 downsj 120: .Pp
1.8 aaron 121: If a file in
1.2 downsj 122: .Ar fromdir
1.8 aaron 123: is a symbolic link,
1.12 aaron 124: .Nm
1.8 aaron 125: will make the same link in
1.2 downsj 126: .Ar todir
1.8 aaron 127: rather than making a link back to the (symbolic link) entry in
1.2 downsj 128: .Ar fromdir .
129: The
1.3 downsj 130: .Fl i
1.2 downsj 131: flag changes this behavior.
1.9 aaron 132: .Pp
133: The options are as follows:
1.11 aaron 134: .Bl -tag -width Ds
1.2 downsj 135: .It Fl e Ar exceptfile
1.9 aaron 136: Add the specified file to the list of excluded files/directories.
1.12 aaron 137: This is effective in all directories searched by
1.2 downsj 138: .Nm lndir .
139: This option may be specified as many times as needed.
140: .It Fl i
1.8 aaron 141: Causes the program to not treat symbolic links in
1.2 downsj 142: .Ar fromdir
1.9 aaron 143: specially.
144: The link created in
1.2 downsj 145: .Ar todir
1.8 aaron 146: will point back to the corresponding (symbolic link) file in
1.2 downsj 147: .Ar fromdir .
1.1 downsj 148: If the link is to a directory, this is almost certainly the wrong thing.
1.2 downsj 149: .Pp
1.1 downsj 150: This option exists mostly to emulate the behavior the C version of
1.12 aaron 151: .Nm
1.9 aaron 152: had in X11R6.
153: Its use is not recommended.
1.20 ! jmc 154: .It Fl s
! 155: Suppresses status messages normally output as
! 156: .Nm
! 157: descends into each subdirectory.
1.2 downsj 158: .El
159: .Sh DIAGNOSTICS
1.1 downsj 160: The program displays the name of each subdirectory it enters, followed
1.9 aaron 161: by a colon.
162: The
1.3 downsj 163: .Fl s
1.2 downsj 164: option suppresses these messages.
165: .Pp
1.1 downsj 166: A warning message is displayed if the symbolic link cannot be created.
167: The usual problem is that a regular file of the same name already
168: exists.
1.2 downsj 169: .Pp
1.1 downsj 170: If the link already exists but doesn't point to the correct file, the
171: program prints the link name and the location where it does point.
1.12 aaron 172: .Sh SEE ALSO
173: .Xr find 1 ,
174: .Xr ln 1 ,
175: .Xr patch 1
176: .Sh HISTORY
177: .Nm
178: was first distributed as part of X11.
179: .Pp
180: This version first appeared in
1.14 mickey 181: .Ox 1.2 .
1.2 downsj 182: .Sh BUGS
1.1 downsj 183: The
1.4 downsj 184: .Xr patch 1
1.9 aaron 185: program gets upset if it cannot change the files.
186: You should never run
1.4 downsj 187: .Xr patch 1
1.1 downsj 188: from a shadow directory anyway.
1.4 downsj 189: .Pp
190: You need to use something like
191: .Bd -unfilled -offset indent
1.15 mpech 192: $ find todir \|\-type l \|\-print \||\| xargs rm
1.4 downsj 193: .Ed
1.5 downsj 194: .Pp
1.4 downsj 195: to clear out all files before you can relink (if fromdir moved, for instance).
196: Something like
197: .Bd -unfilled -offset indent
1.15 mpech 198: $ find . \|\\! \|\-type d \|\-print
1.4 downsj 199: .Ed
1.5 downsj 200: .Pp
1.4 downsj 201: will find all files that are not directories.