ready for tagging
[util-vserver.git] / scripts / pkgmgmt
index 7d07458..c174991 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# $Id: pkgmgmt 2291 2006-09-12 10:47:38Z dhozac $
+# $Id: pkgmgmt 2599 2007-08-26 21:30:50Z dhozac $
 
 # Copyright (C) 2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
 #  
@@ -23,6 +23,7 @@ test -e "$UTIL_VSERVER_VARS" || {
 }
 . "$UTIL_VSERVER_VARS"
 . "$_LIB_FUNCTIONS"
+. "$_LIB_VSERVER_BUILD_FUNCTIONS"
 . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
 . "$__PKGLIBDIR/vserver.functions"
 
@@ -54,7 +55,6 @@ function init()
     else
        rpmdb_mntpoint=/.rpmdb
     fi
-    pkgmgmt.initVariables
 }
 
 function _createDirs()
@@ -160,9 +160,9 @@ function _mountFilesystems()
     }
     test -n "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$1"
     
-    _mountFilesystemsInternal "$cfgdir"/fstab                                     || return 1
-    _mountFilesystemsInternal "$cfgdir"/fstab.local                               || return 1
-    _mountFilesystemsInternal "$cfgdir"/fstab.remote $_CHBIND "${CHBIND_OPTS[@]}" || return 1
+    _mountFilesystemsInternal "$cfgdir"/fstab                           || return 1
+    _mountFilesystemsInternal "$cfgdir"/fstab.local                     || return 1
+    _mountFilesystemsInternal "$cfgdir"/fstab.remote "${CHBIND_CMD[@]}" || return 1
 }
 
 function _umountFilesystems()
@@ -177,9 +177,9 @@ function _umountFilesystems()
     test -n "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$1"
 
     pushd "$vdir/" >/dev/null || return 1
-       _umountVserverInternal  "$cfgdir"/fstab.remote $_CHBIND "${CHBIND_OPTS[@]}" || is_ok=
-       _umountVserverInternal  "$cfgdir"/fstab.local                               || is_ok=
-       _umountVserverInternal  "$cfgdir"/fstab                                     || is_ok=
+       _umountVserverInternal  "$cfgdir"/fstab.remote "${CHBIND_CMD[@]}" || is_ok=
+       _umountVserverInternal  "$cfgdir"/fstab.local                     || is_ok=
+       _umountVserverInternal  "$cfgdir"/fstab                           || is_ok=
     popd >/dev/null           || return 1
     
     test -n "$is_ok"
@@ -398,6 +398,11 @@ function processVserver()
        echo $"Vserver '$vserver' does not seem to exist; skipping it..."
        return 1
     } >&2
+
+    _setVserverDir "$vserver"
+    _setVserverName
+    _setVserverDirName
+    pkgmgmt.initVariables
     
     pkgmgmt.isInternal "$vserver" || is_external=1