install.sh.diff

Proposed patch against install.sh - soren-ubuntu-com -, 01/07/2009 05:39 PM

Download (2.43 KB)

View differences:

install.sh 2009-01-07 09:57:29 +0000
48 48
        -r) UNINSTALL="yes"   ; shift ;;
49 49
        -u) ONEADMIN_USER="$2" ; shift 2;;
50 50
        -g) ONEADMIN_GROUP="$2"; shift 2;;
51
        -d) DST_DIR="$2" ; shift 2 ;;
51
        -d) ROOT="$2" ; shift 2 ;;
52 52
        --) shift ; break ;;
53 53
        *)  usage; exit 1 ;;
54 54
    esac
......
58 58
# Definition of locations
59 59
#-------------------------------------------------------------------------------
60 60

  
61
if [ -z "$DST_DIR" ] ; then
61
if [ -z "$ROOT" ] ; then
62 62
    BIN_LOCATION="/usr/bin"
63 63
    LIB_LOCATION="/usr/lib/one"
64 64
    ETC_LOCATION="/etc/one"
......
68 68
    INCLUDE_LOCATION="/usr/include"
69 69
    SHARE_LOCATION="/usr/share/doc/opennebula"
70 70

  
71
    MAKE_DIRS="$LIB_LOCATION $ETC_LOCATION $LOG_LOCATION \
72
               $VAR_LOCATION $RUN_LOCATION $SHARE_LOCATION"
71
    MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
72
               $INCLUDE_LOCATION $SHARE_LOCATION \
73
               $LOG_LOCATION $RUN_LOCATION"
73 74

  
74 75
    CHOWN_DIRS="$LOG_LOCATION $VAR_LOCATION $RUN_LOCATION"
75 76
else
76
    BIN_LOCATION="$DST_DIR/bin"
77
    LIB_LOCATION="$DST_DIR/lib"
78
    ETC_LOCATION="$DST_DIR/etc"
79
    VAR_LOCATION="$DST_DIR/var"
80
    INCLUDE_LOCATION="$DST_DIR/include"
81
    SHARE_LOCATION="$DST_DIR/share"
77
    BIN_LOCATION="$ROOT/bin"
78
    LIB_LOCATION="$ROOT/lib"
79
    ETC_LOCATION="$ROOT/etc"
80
    VAR_LOCATION="$ROOT/var"
81
    INCLUDE_LOCATION="$ROOT/include"
82
    SHARE_LOCATION="$ROOT/share"
82 83

  
83 84
    MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
84 85
               $INCLUDE_LOCATION $SHARE_LOCATION"
85 86

  
86
    CHOWN_DIRS="$DST_DIR"
87
    CHOWN_DIRS="$ROOT"
87 88
fi
88 89

  
89 90
SHARE_DIRS="$SHARE_LOCATION/examples \
......
307 308

  
308 309
if [ "$UNINSTALL" = "no" ] ; then 
309 310
    for d in $MAKE_DIRS; do
310
        mkdir -p $d
311
        mkdir -p $DESTDIR$d
311 312
    done
312 313
fi
313 314

  
......
317 318
    if [ "$UNINSTALL" = "yes" ]; then
318 319
        rm $2/`basename $1`
319 320
    else
320
        cp $SRC_DIR/$1 $2
321
        cp $SRC_DIR/$1 $DESTDIR$2
321 322
    fi
322 323
}
323 324

  
......
348 349
# --- Set ownership or remove OpenNebula directories ---
349 350

  
350 351
if [ "$UNINSTALL" = "no" ] ; then 
351
    /bin/chown -R $ONEADMIN_USER:$ONEADMIN_GROUP $CHOWN_DIRS
352
    for d in $CHOWN_DIRS; do
353
        /bin/chown -R $ONEADMIN_USER:$ONEADMIN_GROUP $DESTDIR$d
354
    done
352 355
else
353 356
    for d in `echo $MAKE_DIRS | awk '{for (i=NF;i>=1;i--) printf $i" "}'`; do
354 357
        rmdir $d