X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvpkg;h=0a54bf43d491ee3ea5939ff9623a18545d1bb149;hb=bb23ba0d1b3ab139512fd137a5e7f7241a49c2d6;hp=5eecaba4fc96b507e3c955db2f25c703be53c8e3;hpb=9aa4164f68b34f283ff8878de3d6a5b9ea4faea6;p=util-vserver.git diff --git a/util-vserver/scripts/vpkg b/util-vserver/scripts/vpkg index 5eecaba..0a54bf4 100755 --- a/util-vserver/scripts/vpkg +++ b/util-vserver/scripts/vpkg @@ -55,6 +55,8 @@ function guessStyle() style=redhat elif test -e "$vdir"/etc/mandrake-release; then style=mandrake + elif test -e "$vdir"/etc/debian_version; then + style=debian else echo $"Can not determine packagemanagement style" >&2 fi @@ -79,11 +81,7 @@ case "$tag" in *) echo $"Unsupport tag '$tag'" >&2; exit 1;; esac -cfgdir=$($_VSERVER_INFO "$vserver" APPDIR pkgmgmt) || { - echo $"Package management not configured for vserver '$vserver'" >&2 - exit 1 -} - +cfgdir=$($_VSERVER_INFO "$vserver" APPDIR pkgmgmt) || : vdir=$($_VSERVER_INFO "$1" VDIR) || : style= @@ -91,7 +89,7 @@ is_external= { read style <"$cfgdir"/style; } 2>/dev/null test "$style" || guessStyle "$vserver" -test -e "$cfgdir"/internal || is_external=1 +test ! -d "$cfgdir" -o -e "$cfgdir"/internal || is_external=1 cmd=() @@ -135,6 +133,23 @@ case "$style" in fi fi ;; + (debian) + case "$tag" in + (get-conffiles) + cmd=( sh -c "cat /var/lib/dpkg/info/*.conffiles 2>/dev/null" ) + ;; + (install) + cmd=( apt-get install "$@" ) + ;; + esac + + if test "$is_external"; then + echo $"'external' packagemanagement is not supported for Debian" >&2 + exit 1 + else + cmd=( "$_VSERVER" --silent "$vserver" exec "${cmd[@]}" ) + fi + ;; esac export LANG=C