DEADSOFTWARE

center issue #194, Meta.PutParam and Kernel.Call for open arrays are mismatched
[bbcp.git] / BlackBox / switch-target
1 #!/bin/sh
3 checkAndRm () {
4 lines=`find . -mindepth 1 -maxdepth 1 -name "_*" -print | sed 's/\.\///'`
5 for line in $lines; do
6 find "${line}" \( -type f -o -type l \) -print |
7 while read l; do
8 to=`echo $l | sed "s/^${line}\///"`
9 if [ -h "${to}" ]; then
10 rm -f "${to}"
11 fi
12 done
13 done
14 }
16 none() {
17 checkAndRm || exit 2
19 rm -rf *.exe *.so loader blackbox blackboxc dev0
20 # System/Code/Kernel.ocf System/Sym/Kernel.osf Code/Kernel.ocf Sym/Kernel.osf \
21 # System/Code/Init.ocf System/Sym/Init.osf Code/Init.ocf Sym/Init.osf \
22 # System/Code/Config.ocf System/Sym/Config.osf Code/Config.ocf Sym/Config.osf \
23 # Host/Code/*.ocf Host/Sym/*.osf Lin/Code/*.ocf Lin/Sym/*.osf
24 }
26 mklinks () {
27 find "${1}" -mindepth ${2} -maxdepth ${2} \( -type f -o -type l \) -print |
28 while read l; do
29 to=`echo $l | sed "s/^${line}\///"`
30 mkdir -p `dirname "${to}"`
31 ln -s "${3}"/${l} "${to}"
32 done
33 }
35 dolinks () {
36 lines1=`find . -mindepth 1 -maxdepth 1 -name "_*${1}*_" -print | sed 's/\.\///'`
37 lines2=`find . -mindepth 1 -maxdepth 1 -name "__*${2}*" -print | sed 's/\.\///'`
38 lines3=`find . -mindepth 1 -maxdepth 1 -name "_*"${1}"*_*${2}*" -print | sed 's/\.\///'`
39 for line in $lines1 $lines2 $lines3; do
40 find "${line}" -mindepth 1 -maxdepth 1 \( -type f -o -type l \) -print |
41 while read l; do
42 ln -s $l
43 done
44 mklinks "${line}" 2 ..
45 mklinks "${line}" 3 ../..
46 mklinks "${line}" 4 ../../..
47 done
48 }
50 if [ $# -eq 1 ]; then
51 if [ "${1}" = "none" ]; then
52 none
53 else
54 none || exit 2
55 dolinks "${1}" Interp
56 fi
57 elif [ $# -eq 2 ]; then
58 none || exit 2
59 dolinks "${1}" "${2}"
60 else
61 echo "usage: `basename $0` ( none | OS [ configuration ] )"
62 echo " OS: Linux | OpenBSD | FreeBSD | Windows"
63 echo " configuration: GUI | Interp"
64 exit 1
65 fi