5 # $Id: mklinks.in,v 1.4 1997/09/11 09:06:34 mdw Exp $
7 # Create links to the repository
9 # (c) 1997 Mark Wooding
12 #----- Licensing notice -----------------------------------------------------
14 # This file is part of the Common Files Distribution (`common').
16 # `Common' is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # `Common' is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with `common'; if not, write to the Free Software Foundation,
28 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 # --- Configuration variables ---
33 datadir
=@datadir@
/@PACKAGE@
35 # --- Parse command line arguments ---
37 while [ $# -gt
0 ]; do
39 -h |
--h |
--he |
--hel |
--help)
41 Usage: mklinks [FILE...]
43 The FILEs listed are themselves lists of filenames. Makes each named file a
44 link to the corresponding file in the shared files repository. With no
45 arguments, \`mklinks' reads \`.links' from the current directory.
49 -v |
--v |
--ve |
--ver |
--vers |
--versi |
--versio |
--version
)
50 version
=`echo '$Revision: 1.4 $' |
51 sed -n -e 's;^.*: \([0-9.]*\) *\\$;\1;p'`
52 echo "mklinks $version; Common Files Distribution version @VERSION@"
63 echo "mklinks: unknown option \`$1'" >&2
75 # This is really trivial.
77 [ $# = 0 ] && set .links
78 cat "$@" |
while read name
; do
79 base
="`echo $name | sed -e 's;^.*/;;'`"
80 [ -r
"$datadir/$base" ] && ln -sf
"$datadir/$base" "$name"