[BACK]Return to lndir.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / lndir

Annotation of src/usr.bin/lndir/lndir.1, Revision 1.15

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