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