Browse Source

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 years ago
parent
commit
f3eab019fb
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      src/include/deploy.sh

+ 5
- 5
src/include/deploy.sh View File

@@ -15,10 +15,10 @@ _maybe() {
15 15
 
16 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 24
 deploy_item() {
@@ -92,9 +92,9 @@ install() {
92 92
     #
93 93
     # Install product
94 94
     #
95
-    check_env
96 95
     local dst group mode src
97 96
     local destdir=$(get_destdir)
97
+    check_env
98 98
     ini values "lists:group" \
99 99
       | while read group;
100 100
         do
@@ -114,9 +114,9 @@ uninstall() {
114 114
     #
115 115
     # Uninstall product
116 116
     #
117
-    check_env
118 117
     local dst group src
119 118
     local destdir=$(get_destdir)
119
+    check_env
120 120
     ini values "lists:group" \
121 121
       | while read group;
122 122
         do