瀏覽代碼

Fix PREFIX check

Turns out that when DESTDIR is used, the PREFIX dir almost never exists
(such as if DESTDIR points to a build root).

Before DESTDIR support was added, mkit would rely on PREFIX itself.
Now, checks will be done on DESTDIR itself, which must be set internally
in mkit.ini or inherited.  PREFIX is actually considered only inside
mkit.ini itself.
Alois Mahdal 9 年之前
父節點
當前提交
f3eab019fb
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5
    5
      src/include/deploy.sh

+ 5
- 5
src/include/deploy.sh 查看文件

15
 
15
 
16
 check_env() {
16
 check_env() {
17
     #
17
     #
18
-    # Check that environment variables have been set properly
18
+    # Check that critical variables are set correctly
19
     #
19
     #
20
-    PREFIX="$(readlink -m "$PREFIX")"
21
-    test -d "$PREFIX" || die "PREFIX points to non-existent directory: $PREFIX"
20
+    test -n "$destdir" || die "could not determine DESTDIR"
21
+    test -d "$destdir" || die "DESTDIR: no such directory: $destdir"
22
 }
22
 }
23
 
23
 
24
 deploy_item() {
24
 deploy_item() {
92
     #
92
     #
93
     # Install product
93
     # Install product
94
     #
94
     #
95
-    check_env
96
     local dst group mode src
95
     local dst group mode src
97
     local destdir=$(get_destdir)
96
     local destdir=$(get_destdir)
97
+    check_env
98
     ini values "lists:group" \
98
     ini values "lists:group" \
99
       | while read group;
99
       | while read group;
100
         do
100
         do
114
     #
114
     #
115
     # Uninstall product
115
     # Uninstall product
116
     #
116
     #
117
-    check_env
118
     local dst group src
117
     local dst group src
119
     local destdir=$(get_destdir)
118
     local destdir=$(get_destdir)
119
+    check_env
120
     ini values "lists:group" \
120
     ini values "lists:group" \
121
       | while read group;
121
       | while read group;
122
         do
122
         do