#!/bin/bash
-# $Id: pkgmgmt,v 1.13 2005/07/03 17:43:34 ensc Exp $
+# $Id: pkgmgmt 2518 2007-03-18 22:15:07Z dhozac $
# Copyright (C) 2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
}
. "$UTIL_VSERVER_VARS"
. "$_LIB_FUNCTIONS"
+. "$_LIB_VSERVER_BUILD_FUNCTIONS"
. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
. "$__PKGLIBDIR/vserver.functions"
else
rpmdb_mntpoint=/.rpmdb
fi
- pkgmgmt.initVariables
}
function _createDirs()
$_CHROOT_SH testfile "$file" || return 0
- local tmp=$($_MKTEMP /tmp/pkgmgmt_subst.XXXXXX)
+ local tmp=$($_MKTEMP pkgmgmt_subst.XXXXXX)
trap "$_RM -f $tmp" EXIT
$_CHROOT_SH cat "$file" | \
$_CHROOT_SH testfile "$file" || return 0
- local tmp=$($_MKTEMP /tmp/apt.conf.XXXXXX)
+ local tmp=$($_MKTEMP apt.conf.XXXXXX)
trap "$_RM -f $tmp" EXIT
$_CHROOT_SH cat "$file" | \
test -e "$1" || return 0
local hash=$2
- local tmp=$($_MKTEMP /tmp/apt.conf.XXXXXX)
+ local tmp=$($_MKTEMP apt.conf.XXXXXX)
trap "$_RM -f $tmp" EXIT
$_SED -e "s|^$hash$hash\(.*@autogenerated@\)|\1|" "$1" >$tmp
}
test -n "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$1"
- _mountFilesystemsInternal "$cfgdir"/fstab $_CHBIND "${CHBIND_OPTS[@]}" || return 1
- _mountFilesystemsInternal "$cfgdir"/fstab.local $_CHBIND "${CHBIND_OPTS[@]}" || return 1
+ _mountFilesystemsInternal "$cfgdir"/fstab || return 1
+ _mountFilesystemsInternal "$cfgdir"/fstab.local || return 1
+ _mountFilesystemsInternal "$cfgdir"/fstab.remote $_CHBIND "${CHBIND_OPTS[@]}" || return 1
}
function _umountFilesystems()
test -n "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$1"
pushd "$vdir/" >/dev/null || return 1
- _umountVserverInternal "$cfgdir"/fstab.local || is_ok=
- _umountVserverInternal "$cfgdir"/fstab $_CHBIND "${CHBIND_OPTS[@]}" || is_ok=
+ _umountVserverInternal "$cfgdir"/fstab.remote $_CHBIND "${CHBIND_OPTS[@]}" || is_ok=
+ _umountVserverInternal "$cfgdir"/fstab.local || is_ok=
+ _umountVserverInternal "$cfgdir"/fstab || is_ok=
popd >/dev/null || return 1
test -n "$is_ok"
if test -n "$is_internalize"; then
:
else
- tmpdir=$($_MKTEMPDIR /var/tmp/pgmgmt.XXXXXX)
+ tmpdir=$($_MKTEMPDIR -p /var/tmp pkgmgmt.XXXXXX)
trap "$_RM -rf $tmpdir" EXIT
pushd "$vdir" >/dev/null
$_EXEC_CD /var/lib $_MV rpm $tmpdir/
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