Explorar el Código

Fix DESTDIR/PREFIX logic

Hopefully this is now according to GNU standards.
Alois Mahdal hace 9 años
padre
commit
9acbd8256d
Se han modificado 2 ficheros con 1 adiciones y 26 borrados
  1. 1
    25
      src/include/deploy.sh
  2. 0
    1
      src/make.skel

+ 1
- 25
src/include/deploy.sh Ver fichero

@@ -14,14 +14,6 @@ _maybe() {
14 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 17
 deploy_item() {
26 18
     #
27 19
     # Deploy item and make it look like wanted
@@ -58,18 +50,6 @@ deploy_item() {
58 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 53
 get_dst() {
74 54
     #
75 55
     # Find out target path for src file $2 of group $1
@@ -86,7 +66,7 @@ get_root() {
86 66
     local grp="$1"
87 67
     local root=$(ini 1value "roots:$grp")
88 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 72
 install() {
@@ -94,8 +74,6 @@ install() {
94 74
     # Install product
95 75
     #
96 76
     local dst group mode src
97
-    local destdir=$(get_destdir)
98
-    check_env
99 77
     ini values "lists:group" \
100 78
       | while read group;
101 79
         do
@@ -116,8 +94,6 @@ uninstall() {
116 94
     # Uninstall product
117 95
     #
118 96
     local dst group src
119
-    local destdir=$(get_destdir)
120
-    check_env
121 97
     ini values "lists:group" \
122 98
       | while read group;
123 99
         do

+ 0
- 1
src/make.skel Ver fichero

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