diff options
author | 2006-11-02 19:29:45 +0000 | |
---|---|---|
committer | 2006-11-02 19:29:45 +0000 | |
commit | 0ebcbd6f293acebc4f628ba9b00f972032332475 (patch) | |
tree | 443d146770dfef0cea670cbdb51b84f34a31eeed | |
parent | Patchset for 2.1.1_rc46. (diff) | |
download | misc-0ebcbd6f293acebc4f628ba9b00f972032332475.tar.gz misc-0ebcbd6f293acebc4f628ba9b00f972032332475.tar.bz2 misc-0ebcbd6f293acebc4f628ba9b00f972032332475.zip |
Initial patchset for 0.30.211-r1; based upon 0.30.211 and UPSTREAM's subversion repository.
svn path=/; revision=515
8 files changed, 1082 insertions, 0 deletions
diff --git a/util-vserver/patches/0.30.211-r1/000_README b/util-vserver/patches/0.30.211-r1/000_README new file mode 100644 index 0000000..b7ef166 --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/000_README @@ -0,0 +1,39 @@ +Numbering scheme +-------------------------------------- +FIXES +000_all - 195_all + +FEATURES +200_all - 395_all + +Patch descriptions: +-------------------------------------- + +Patch: 005_all_baselayout-1.13.patch +From: Benedikt Boehm +Desc: Provide necessary changes to support plain! sys-apps/baselayout (>=1.13) + +Patch: 010_all_vyumworker-fixes.patch +From: Daniel Hokka Zakrisson +Desc: Fix a bug in the warning code; Improve the versions handled by the vyum-wrapper + +Patch: 015_all_chroot-sh.c.patch +From: Benedikt Boehm +Desc: Adding `mkdir' and `chmod' functions to chroot-sh + +Patch: 020_all_vserver-build.template.patch +From: Benedikt Boehm +Desc: Fix the `no_dev_sanity' logic + +Patch: 025_all_namespace-cleanup.patch +From: Daniel Hokka Zakrisson +Desc: Improve namespace cleanup to make sure some required directories stick around, + and add some configuration options to exclude further paths. + +Patch: 210_all_gentoo-tools.patch +From: Benedikt Boehm and Christian Heim +Desc: Adding various Gentoo related scripts (vemerge, vdispatch-conf, ...) + +Patch: 215_all_shell-completion.patch +From: Thomas Champagne and Ben Voui(?) +Desc: Adding bash/zsh completion scripts diff --git a/util-vserver/patches/0.30.211-r1/005_all_baselayout-1.13.patch b/util-vserver/patches/0.30.211-r1/005_all_baselayout-1.13.patch new file mode 100644 index 0000000..0be605a --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/005_all_baselayout-1.13.patch @@ -0,0 +1,240 @@ +Index: scripts/vserver.functions +=================================================================== +--- scripts/vserver.functions (revision 2359) ++++ scripts/vserver.functions (revision 2360) +@@ -299,8 +299,25 @@ + ;; + + (xgentoo) +- panic "init-style '$INITSTYLE' is no longer supported; please use plain instead; aborting";; ++ INITCMD_START=( /lib/rcscripts/sh/init-vserver.sh ) ++ INITCMD_STOP=( /sbin/rc shutdown ) + ++ pushd "$vdir"/vdir &>/dev/null ++ basever=$($_CHROOT_SH cat /etc/gentoo-release | $_AWK '{print $5}') ++ popd &>/dev/null ++ ++ basemaj=${basever/.*} ++ basemin=${basever#*.} ++ basemin=${basemin/.*} ++ ++ test "$basemaj" -lt 1 -o "$basemin" -lt 13 && \ ++ panic "\ ++Using init-style 'gentoo' requires >=baselayout-1.13 inside the vserver! ++ ++Your vserver ($(basename "$vdir")) seems to have baselayout-$basever, ++please use 'plain' init-style instead!" ++ ;; ++ + (x) ;; + (*) panic "Unknown init-style '$INITSTYLE'; aborting";; + esac +Index: distrib/Makefile.am +=================================================================== +--- distrib/Makefile.am (revision 2359) ++++ distrib/Makefile.am (revision 2360) +@@ -31,7 +31,9 @@ + nobase_distrib_SCRIPTS = redhat/initpost \ + redhat/initpre \ + redhat/rc.sysinit \ +- gentoo/initpost ++ gentoo/initpost \ ++ gentoo/initpre \ ++ gentoo/init-vserver.sh + + nobase_distrib_DATA = defaults/devs \ + defaults/apt.conf \ +Index: distrib/gentoo/init-vserver.sh +=================================================================== +--- distrib/gentoo/init-vserver.sh (revision 0) ++++ distrib/gentoo/init-vserver.sh (revision 2360) +@@ -0,0 +1,29 @@ ++#!/bin/bash ++# ++# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org> ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; version 2 of the License. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# ++# BIG FAT WARNING: ++# ++# Do not remove this file if you are using gentoo init style! ++# Your vserver will not boot anymore! ++# ++# You have been warned... ++# ++ ++RUNLEVEL=1 /sbin/rc sysinit ++/sbin/rc boot ++/sbin/rc default +Index: distrib/gentoo/initpost +=================================================================== +--- distrib/gentoo/initpost (revision 2359) ++++ distrib/gentoo/initpost (revision 2360) +@@ -1,6 +1,6 @@ +-#! /bin/bash ++#!/bin/bash + +-# Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> ++# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org> + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -17,12 +17,87 @@ + + ## Called as: initpost <cfgdir> <path of util-vserver-vars> + ++vdir="$1"/vdir + . "$2" + +-$_MKDIR -p "$1"/vdir/usr/portage ++# portage stuff ++pushd "$vdir" &>/dev/null ++$_CHROOT_SH mkdir /usr 2>/dev/null || : ++$_CHROOT_SH mkdir /usr/portage 2>/dev/null || : ++popd &>/dev/null + +-$_CAT <<EOF >> "$1"/fstab +-# shared portage tree +-/usr/portage /usr/portage none bind,ro 0 0 +-/usr/portage/distfiles /usr/portage/distfiles none bind,rw 0 0 +-EOF ++ ++# check for baselayout >= 1.13 ++pushd "$vdir" &>/dev/null ++basever=$($_CHROOT_SH cat /etc/gentoo-release | $_AWK '{print $5}') ++popd &>/dev/null ++ ++echo ">>> Found baselayout-$basever" ++ ++basemaj=${basever/.*} ++basemin=${basever#*.} ++basemin=${basemin/.*} ++ ++if test "$basemaj" -lt 1 -o "$basemin" -lt 13; then ++ echo "!!! Will not do automagic changes to baselayout < 1.13" ++ echo "!!! You have to take care for yourself ..." ++ exit 0 ++fi ++ ++ ++# fix gettys in inittab ++pushd "$vdir" &>/dev/null ++ ++if $_CHROOT_SH testfile /etc/inittab; then ++ echo ">>> Fixing inittab ... " ++ inittabtmp=$($_MKTEMP inittab.XXXXXX) ++ ++ $_CHROOT_SH cat /etc/inittab | \ ++ $_SED 's/\(^[^#].*getty.*$\)/#\1/' > $inittabtmp ++ $_CHROOT_SH truncate /etc/inittab < $inittabtmp ++ ++ $_RM -f $inittabtmp ++fi ++ ++popd &>/dev/null ++ ++ ++# unneeded runlevel scripts ++pushd "$vdir" &>/dev/null ++echo ">>> Fixing default runlevel scripts ... " ++$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || : ++$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || : ++popd &>/dev/null ++ ++ ++# fix fstab for checkfs/localmount ++pushd "$vdir" &>/dev/null ++echo ">>> Fixing fstab ... " ++echo "/dev/hdv1 / ufs 0 0" | $_CHROOT_SH truncate /etc/fstab ++popd &>/dev/null ++ ++ ++# gentoo initstyle magic ++initstyle=sysv ++test -e "$1"/apps/init/style && initstyle=$(<"$1"/apps/init/style) ++ ++if test "$initstyle" == "gentoo"; then ++ pushd "$vdir" &>/dev/null ++ ++ echo ">>> Installing special init-style magic ... " ++ ++ $_CAT "$__DISTRIBDIR"/gentoo/init-vserver.sh | \ ++ $_CHROOT_SH truncate /lib/rcscripts/sh/init-vserver.sh ++ $_CHROOT_SH chmod 0755 /lib/rcscripts/sh/init-vserver.sh ++ ++ popd &>/dev/null ++ ++ echo "!!!" ++ echo "!!! You have to install a service (e.g. syslog-ng) and add it to the" ++ echo "!!! default runlevel before you start the guest the first time!" ++ echo "!!! Otherwise the guest will die as soon as it has finished booting." ++ echo "!!!" ++ echo "!!! Consult the Gentoo Handbook on how to chroot and install" ++ echo "!!! packages into the guest environment." ++ echo "!!!" ++fi +Index: distrib/gentoo/initpre +=================================================================== +--- distrib/gentoo/initpre (revision 0) ++++ distrib/gentoo/initpre (revision 2360) +@@ -0,0 +1,48 @@ ++#!/bin/bash ++ ++# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org> ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; version 2 of the License. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++## Called as: initpost <cfgdir> <path of util-vserver-vars> ++ ++vdir="$1"/vdir ++. "$2" ++ ++# portage stuff ++ ++echo ">>> Adding shared /usr/portage to fstab ... " ++ ++if test -d /usr/portage; then ++ ( echo ++ echo "# shared portage tree" ++ echo "/usr/portage /usr/portage none bind,ro 0 0" ++ echo "/usr/portage/distfiles /usr/portage/distfiles none bind,rw 0 0" ++ ) >> "$1"/fstab ++else ++ echo "!!! Cannot find /usr/portage! You should definitely use a" ++ echo "!!! shared portage tree if you have multiple Gentoo guests!" ++fi ++ ++ ++# initstyle sanity ++initstyle=sysv ++test -e "$1"/apps/init/style && initstyle=$(<"$1"/apps/init/style) ++ ++echo ">>> Checking init-style ... $initstyle" ++ ++if test "$initstyle" != "gentoo" -a "$initstyle" != "plain"; then ++ echo "!!! The init-style you specified is not supported for Gentoo" ++ echo "!!! Please use one of: plain, gentoo" ++fi diff --git a/util-vserver/patches/0.30.211-r1/010_all_vyumworker-fixes.patch b/util-vserver/patches/0.30.211-r1/010_all_vyumworker-fixes.patch new file mode 100644 index 0000000..23c0824 --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/010_all_vyumworker-fixes.patch @@ -0,0 +1,26 @@ +Index: scripts/vyum-worker +=================================================================== +--- scripts/vyum-worker (revision 2360) ++++ scripts/vyum-worker (revision 2361) +@@ -64,7 +64,7 @@ + check 'import yum,sys; sys.exit(not hasattr(yum.config.YumConf, "getRootedPath"))' + ;; + (*) +- warning"\ ++ warning "\ + You are using a version of yum which current status is unknown to vyum. + + Just to be sure, 'vyum' will use dirty hacks which might not work when +Index: scripts/vyum-worker +=================================================================== +--- scripts/vyum-worker (revision 2355) ++++ scripts/vyum-worker (revision 2356) +@@ -60,7 +60,7 @@ + (2.[012345]*) + check 'import yum,sys; sys.exit(not hasattr(yum.config.yumconf, "getRootedPath"))' + ;; +- (2.[6789]*) ++ (2.[6789]*|3.0*) + check 'import yum,sys; sys.exit(not hasattr(yum.config.YumConf, "getRootedPath"))' + ;; + (*) diff --git a/util-vserver/patches/0.30.211-r1/015_all_chroot-sh.c.patch b/util-vserver/patches/0.30.211-r1/015_all_chroot-sh.c.patch new file mode 100644 index 0000000..e84f2a0 --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/015_all_chroot-sh.c.patch @@ -0,0 +1,93 @@ +Index: src/chroot-sh.c +=================================================================== +--- src/chroot-sh.c (revision 2358) ++++ src/chroot-sh.c (revision 2359) +@@ -142,7 +142,55 @@ + return res!=-1 && S_ISREG(res) ? EXIT_SUCCESS : EXIT_FAILURE; + } + ++static int ++execMkdir(int argc, char *argv[]) ++{ ++ int i = 1; ++ int res = EXIT_SUCCESS; ++ ++ if (argc<2) { ++ WRITE_MSG(2, "No files specified for 'mkdir' operation; try '--help' for more information\n"); ++ return wrapper_exit_code; ++ } + ++ for (;i<argc; ++i) { ++ if (mkdir(argv[i], 0755)==-1) { ++ PERROR_Q(ENSC_WRAPPERS_PREFIX "mkdir", argv[i]); ++ res = EXIT_FAILURE; ++ } ++ } ++ ++ return res; ++} ++ ++static int ++execChmod(int argc, char *argv[]) ++{ ++ int i = 2; ++ int res = EXIT_SUCCESS; ++ unsigned long mode; ++ ++ if (argc<3) { ++ WRITE_MSG(2, "No files specified for 'chmod' operation; try '--help' for more information\n"); ++ return wrapper_exit_code; ++ } ++ ++ if (!isNumberUnsigned(argv[1], &mode, 1)) { ++ WRITE_MSG(2, "Invalid mode: '"); ++ WRITE_STR(2, argv[1]); ++ return EXIT_FAILURE; ++ } ++ ++ for (;i<argc; ++i) { ++ if (chmod(argv[i], mode)==-1) { ++ PERROR_Q(ENSC_WRAPPERS_PREFIX "chmod", argv[i]); ++ res = EXIT_FAILURE; ++ } ++ } ++ ++ return res; ++} ++ + static struct Command { + char const *cmd; + int (*handler)(int argc, char *argv[]); +@@ -152,6 +200,8 @@ + { "truncate", execTruncate }, + { "testfile", execTestFile }, + { "rm", execRm }, ++ { "mkdir", execMkdir }, ++ { "chmod", execChmod }, + { 0,0 } + }; + +@@ -170,7 +220,10 @@ + " append <file> ... appends stdin to <file> which is created when needed\n" + " truncate <file> ... clear <file> and fill it with stdin; the <file> is\n" + " created when needed\n" +- " rm <file>+ ... unlink the given files\n\n" ++ " rm <file>+ ... unlink the given files\n" ++ " mkdir <file>+ ... create the given directories\n" ++ " chmod <mode> <file>+\n" ++ " ... change access permissions of files\n\n" + "Please report bugs to " PACKAGE_BUGREPORT "\n"); + exit(0); + } +Index: src/Makefile-files +=================================================================== +--- src/Makefile-files (revision 2358) ++++ src/Makefile-files (revision 2359) +@@ -181,6 +181,7 @@ + + src_chain_echo_SOURCES = src/chain-echo.c + src_chroot_sh_SOURCES = src/chroot-sh.c ++src_chroot_sh_LDADD = $(LIBINTERNAL) + src_exec_cd_SOURCES = src/exec-cd.c + src_fakerunlevel_SOURCES = src/fakerunlevel.c + src_ifspec_SOURCES = src/ifspec.c diff --git a/util-vserver/patches/0.30.211-r1/020_all_vserver-build.template.patch b/util-vserver/patches/0.30.211-r1/020_all_vserver-build.template.patch new file mode 100644 index 0000000..d419379 --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/020_all_vserver-build.template.patch @@ -0,0 +1,13 @@ +Index: scripts/vserver-build.template +=================================================================== +--- scripts/vserver-build.template (revision 2357) ++++ scripts/vserver-build.template (revision 2358) +@@ -88,7 +88,7 @@ + $DECOMPRESS "$t" | $EXTRACT + done + +-test -z "$no_dev_sanity" || { ++test -z "$no_dev_sanity" && { + rm -rf dev/* + populateDev + } diff --git a/util-vserver/patches/0.30.211-r1/025_all_namespace-cleanup.patch b/util-vserver/patches/0.30.211-r1/025_all_namespace-cleanup.patch new file mode 100644 index 0000000..a952f9d --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/025_all_namespace-cleanup.patch @@ -0,0 +1,99 @@ +Index: scripts/vserver.functions +=================================================================== +--- scripts/vserver.functions (revision 2356) ++++ scripts/vserver.functions (revision 2357) +@@ -805,7 +805,7 @@ + _mountVserverInternal "$cfgdir"/fstab.remote $_CHBIND "${CHBIND_OPTS[@]}" + + isNamespaceCleanup "$cfgdir" && \ +- _namespaceCleanup ++ _namespaceCleanup "$cfgdir" + + isAvoidNamespace "$cfgdir" || \ + $_SECURE_MOUNT --rbind -n "$vdir" "/" +@@ -1161,26 +1161,39 @@ + + function _namespaceCleanup + { +- local root=$(readlink -f "$vdir") +- local tmp="$root" ++ local vdir="$1" ++ local root=$($_VSERVER_INFO "$1" VDIR 1) + local -a list +- while [ "$tmp" ]; do +- list=( "${list[@]}" "$tmp" ) +- tmp="${tmp%/*}" ++ local -a skip ++ local tmp ++ ++ getFileArray skip "$vdir"/namespace-cleanup-skip \ ++ "$__CONFDIR"/.defaults/namespace-cleanup-skip || : ++ ++ # these are things that have to be accessible post-cleanup ++ for tmp in "$root" "$__SBINDIR" "$__PKGLIBDIR" "$vdir" \ ++ "$__PKGSTATEDIR" "${skip[@]}"; do ++ while test -n "$tmp"; do ++ list=( "${list[@]}" "$tmp" ) ++ tmp="${tmp%/*}" ++ done + done ++ + local -a list_umount + while read dev path opts; do +- [ "$path" ] || continue +- for i in "$root" /dev /proc; do +- [ "${path#$i}" != "$path" ] && continue 2 +- done +- for i in "${list[@]}" /; do +- [ "$path" = "$i" ] && continue 2 +- done +- list_umount=( "${list_umount[@]}" "$path" ) ++ test -n "$path" || continue ++ for i in "$root" /dev /proc; do ++ test "${path#$i}" != "$path" && continue 2 ++ done ++ for i in "${list[@]}" /; do ++ test "$path" = "$i" && continue 2 ++ done ++ # unmount them in reverse order so mounts further down the tree get unmounted first ++ list_umount=( "$path" "${list_umount[@]}" ) + done < /proc/mounts ++ # separate loop to avoid races while reading /proc/mounts + for i in "${list_umount[@]}"; do +- umount -l -n "$i" ++ $_UMOUNT -l -n "$i" + done + } + +Index: doc/configuration.xml +=================================================================== +--- doc/configuration.xml (revision 2356) ++++ doc/configuration.xml (revision 2357) +@@ -45,6 +45,12 @@ + </description> + </boolean> + ++ <list id="global-namespace-cleanup-skip" name="namespace-cleanup-skip"> ++ <description> ++List of paths to skip during namespace cleanup. ++ </description> ++ </list> ++ + <link name="run.rev"> + <description> + Path of the vserver run reverse directory. This directory contains +@@ -381,6 +387,14 @@ + </description> + </boolean> + ++ <list name="namespace-cleanup-skip"> ++ <description> ++List of paths to skip during namespace cleanup. This overrides the ++<optionref ref="global-namespace-cleanup-skip">global namespace-cleanup-skip</optionref> ++file. ++ </description> ++ </list> ++ + <hash name="schedule"> + <description> + [experimental; name is subject of possible change] Contains the diff --git a/util-vserver/patches/0.30.211-r1/210_all_gentoo-tools.patch b/util-vserver/patches/0.30.211-r1/210_all_gentoo-tools.patch new file mode 100644 index 0000000..5ab120f --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/210_all_gentoo-tools.patch @@ -0,0 +1,74 @@ +Index: util-vserver/scripts/Makefile-files +=================================================================== +--- util-vserver.orig/scripts/Makefile-files ++++ util-vserver/scripts/Makefile-files +@@ -38,6 +38,7 @@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += \ + + + scripts_pkglib_src_DTA = scripts/functions \ ++ scripts/gentoo-functions.sh \ + scripts/magic.mime \ + scripts/vserver-build.apt-rpm \ + scripts/vserver-build.skeleton \ +@@ -72,6 +73,7 @@ scripts_pkglib_src_SCRPTS = scripts/pkgm + scripts/vservers.grabinfo.sh \ + scripts/vshelper \ + scripts/vsysvwrapper \ ++ scripts/vschedcalc \ + scripts/vyum-worker + + scripts_legacy_src_SCRPTS = scripts/legacy/save_s_context \ +@@ -89,7 +91,12 @@ scripts_sbin_src_PRGS = scripts/chconte + scripts/vserver \ + scripts/vsomething \ + scripts/vtop \ +- scripts/vyum ++ scripts/vyum \ ++ scripts/vdispatch-conf \ ++ scripts/vemerge \ ++ scripts/vesync \ ++ scripts/vserver-new \ ++ scripts/vupdateworld + + scripts_sbin_gen_PRGS = + scripts_sbincfg_gen_DTA = +Index: util-vserver/scripts/util-vserver-vars.pathsubst +=================================================================== +--- util-vserver.orig/scripts/util-vserver-vars.pathsubst ++++ util-vserver/scripts/util-vserver-vars.pathsubst +@@ -44,6 +44,7 @@ _INITSYNC_MINIT_START=: + _KEEP_CTX_ALIVE="$__PKGLIBDIR/keep-ctx-alive" + _LIB_FUNCTIONS="$__PKGLIBDIR/functions" + _LIB_MAGIC="$__PKGLIBDIR/magic" ++_LIB_GENTOO_FUNCTIONS="$__PKGLIBDIR/gentoo-functions.sh" + _LIB_VSERVER_SETUP_FUNCTIONS="$__PKGLIBDIR/vserver-setup.functions" + _LIB_VSERVER_BUILD_FUNCTIONS="$__PKGLIBDIR/vserver-build.functions" + _LIB_VSERVER_BUILD_FUNCTIONS_APT="$__PKGLIBDIR/vserver-build.functions.apt" +@@ -69,6 +70,9 @@ _VAPT_GET_WORKER="$__PKGLIBDIR/vapt-get- + _VATTRIBUTE="$__SBINDIR/vattribute" + _VCONTEXT="$__SBINDIR/vcontext" + _VDLIMIT="$__SBINDIR/vdlimit" ++_VDISPATCH_CONF="$__SBINDIR/vdispatch-conf" ++_VEMERGE="$__SBINDIR/vemerge" ++_VESYNC="$__SBINDIR/vesync" + _VDU="$__SBINDIR/vdu" + _VHASHIFY="$__PKGLIBDIR/vhashify" + _VKILL="$__SBINDIR/vkill" +@@ -82,7 +86,9 @@ _VRPM="$__SBINDIR/vrpm" + _VRPM_PRELOAD="$__PKGLIBDIR/vrpm-preload" + _VRPM_WORKER="$__PKGLIBDIR/vrpm-worker" + _VSCHED="$__SBINDIR/vsched" ++_VSCHEDCALC="$__PKGLIBDIR/vschedcalc" + _VSERVER="$__SBINDIR/vserver" ++_VSERVER_NEW="$__SBINDIR/vserver-new" + _VSERVER_LEGACY="$__LEGACYDIR/vserver" + _VSERVER_BUILD="$__PKGLIBDIR/vserver-build" + _VSERVER_INFO="$__SBINDIR/vserver-info" +@@ -93,6 +99,7 @@ _VSOMETHING="$__SBINDIR/vsomething" + _VWAIT="$__SBINDIR/vwait" + _VUNAME="$__SBINDIR/vuname" + _VUNIFY="$__PKGLIBDIR/vunify" ++_VUPDATEWORLD="$__SBINDIR/vupdateworld" + _VYUM="$__SBINDIR/vyum" + _VYUM_WORKER="$__PKGLIBDIR/vyum-worker" + diff --git a/util-vserver/patches/0.30.211-r1/215_all_shell-completion.patch b/util-vserver/patches/0.30.211-r1/215_all_shell-completion.patch new file mode 100644 index 0000000..e130d4c --- /dev/null +++ b/util-vserver/patches/0.30.211-r1/215_all_shell-completion.patch @@ -0,0 +1,498 @@ +Index: contrib/bash_completion +=================================================================== +--- /dev/null ++++ contrib/bash_completion +@@ -0,0 +1,300 @@ ++# Completion for the vserver command. Source this file (or on some systems ++# add it to ~/.bash_completion and start a new shell) and bash's completion ++# mechanism will know all about vserver's options! ++# ++# Copyright (C) Thomas Champagne <lafeuil@gmail.com> ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++# ++# The latest version of this software can be obtained here: ++# ++# http://linux-vserver.org/Vserver+Completion ++# ++# version 0.4.0 ++ ++have vserver-info && { ++: ${UTIL_VSERVER_VARS:=$(vserver-info - SYSINFO |grep prefix: | awk '{ print $2}')/lib/util-vserver/util-vserver-vars} ++ ++test -e "$UTIL_VSERVER_VARS" && { ++ ++. "$UTIL_VSERVER_VARS" ++. "$_LIB_FUNCTIONS" ++ ++_vserver() { ++ local cur cmds cmdOpts cmdMethodOpts helpCmds names names_pipe func i j method ++ ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ ++ # find available vServers: ++ # call function getAllVservers in vserver library ++ getAllVservers names ++ names_pipe=`echo ${names[@]} | sed 's/ /|/g'` ++ ++ # available commands ++ cmds='start stop restart condrestart suexec exec enter chkconfig \ ++ running status unify pkg apt-get apt-config apt-cache \ ++ rpm pkgmgmt delete' ++ ++ # options (long and short name) ++ cmdOpts='--help --version --debug --defaulttty -s --sync -v \ ++ --verbose --silent --' ++ ++ cmdMethodOpts='-m -n --context --confdir --lockfile \ ++ --hostname --netdev --netbcast --netmask \ ++ --netprefix --interface --cpuset \ ++ --cpusetcpus --cpusetmems --cpusetvirt \ ++ --initstyle --flags --help --' ++ ++ # if the previous option is a single option ++ helpCmds='--help|--version' ++ if [[ ${COMP_WORDS[1]} == @($helpCmds) ]] ; then ++ return 0 ++ fi ++ ++ # lookup the vServer name ++ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do ++ if [[ ${COMP_WORDS[i]} == @($names_pipe) ]] ; then ++ # found it! ++ break ++ fi ++ done ++ ++ #a vserver has been found ++ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then ++ # Show the vserver command without build ++ case "${COMP_WORDS[i+1]}" in ++ start) ++ COMPREPLY=( $( compgen -W "--rescue --rescue-cmd" -- $cur ) ) ++ ;; ++ # No completion for apt-config ++ stop|restart|condrestart|enter|running|status|apt-config|delete) ++ ;; ++ suexec) ++ # I don't know how to do ++ COMPREPLY=( $( compgen -W -- $cur ) ) ++ ;; ++ exec) ++ #I don't know how to do ++ COMPREPLY=( $( compgen -W "" -- $cur ) ) ++ ;; ++ unify) ++ COMPREPLY=( $( compgen -W "-R" -- $cur ) ) ++ ;; ++ apt-get|apt-cache) ++ func=${COMP_WORDS[i+1]} ++ COMP_WORDS=( ${COMP_WORDS[@]:$((i+1))} ) ++ COMP_CWORD=$((COMP_CWORD-i-1)) ++ declare -f _${func//-/_} > /dev/null && _${func//-/_} ++ ;; ++ *) ++ COMPREPLY=( $( compgen -W "$cmds" -- $cur ) ) ++ ;; ++ esac ++ return 0 ++ else ++ #no vserver name found ++ prev=${COMP_WORDS[COMP_CWORD-1]} ++ ++ #search the new name of vserver ++ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do ++ if [[ ${COMP_WORDS[i]} == !(vserver|-*) ]] ; then ++ # found it! ++ break ++ fi ++ done ++ ++ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then ++ j=$i ++ i=${#COMP_WORDS[@]} ++ for (( ; j < ${#COMP_WORDS[@]}-1; j++ )) ; do ++ if [[ ${COMP_WORDS[j]} == "--" ]]; then ++ # method's parameter ++ case "$method" in ++ legacy|copy) ++ ;; ++ apt-rpm) ++ COMPREPLY=( $( compgen -W "-d" -- $cur ) ) ++ ;; ++ yum) ++ COMPREPLY=( $( compgen -W "-d" -- $cur ) ) ++ ;; ++ rpm) ++ COMPREPLY=( $( compgen -W "-d --empty --force --nodeps" -- $cur ) ) ++ ;; ++ skeleton) ++ ;; ++ debootstrap) ++ COMPREPLY=( $( compgen -W "-d -m -s --" -- $cur ) ) ++ ;; ++ *) ++ ;; ++ esac ++ return 0 ++ break ++ fi ++ ++ if [[ ${COMP_WORDS[j]} == @(build|-m) ]]; then ++ i=$j ++ if (( $j+1 < ${#COMP_WORDS[@]}-1 )) ; then ++ method=${COMP_WORDS[j+1]} ++ fi ++ fi ++ done ++ ++ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then ++ case $prev in ++ --help) ++ ;; ++ -n|--context|--confdir|--lockfile|--hostname|--netdev|--netbcast|--netmask|--netprefix|--interface|--cpuset|--cpusetcpus|--cpusetmems|--cpusetvirt|--initstyle|--flags) ++ COMPREPLY=( $( compgen -W "" -- $cur ) ) ++ ;; ++ -m) ++ COMPREPLY=( $( compgen -W "legacy copy apt-rpm yum rpm skeleton debootstrap" -- $cur ) ) ++ ;; ++ *) ++ COMPREPLY=( $( compgen -W "$cmdMethodOpts" -- $cur ) ) ++ ;; ++ esac ++ else ++ COMPREPLY=( $( compgen -W "build" -- $cur ) ) ++ fi ++ else ++ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) ) ++ fi ++ ++ return 0 ++ fi ++ ++ return 0 ++} ++ ++complete -F _vserver vserver ++ ++_vapt_rpm_yum() ++{ ++ local cur cmds cmdOpts helpCmds names func i ++ ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ ++ # options (long and short name) ++ cmdOpts='--help --version --quiet -q --all' ++ ++ # if the previous option is a single option ++ helpCmds='--help|--version' ++ ++ if [[ "${COMP_WORDS[1]}" == "@($helpCmds)" ]] ; then ++ return 0 ++ fi ++ ++ # search -- ++ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do ++ if [[ ${COMP_WORDS[i]} = "--" ]] ; then ++ # found it! ++ break ++ fi ++ done ++ ++ # find available vServers ++ # call function getAllVservers in vserver library ++ getAllVservers names ++ names_pipe=`echo ${names[@]}" --all" | sed 's/ /|/g'` ++ ++ if (( $i < ${#COMP_WORDS[@]}-1 )) && (( $i < $COMP_CWORD )) ; then ++ func=${COMP_WORDS[0]:1} ++ COMP_WORDS=( $func ${COMP_WORDS[@]:$((i+1))} ) ++ COMP_CWORD=$((COMP_CWORD-i)) ++ declare -f _${func//-/_} > /dev/null && _${func//-/_} ++ else ++ # search vServer name ++ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do ++ if [[ ${COMP_WORDS[i]} == @($names_pipe) ]] ; then ++ # found it! ++ break ++ fi ++ done ++ ++ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then ++ if [[ "${COMP_WORDS[i]}" = "--all" ]] ; then ++ cmdOpts='--' ++ COMPREPLY=( $( compgen -W "$cmdOpts" -- $cur ) ) ++ else ++ cmdOpts='--' ++ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) ) ++ fi ++ else ++ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) ) ++ fi ++ fi ++ ++ return 0 ++} ++ ++_vserver_copy() ++{ ++ local cur prev cmdOpts helpCmds confCmds names names_pipe i ++ ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ ++ # find available vServers ++ # call function getAllVservers in vserver library ++ getAllVservers names ++ names_pipe=`echo ${names[@]} | sed 's/ /|/g'` ++ ++ # options (long and short name) ++ cmdOpts='--help -h --version -V --verbose -v --quiet -q \ ++ --vsroot -r --rsh -R --stopstart -s \ ++ --domain -d --ip -i' ++ ++ # if the previous option is a single option ++ helpCmds='--help|-h|--version|-V' ++ ++ if [[ ${COMP_WORDS[1]} == @($helpCmds) ]] ; then ++ return 0 ++ fi ++ ++ confCmds='--ip|-i|--domain|-d' ++ prev=${COMP_WORDS[COMP_CWORD-1]} ++ ++ if [[ $prev == @($confCmds) ]] ; then ++ return 0 ++ fi ++ ++ # search a vServer name ++ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do ++ if [[ ${COMP_WORDS[i]} == @($names_pipe) ]] ; then ++ # found it! ++ break ++ fi ++ done ++ ++ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then ++ return 0 ++ else ++ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) ) ++ fi ++ ++ return 0 ++} ++ ++complete -F _vapt_rpm_yum vapt-get ++complete -F _vapt_rpm_yum vrpm ++complete -F _vapt_rpm_yum vyum ++complete -F _vserver_copy vserver-copy ++ ++} ++} +Index: contrib/zsh_completion +=================================================================== +--- /dev/null ++++ contrib/zsh_completion +@@ -0,0 +1,188 @@ ++#compdef vserver ++ ++# Copyright (C) 2005 intrigeri@boum.org - property is theft ! ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program; if not, write to the Free Software Foundation, Inc., ++# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# ,---- ++# | NOTES ++# `---- ++# ++# - SVN version: $Id$ ++# - $URL$ ++# - Tested on Debian GNU/Linux with util-vserver 0.30.209. ++# ++# ,---- ++# | TODO ++# `---- ++# - Use util-vserver shell functions library, as does the Bash ++# completion script found on /usr/lib/util-vserver/functions ++# - Implement commands arguments completion. ++# ++ ++### ++### Main completion function ++### ++ ++_vserver () { ++ ++ # local variables ++ local curcontext="$curcontext" state line expl ret=1 ++ local cmd=$words[3] ++ ++ # dispatch ++ case "$cmd" in ++ apt-cache|apt-config|apt-get) ++ compset -n 3 ++ _dispatch $cmd:t $cmd $cmd:t -default- && ret=0 ++ ;; ++ exec) ++ _arguments -C \ ++ '1: :->vsnames' \ ++ '2: :->cmds' \ ++ '3:command name: _command_names -e' \ ++ '*::arguments: _normal' && ret=0 ++ ;; ++ stop|restart|condrestart|enter|running|status) ++ _arguments -C \ ++ '1: :->vsnames' \ ++ '2: :->cmds' \ ++ '*::arguments: _message "no more arguments"' && ret=0 ++ ;; ++ *) ++ _arguments -C \ ++ '(-)--help[print help information]' \ ++ '(- *)--version[print client version information]' \ ++ '1: :->vsnames' \ ++ '2: :->cmds' \ ++ '*:: :->args' && ret=0 ++ ;; ++ esac ++ ++ # cache initialization ++ if [[ -n "$state" ]]; then ++ if (( ! $+_cache_vserver_cfgdir )); then ++ typeset -g _cache_vserver_cfgdir_initialized ++ _vserver_cache_cfgdir ++ fi ++ if (( ! $+_cache_vserver_vsnames )); then ++ typeset -g _cache_vserver_vsnames_initialized ++ _vserver_cache_vsnames ++ fi ++ if (( ! $+_cache_vserver_cmds )); then ++ typeset -g _cache_vserver_cmds_initialized ++ _vserver_cache_cmds ++ fi ++ fi ++ ++ case "$state" in ++ vsnames) ++ _wanted commands expl 'vserver name' _vserver_vsnames && ret=0 ++ ;; ++ cmds) ++ _wanted commands expl 'vserver command' _vserver_commands && ret=0 ++ ;; ++ args) ++ local args ++ if $+args; then ++ _arguments "$args[@]" && ret=0 ++ else ++ ret=0 ++ fi ++ ;; ++ esac ++ ++ return ret ++} ++ ++### ++### Auxiliary completion functions ++### ++ ++(( $+functions[_vserver_commands] )) || ++_vserver_commands() { ++ compadd "$@" -k _cache_vserver_cmds || compadd "$@" ${(s.:.)_cache_vserver_cmds} ++} ++ ++(( $+functions[_vserver_vsnames] )) || ++_vserver_vsnames() { ++ local expl ++ _wanted vserver expl 'vserver name' compadd -S '' $_cache_vserver_vsnames[@] ++} ++ ++### ++### Cache functions ++### ++ ++(( $+functions[_vserver_cache_cfgdir] )) || ++_vserver_cache_cfgdir() { ++ if [[ "$_cache_vserver_cfgdir_initialized" != true ]]; then ++ typeset -ga _cache_vserver_cfgdir ++ _cache_vserver_cfgdir=`vserver-info info SYSINFO | grep '^ *cfg-Directory' | awk '{print $2}'` ++ _cache_vserver_cfgdir_initialized=true ++ fi ++} ++ ++(( $+functions[_vserver_cache_vsnames] )) || ++_vserver_cache_vsnames() { ++ if [[ "$_cache_vserver_vsnames_initialized" != true ]]; then ++ typeset -ga _cache_vserver_vsnames ++ _cache_vserver_vsnames=( $(ls -d $_cache_vserver_cfgdir/*/ | sed -e s,$_cache_vserver_cfgdir,, | tr -d '/') ) ++ _cache_vserver_vsnames_initialized=true ++ fi ++} ++ ++(( $+functions[_vserver_cache_cmds] )) || ++_vserver_cache_cmds() { ++ if [[ "$_cache_vserver_cmds_initialized" != true ]]; then ++ typeset -ga _cache_vserver_cmds ++ _cache_vserver_cmds=( ++ start ++ stop ++ restart ++ condrestart ++ suexec ++ exec ++ enter ++ chkconfig ++ running ++ status ++ build ++ unify ++ pkg ++ apt-get ++ apt-config ++ apt-cache ++ rpm ++ pkgmgmt ++ ) ++ _cache_vserver_cmds_initialized=true ++ fi ++} ++ ++### ++### Main function call ++### ++ ++_vserver "$@" ++ ++### ++### Emacs variables ++### ++ ++# Local Variables: ++# mode:sh ++# sh-basic-offset: 2 ++# End: |