[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.22

1.22    ! jmc         1: .\" $OpenBSD: lndir.1,v 1.21 2005/10/06 15:28:32 jmc 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.22    ! jmc        54: .Dd $Mdocdate$
1.2       downsj     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
1.21      jmc        90: source in all shadow directories are symlinks to the real thing: just
                     91: .Xr cd 1
1.1       downsj     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.21      jmc        99: argument may be relative (e.g.\&
                    100: .Pa ../src )
1.9       aaron     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: If you add files, simply run
1.12      aaron     106: .Nm
1.9       aaron     107: again.
                    108: New files will be silently added.
                    109: Old files will be
1.1       downsj    110: checked that they have the correct link.
1.2       downsj    111: .Pp
1.1       downsj    112: Deleting files is a more painful problem; the symlinks will
                    113: just point into never never land.
1.2       downsj    114: .Pp
1.21      jmc       115: The options are as follows:
                    116: .Bl -tag -width Ds
                    117: .It Fl e Ar exceptfile
                    118: Add the specified file to the list of excluded files/directories.
                    119: This is effective in all directories searched by
                    120: .Nm .
                    121: This option may be specified as many times as needed.
                    122: .Pp
                    123: The following types of files are excluded by default:
                    124: .Pp
                    125: .Bl -dash -offset indent -compact
                    126: .It
                    127: files whose names end in
                    128: .Sq ~
                    129: .It
                    130: files whose names start with
                    131: .Sq .#
                    132: .It
                    133: RCS, SCCS, CVS, and CVS.adm directories
                    134: .El
                    135: .It Fl i
1.8       aaron     136: If a file in
1.2       downsj    137: .Ar fromdir
1.8       aaron     138: is a symbolic link,
1.12      aaron     139: .Nm
1.8       aaron     140: will make the same link in
1.2       downsj    141: .Ar todir
1.8       aaron     142: rather than making a link back to the (symbolic link) entry in
1.2       downsj    143: .Ar fromdir .
                    144: The
1.3       downsj    145: .Fl i
1.21      jmc       146: flag changes that behavior,
                    147: i.e. it causes the program to not treat symbolic links in
1.2       downsj    148: .Ar fromdir
1.9       aaron     149: specially.
                    150: The link created in
1.2       downsj    151: .Ar todir
1.8       aaron     152: will point back to the corresponding (symbolic link) file in
1.2       downsj    153: .Ar fromdir .
1.1       downsj    154: If the link is to a directory, this is almost certainly the wrong thing.
1.2       downsj    155: .Pp
1.1       downsj    156: This option exists mostly to emulate the behavior the C version of
1.12      aaron     157: .Nm
1.9       aaron     158: had in X11R6.
                    159: Its use is not recommended.
1.20      jmc       160: .It Fl s
                    161: Suppresses status messages normally output as
                    162: .Nm
                    163: descends into each subdirectory.
1.2       downsj    164: .El
                    165: .Sh DIAGNOSTICS
1.1       downsj    166: The program displays the name of each subdirectory it enters, followed
1.9       aaron     167: by a colon.
                    168: The
1.3       downsj    169: .Fl s
1.2       downsj    170: option suppresses these messages.
                    171: .Pp
1.1       downsj    172: A warning message is displayed if the symbolic link cannot be created.
                    173: The usual problem is that a regular file of the same name already
                    174: exists.
1.2       downsj    175: .Pp
1.1       downsj    176: If the link already exists but doesn't point to the correct file, the
                    177: program prints the link name and the location where it does point.
1.12      aaron     178: .Sh SEE ALSO
                    179: .Xr find 1 ,
                    180: .Xr ln 1 ,
                    181: .Xr patch 1
                    182: .Sh HISTORY
                    183: .Nm
                    184: was first distributed as part of X11.
                    185: .Pp
                    186: This version first appeared in
1.14      mickey    187: .Ox 1.2 .
1.2       downsj    188: .Sh BUGS
1.1       downsj    189: The
1.4       downsj    190: .Xr patch 1
1.9       aaron     191: program gets upset if it cannot change the files.
                    192: You should never run
1.4       downsj    193: .Xr patch 1
1.1       downsj    194: from a shadow directory anyway.
1.4       downsj    195: .Pp
1.21      jmc       196: To clear out all files before you can relink
                    197: (if
                    198: .Ar fromdir
                    199: moved, for instance):
                    200: .Bd -literal -offset indent
                    201: $ find todir -type l -print0 | xargs -0 -r rm
1.4       downsj    202: .Ed
1.5       downsj    203: .Pp
1.21      jmc       204: Find all files that are not directories:
                    205: .Bd -literal -offset indent
                    206: $ find . ! -type d -print0
1.4       downsj    207: .Ed