Browse Source

Fix DESTDIR/PREFIX logic

Hopefully this is now according to GNU standards.
Alois Mahdal 9 years ago
parent
commit
9acbd8256d
2 changed files with 1 additions and 26 deletions
  1. 1
    25
      src/include/deploy.sh
  2. 0
    1
      src/make.skel

+ 1
- 25
src/include/deploy.sh View File

14
     esac
14
     esac
15
 }
15
 }
16
 
16
 
17
-check_env() {
18
-    #
19
-    # Check that critical variables are set correctly
20
-    #
21
-    test -n "$destdir" || die "could not determine DESTDIR"
22
-    test -d "$destdir" || die "DESTDIR: no such directory: $destdir"
23
-}
24
-
25
 deploy_item() {
17
 deploy_item() {
26
     #
18
     #
27
     # Deploy item and make it look like wanted
19
     # Deploy item and make it look like wanted
58
     fi
50
     fi
59
 }
51
 }
60
 
52
 
61
-get_destdir() {
62
-    #
63
-    # Get DESTDIR: first from ENV:DESTDIR, then the default
64
-    #
65
-    {
66
-        ini 1value ENV:DESTDIR | grep . && return
67
-        echo "$MKIT_DEFAULT_DESTDIR"
68
-    } \
69
-      | xargs readlink -m \
70
-      | grep -m 1 .
71
-}
72
-
73
 get_dst() {
53
 get_dst() {
74
     #
54
     #
75
     # Find out target path for src file $2 of group $1
55
     # Find out target path for src file $2 of group $1
86
     local grp="$1"
66
     local grp="$1"
87
     local root=$(ini 1value "roots:$grp")
67
     local root=$(ini 1value "roots:$grp")
88
     test -n "$root" || die "missing in config.ini: roots:$grp"
68
     test -n "$root" || die "missing in config.ini: roots:$grp"
89
-    echo "$destdir/$root"
69
+    echo "$(ini 1value ENV:DESTDIR)$root"
90
 }
70
 }
91
 
71
 
92
 install() {
72
 install() {
94
     # Install product
74
     # Install product
95
     #
75
     #
96
     local dst group mode src
76
     local dst group mode src
97
-    local destdir=$(get_destdir)
98
-    check_env
99
     ini values "lists:group" \
77
     ini values "lists:group" \
100
       | while read group;
78
       | while read group;
101
         do
79
         do
116
     # Uninstall product
94
     # Uninstall product
117
     #
95
     #
118
     local dst group src
96
     local dst group src
119
-    local destdir=$(get_destdir)
120
-    check_env
121
     ini values "lists:group" \
97
     ini values "lists:group" \
122
       | while read group;
98
       | while read group;
123
         do
99
         do

+ 0
- 1
src/make.skel View File

11
 export MKIT_DIR=${MKIT_DIR:-$(dirname "$0")}
11
 export MKIT_DIR=${MKIT_DIR:-$(dirname "$0")}
12
 export MKIT_LOCAL=${MKIT_LOCAL:-.mkit}
12
 export MKIT_LOCAL=${MKIT_LOCAL:-.mkit}
13
 export MKIT_DRY=${MKIT_DRY:-false}
13
 export MKIT_DRY=${MKIT_DRY:-false}
14
-export MKIT_DEFAULT_DESTDIR=${MKIT_DEFAULT_DESTDIR:-/}
15
 export MKIT_DEBUG=${MKIT_DEBUG:-false}
14
 export MKIT_DEBUG=${MKIT_DEBUG:-false}
16
 
15
 
17
 . "$MKIT_DIR/include/mkit.sh" || die "failed to init; check if MKIT_DIR is set properly: $MKIT_DIR"
16
 . "$MKIT_DIR/include/mkit.sh" || die "failed to init; check if MKIT_DIR is set properly: $MKIT_DIR"