-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetlib.sh
executable file
·49 lines (39 loc) · 985 Bytes
/
getlib.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
do_configure()
{
nn="$1"
[ -d $nn ] || exit 1
[ -f $nn/configure ] || (cd $nn && ./autogen.sh --no-configure)
}
PATH="/bin/:/usr/bin:/sbin:/usr/sbin"
if [ ! -f capreq.h ]; then
cd `dirname $0`;
if [ ! -f capreq.h ]; then
echo "$0: `pwd`: not a poldek directory"
exit 1
fi
fi
name=$1
mode=$2
[ -n "$name" ] || exit 1
# no ../$name => we are propably in distribution tree
if [ ! -d ../$name -a -d $name ]; then
do_configure $name;
exit;
fi
if [ "$mode" = "link" ]; then
if [ -h $name ]; then do_configure $name; exit 0; fi
if [ -d $name ]; then rm -rf $name; fi
fi
if [ "$mode" = "copy" ]; then
if [ -h $name ]; then rm -f $name; fi
if [ -d $name ]; then do_configure $name; exit 0; fi
fi
if [ ! -d $name ]; then
if [ -n "$mode" -a $mode == "link" ]; then
ln ../$name -sf
else
cp -a ../$name .
fi
fi
do_configure $name