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 #----- Revision history -----------------------------------------------------
34 # --- Configuration variables ---
37 datadir
=@datadir@
/@PACKAGE@
39 # --- Parse command line arguments ---
41 while [ $# -gt
0 ]; do
43 -h |
--h |
--he |
--hel |
--help)
45 Usage: mklinks [FILE...]
47 The FILEs listed are themselves lists of filenames. Makes each named file a
48 link to the corresponding file in the shared files repository. With no
49 arguments, \`mklinks' reads \`.links' from the current directory.
53 -v |
--v |
--ve |
--ver |
--vers |
--versi |
--versio |
--version
)
54 version
=`echo '$Revision: 1.4 $' |
55 sed -n -e 's;^.*: \([0-9.]*\)\\$;\1;p'`
56 echo "mklinks $version; Common Files Distribution version @VERSION@"
67 echo "mklinks: unknown option \`$1'" >&2
79 # This is really trivial.
81 [ $# = 0 ] && set .links
82 cat "$@" |
while read name
; do
83 base
="`echo $name | sed -e 's;^.*/;;'`"
84 [ -r
"$datadir/$base" ] && ln -sf
"$datadir/$base" "$name"