|
@@ -57,6 +57,18 @@ deploy_item() {
|
57
|
57
|
fi
|
58
|
58
|
}
|
59
|
59
|
|
|
60
|
+get_destdir() {
|
|
61
|
+ #
|
|
62
|
+ # Get DESTDIR: first from ENV:DESTDIR, then the default
|
|
63
|
+ #
|
|
64
|
+ {
|
|
65
|
+ ini 1value ENV:DESTDIR | grep . && return
|
|
66
|
+ echo "$MKIT_DEFAULT_DESTDIR"
|
|
67
|
+ } \
|
|
68
|
+ | xargs readlink -m \
|
|
69
|
+ | grep -m 1 .
|
|
70
|
+}
|
|
71
|
+
|
60
|
72
|
get_dst() {
|
61
|
73
|
#
|
62
|
74
|
# Find out target path for src file $2 of group $1
|
|
@@ -73,7 +85,7 @@ get_root() {
|
73
|
85
|
local grp="$1"
|
74
|
86
|
local root=$(ini 1value "roots:$grp")
|
75
|
87
|
test -n "$root" || die "missing in config.ini: roots:$grp"
|
76
|
|
- echo "$root"
|
|
88
|
+ echo "$destdir/$root"
|
77
|
89
|
}
|
78
|
90
|
|
79
|
91
|
install() {
|
|
@@ -82,6 +94,7 @@ install() {
|
82
|
94
|
#
|
83
|
95
|
check_env
|
84
|
96
|
local dst group mode src
|
|
97
|
+ local destdir=$(get_destdir)
|
85
|
98
|
ini values "lists:group" \
|
86
|
99
|
| while read group;
|
87
|
100
|
do
|
|
@@ -103,6 +116,7 @@ uninstall() {
|
103
|
116
|
#
|
104
|
117
|
check_env
|
105
|
118
|
local dst group src
|
|
119
|
+ local destdir=$(get_destdir)
|
106
|
120
|
ini values "lists:group" \
|
107
|
121
|
| while read group;
|
108
|
122
|
do
|