blob: 19b047a3a16d3babe6ae25be192fc7d617278bb9 (
plain)
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
|
#!/bin/sh
check_dest()
{
if ! [ -d "$PREFIX" ]; then
if ! mkdir -p "$PREFIX"; then
echo "Could not create target directory '$PREFIX'! Aborting..."
exit 1
fi
fi
}
run_cmd ()
{
local cmd="$1"
local title="$2"
local len=`echo "$title" | wc -c`
len=$((40-$len))
local format = "%""$len""s"
echo -n "$title"
if ! eval $cmd >>$LOG 2>&1 ; then
printf "%$(len)s\n" "'$title'" "FAIL"
exit 1
fi
printf "$format\n" "'$title'" "DONE"
}
abs_path()
{
local path="$1"
case "$path" in
/*) absolute=1 ;;
*) absolute=0 ;;
esac
}
. "$HOME/.bashrc"
. "`pwd`/config.sh"
check_dest
|