3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: Copyright (c) 2000, Jarkko Hietaniemi
14 ?X: This unit allows the duplication of the source tree to the current
15 ?X: directory via symbolic links. This must be requested explicitly
16 ?X: by them issuing a -Dmksymlinks on the command line.
18 ?MAKE:Mksymlinks: Mkdirp lns issymlink src rsrc pkgsrc
19 ?MAKE: -pick add $@ %<
21 ?T: dir filename tmppwd filelist
22 ?LINT:extern mksymlinks
23 @if {test -f ../MANIFEST}
24 : Duplicate the tree with symbolic links if -Dmksymlinks was supplied
29 ''|'.') echo "Cannot create symlinks in the original directory." >&4
32 *) case "$lns:$issymlink" in
33 *"ln"*" -s:"*"test -"?)
34 echo "Creating the symbolic links..." >&4
35 echo "(First creating the subdirectories...)" >&4
37 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | \
41 test -z "$dir" && break
42 ./UU/mkdirp $dir 2>/dev/null
46 echo "Failed to create '$dir'. Aborting." >&4
50 echo "(Now creating the symlinks...)" >&4
51 awk '{print $1}' $src/MANIFEST | while true; do
53 test -z "$filename" && break
54 if test -f $filename; then
55 if $issymlink $filename; then
59 if test -f $filename; then
60 echo "$filename already exists, not symlinking."
62 ?X: Note that the following works because "$pkgsrc" is absolute
63 ln -s $pkgsrc/$filename $filename
66 ?X: Check that everything was correctly copied
67 echo "(Checking current directory...)" >&4
69 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
70 (split -l 50 2>/dev/null || split -50)
73 for filelist in x??; do
74 (cd ..; ls `cat "$tmppwd/$filelist"` \
75 >/dev/null 2>>"$tmppwd/missing")
77 if test -s missing; then
78 echo "Failed duplication of source tree. Aborting." >&4
82 *) echo "(I cannot figure out how to do symbolic links, ignoring!)" >&4