diff -urN -x '*~' util-vserver-0.30.207/distrib/Makefile.am util-vserver-0.30.207-poldek/distrib/Makefile.am --- util-vserver-0.30.207/distrib/Makefile.am 2005-05-17 17:53:31.514184912 +0200 +++ util-vserver-0.30.207-poldek/distrib/Makefile.am 2005-05-17 16:39:41.661574720 +0200 @@ -50,7 +50,8 @@ fc2/apt/sources.list \ fc3/apt/sources.list \ fc4/apt/sources.list \ - suse91/apt/sources.list + suse91/apt/sources.list \ + pld-ac/poldek/poldek.conf AM_INSTALLCHECK_STD_OPTIONS_EXEMPT \ = $(nobase_distrib_SCRIPTS) @@ -69,6 +70,11 @@ ln -sf ../redhat/initpre $(DESTDIR)$(distribdir)/$$i/; \ done ln -sf pld-ac $(DESTDIR)$(distribdir)/pld1.99 + ln -sf pld-ac $(DESTDIR)$(confdistribdir)/pld1.99 + POLDEKARCH=$(shell rpm -E '%{_target_cpu}' 2>/dev/null); \ + if [ -z "$$POLDEKARCH" ] ; then POLDEKARCH=$(shell uname -m) ; fi ; \ + sed "s|%ARCH%|$$POLDEKARCH|g" $(DESTDIR)$(confdistribdir)/pld-ac/poldek/poldek.conf > $(DESTDIR)$(confdistribdir)/pld-ac/poldek/poldek.conf.tmp ; \ + mv $(DESTDIR)$(confdistribdir)/pld-ac/poldek/poldek.conf.tmp $(DESTDIR)$(confdistribdir)/pld-ac/poldek/poldek.conf $(mkinstalldirs) $(DESTDIR)$(confdir) \ $(DESTDIR)$(confdistribdir)/.common/pubkeys \ $(DESTDIR)$(confdefaultsdir) \ diff -urN -x '*~' util-vserver-0.30.207/distrib/pld-ac/poldek/poldek.conf util-vserver-0.30.207-poldek/distrib/pld-ac/poldek/poldek.conf --- util-vserver-0.30.207/distrib/pld-ac/poldek/poldek.conf 1970-01-01 01:00:00.000000000 +0100 +++ util-vserver-0.30.207-poldek/distrib/pld-ac/poldek/poldek.conf 2005-05-17 15:21:01.922627888 +0200 @@ -0,0 +1,100 @@ +# $Id$ + +# main packages repository +source = ac ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/PLD/%ARCH%/PLD/RPMS/ + +# security updates after Ac gets frozen +source = ac-updates-security ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/updates/security/%ARCH%/ + +# non-critical fixes and updates which will be base for next version of Ac +source = ac-updates-general,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/updates/general/%ARCH%/ + +# other, sometimes obsolete, stuff +source = ac-supported,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/supported/%ARCH%/ + +# Things that are scheduled to move to updates/* +# Testers are *really* needed, but you have to know what are you doing +source = ac-ready,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/ready/%ARCH%/ + +# everything that is built by AC-builders: +source = ac-test,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/test/%ARCH%/ + +#source = nest-test,noauto ftp://ftp.nest.pld-linux.org/test/%ARCH%/ + +# NOTE: directory *must* exist; default is ${TMPDIR:-~/.poldek-cache} +# but if that fails /tmp is taken +cachedir = /var/tmp/poldek-cache + +# use root privileges for installation only; default "no" +#use_sudo = yes + + +# Installation options + +# install packages in small groups instead of doing all-or-nothing +# installation; default "yes" +particle_install = no + +# remove duplicate packages from available package set, i.e. this +# option ensures that only one instance (highest version from source +# with highest priority) of every package will be available +# for installation; default "no" +#unique_package_names = yes + +# automatically install packages required by installed ones; default "yes" +#follow = no + +# greedy upgrades; default "no" +#greedy = yes + +# "mercy" dependency checking; default "no" +#mercy = yes + +# don't remove downloaded packages after successful installation; default "no" +#keep_downloads = yes + +# confirm each installation; default "no" +#confirm_installs = yes + +# let the user select package among equivalents; default "no" +#choose_equivalents_manually = yes + + +# prevent kernel* and dev from being upgraded if they are already installed +#hold = kernel* dev + +# remove kernel* packages from available package set, i.e. make them +# invisible for the user +ignore = kernel* udev devfs + +# do not compare distribution versions of packages +#nodistver = no + +# External downloaders configuration +# Available semi-macros (as ws-separate tokens only): +# %p[n] - package basename +# %d - cache dir +# %D - cache dir/package basename +# %P[n] - package full path(URL) +# +# Hint: if you use several PLD powered machines, you may consider using a +# proxy server to speed up download. To make use of proxy with poldek set +# HTTP_PROXY and/or FTP_PROXY environment variables or setup transparent +# proxy and uncomment one of the lines below. For more info use man +# {poldek|wget|snarf|squid|ipchains or iptables} + +#ftp_get = /usr/bin/snarf %P %D +#ftp_get = /usr/bin/wget --dot-style=binary -P %d %Pn +#http_get = /usr/bin/wget -N --dot-style=binary -P %d %Pn +#http_get = /usr/bin/lwp-download %P %D +#https_get = /usr/bin/curl %P -o %D +#rsync_get = /usr/bin/rsync -v %P %d +#cdrom_get = /usr/bin/vfjuggle %d %Pn + + +# some rpm macros +#rpmdef = _install_langs pl:pl_PL:lt:lt_LT + +# don't install any documentation +#rpmdef = _netsharedpath /usr/share/info:/usr/share/man +#rpmdef = _excludedocs 1 diff -urN -x '*~' util-vserver-0.30.207/scripts/Makefile-files util-vserver-0.30.207-poldek/scripts/Makefile-files --- util-vserver-0.30.207/scripts/Makefile-files 2005-04-28 19:45:34.000000000 +0200 +++ util-vserver-0.30.207-poldek/scripts/Makefile-files 2005-05-17 15:47:26.101796048 +0200 @@ -21,6 +21,7 @@ scripts/vapt-get-worker \ scripts/vrpm-worker \ scripts/vyum-worker \ + scripts/vpoldek-worker \ scripts/vrpm-preload \ scripts/save_s_context \ scripts/vservers.grabinfo.sh \ @@ -43,11 +44,13 @@ scripts/vserver-build.debootstrap \ scripts/vserver-build.rpm \ scripts/vserver-build.yum \ + scripts/vserver-build.poldek \ scripts/vserver-build.functions \ scripts/vserver-build.functions.apt \ scripts/vserver-build.functions.rpm \ scripts/vserver-build.functions.pkgmgmt \ scripts/vserver-build.functions.yum \ + scripts/vserver-build.functions.poldek \ scripts/vserver-setup.functions \ scripts/vserver.functions \ scripts/vserver.start \ @@ -59,6 +62,7 @@ scripts_pkglib_src_SCRPTS = scripts/pkgmgmt \ scripts/vapt-get-worker \ scripts/vpkg \ + scripts/vpoldek-worker \ scripts/vrpm-worker \ scripts/vrpm-preload \ scripts/start-vservers \ @@ -80,6 +84,7 @@ scripts_sbin_src_PRGS = scripts/chcontext \ scripts/vapt-get \ + scripts/vpoldek \ scripts/vpstree \ scripts/vrpm \ scripts/vserver \ diff -urN -x '*~' util-vserver-0.30.207/scripts/functions util-vserver-0.30.207-poldek/scripts/functions --- util-vserver-0.30.207/scripts/functions 2005-04-28 20:02:27.000000000 +0200 +++ util-vserver-0.30.207-poldek/scripts/functions 2005-05-17 15:47:26.102795896 +0200 @@ -324,6 +324,20 @@ fi } +function _pkgSetVarsPoldek +{ + if test -n "$PKGDIR"; then + findDir POLDEKETCDIR $PKGDIR/poldeketc $PKGDIR/base/poldek/etc /etc + findDir POLDEKCACHEDIR $PKGDIR/poldek-cache $PKGDIR/base/poldek/cache + else + findDir POLDEKETCDIR "$VDIR"/etc /etc + findDir POLDEKCACHEDIR "$VDIR"/var/tmp/poldek-cache + fi + + findFile POLDEK_CONFIG "$POLDEKETCDIR"/poldek.conf "" + test -z "$POLDEK_CONFIG" || export POLDEK_CONFIG +} + function _pkgMountBase { @@ -397,6 +411,7 @@ rpm) _pkgSetVarsRPM;; apt) _pkgSetVarsApt;; yum) _pkgSetVarsYum;; + poldek) _pkgSetVarsPoldek;; *) echo "Unknown packaging flavor" >&2; exit 1;; esac done @@ -741,6 +743,27 @@ test -n "$have_yum" && return 0 || return 1 } +## Usage: pkgmgmt.isPoldekAvailable [] +function pkgmgmt.isPoldekAvailable +{ + local cfgdir="$1" + local vdir="$2" + local is_internal="$3" + + local have_poldek i + if test -n "$is_internal"; then + have_poldek=1 + test -d "$cfgdir"/base/poldek -o -d "$cfgdir"/poldeketc || have_poldek= + else + have_poldek= + for i in /bin /usr/bin /usr/local/bin; do + test ! -x "$vdir$i"/poldek || { have_poldek=1; break; } + done + fi + + test -n "$have_poldek" && return 0 || return 1 +} + function vshelper.doSanityCheck { diff -ur -x '*~' -x .libs -x .deps util-vserver-0.30.207/scripts/pkgmgmt util-vserver-0.30.207-poldek/scripts/pkgmgmt --- util-vserver-0.30.207/scripts/pkgmgmt 2005-04-28 20:03:22.000000000 +0200 +++ util-vserver-0.30.207-poldek/scripts/pkgmgmt 2005-05-20 18:36:25.812617328 +0200 @@ -174,7 +174,7 @@ " case $2 in - (RH) pkgs=$(vrpm "$1" -- -q --qf '---%{NAME}---\n' rpm apt yum "${YUM_RELEASEPKGS[@]}") + (RH) pkgs=$(vrpm "$1" -- -q --qf '---%{NAME}---\n' rpm apt yum poldek "${YUM_RELEASEPKGS[@]}") hasSubstring "$pkgs" ---rpm--- || { warning "$ERR * The vserver does not seem to have the 'rpm' package which is required @@ -184,9 +184,9 @@ ERR= } - hasSubstring "$pkgs" ---apt--- ---yum--- || { + hasSubstring "$pkgs" ---apt--- ---yum--- ---poldek--- || { warning "$ERR -* The vserver does not seem to have a depsolver like 'apt' or 'yum' +* The vserver does not seem to have a depsolver like 'apt', 'yum' or 'poldek' installed. It is suggested to install such a program before setting up internal package management." res=1 @@ -341,6 +341,131 @@ fi } +function processVserver_PLD() +{ + local vserver=$1 + local is_internalize=$2 + local cfgdir + local i + + cfgdir=$($_VSERVER_INFO "$vserver" APPDIR pkgmgmt) || \ + cfgdir=$($_VSERVER_INFO "$vserver" APPDIR)/pkgmgmt + + ## Figure out the environment.... + pkgmgmt.isPoldekAvailable "$cfgdir" "$vdir" "$is_internalize" || have_poldek= + + local POLDEKETCDIR= + local POLDEKCACHEDIR= + local RPMETCDIR= + local RPMSTATEDIR= + + ## Create directories and assign variables where configuration + ## can/will be found on the host + if test -n "$is_internalize"; then + verifyInternalPackages "$vserver" RH || test -n "$IS_FORCE" || + panic " +Can not continue; use '--force' to override this check" + + pushd "$vdir" >/dev/null + + test ! -L var/lib/rpm || { + $_EXEC_CD /var/lib $_RM rpm && + $_EXEC_CD /var/lib $_MKDIR -m755 rpm && + $_EXEC_CD /var/lib $_CHOWN rpm:rpm rpm || + : + } /dev/null + + for i in var/tmp/poldek-cache etc/rpm; do + test -d "$i" || + $_EXEC_CD /$(dirname "$i") $_MKDIR -m755 $(basename "$i") || : + done #2>/dev/null + + popd >/dev/null + + if test -n "$have_poldek"; then + findDir POLDEKETCDIR "$cfgdir"/poldeketc "$cfgdir"/base/poldek/etc /etc + fi + + findDir RPMETCDIR "$cfgdir"/rpmetc "$cfgdir"/base/rpm/etc /etc/rpm / + findDir RPMSTATEDIR "$cfgdir"/rpmstate "$cfgdir"/base/rpm/state + else + mkdir -m755 -p "$cfgdir" + local need_base= + + if test -n "$have_poldek"; then + findDir POLDEKETCDIR "$cfgdir"/poldeketc "$cfgdir"/base/poldek/etc /etc / + findDir POLDEKCACHEDIR "$cfgdir"/poldek-cache "$cfgdir"/base/poldek/cache / + + test "$POLDEKETCDIR" != / || POLDEKETCDIR=$cfgdir/base/poldek/etc + test "$POLDEKCACHEDIR" != / || POLDEKCACHEDIR=$cfgdir/base/poldek/cache + + test -d "$cfgdir"/poldeketc -a -d "$cfgdir"/poldek-cache || need_base=1 + fi + + findDir RPMETCDIR "$cfgdir"/rpmetc "$cfgdir"/base/rpm/etc / + findDir RPMSTATEDIR "$cfgdir"/rpmstate "$cfgdir"/base/rpm/state / + + test "$RPMETCDIR" != / || RPMETCDIR=$cfgdir/base/rpm/etc + test "$RPMSTATEDIR" != / || RPMSTATEDIR=$cfgdir/base/rpm/state + + test -d "$cfgdir"/rpmetc -a -d "$cfgdir"/rpmstate || need_base=1 + test ! -e "$cfgdir"/base || need_base= + + test -z "$need_base" || ln -s "$PKGCFGDIR" "$cfgdir"/base + + mkdir -m755 -p "$PKGCFGDIR" + _createDirs "$POLDEKETCDIR" "$POLDEKCACHEDIR" \ + "$RPMETCDIR" "$RPMSTATEDIR" + fi + + ## Copy the files... + if test -n "$is_internalize"; then + if test -n "$have_poldek"; then + _copySecure "$vdir" "$POLDEKETCDIR" /etc/poldek + pushd "$vdir" >/dev/null + _hashAuto /etc/poldek.conf '/' + popd >/dev/null + fi + + _copySecure "$vdir" "$RPMETCDIR" /etc/rpm + _copySecure "$vdir" "$RPMSTATEDIR" /var/lib/rpm + + pushd "$vdir" >/dev/null + ## remove %_dbpath settings + _substFile /etc/rpm/macros '/^%_dbpath[ \t].*/D' + popd >/dev/null + else + if test -n "$have_poldek"; then + _copySecureRev "$vdir" /etc/poldek "$POLDEKETCDIR" + _unhashAuto "$POLDEKETCDIR"/poldek.conf '/' + fi + + _copySecureRev "$vdir" /etc/rpm "$RPMETCDIR" + _copySecureRev "$vdir" /var/lib/rpm "$RPMSTATEDIR" + + echo -e "%_dbpath\t\t$rpmdb_mntpoint" >>$RPMETCDIR/macros + fi + + ## Cleanups... + if test -n "$is_internalize"; then + : + else + tmpdir=$($_MKTEMPDIR /var/tmp/pgmgmt.XXXXXX) + trap "$_RM -rf $tmpdir" EXIT + pushd "$vdir" >/dev/null + $_EXEC_CD /var/lib $_MV rpm $tmpdir/ + $_EXEC_CD /var/lib $_LN_S "$rpmdb_mntpoint" rpm + $_RM -rf $tmpdir + fi + + ## Finish it... + if test -n "$is_internalize"; then + $_TOUCH "$cfgdir"/internal + else + $_RM -f "$cfgdir"/internal + fi +} + function processVserver_Debian() { local vserver=$1 @@ -390,6 +509,7 @@ case "$style" in (redhat|mandrake) processVserver_RH "$vserver" "$IS_INTERNALIZE";; + (pld) processVserver_PLD "$vserver" "$IS_INTERNALIZE";; (debian) processVserver_Debian "$vserver" "$IS_INTERNALIZE";; (*) echo $"Vserver style '$style' is not supported for packagemanagment" >&2 diff -urN -x '*~' util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst --- util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst 2005-03-23 03:05:39.000000000 +0100 +++ util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst 2005-05-17 15:47:26.102795896 +0200 @@ -49,6 +49,7 @@ _LIB_VSERVER_BUILD_FUNCTIONS_RPM="$__PKGLIBDIR/vserver-build.functions.rpm" _LIB_VSERVER_BUILD_FUNCTIONS_YUM="$__PKGLIBDIR/vserver-build.functions.yum" _LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT="$__PKGLIBDIR/vserver-build.functions.pkgmgmt" +_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK="$__PKGLIBDIR/vserver-build.functions.poldek" _LISTDEVIP="$__LEGACYDIR/listdevip" _LOCKFILE="$__PKGLIBDIR/lockfile" _MASK2PREFIX="$__PKGLIBDIR/mask2prefix" @@ -91,6 +92,8 @@ _VUNIFY="$__PKGLIBDIR/vunify" _VYUM="$__SBINDIR/vyum" _VYUM_WORKER="$__PKGLIBDIR/vyum-worker" +_VPOLDEK="$__SBINDIR/vpoldek" +_VPOLDEK_WORKER="$__PKGLIBDIR/vpoldek-worker" _AWK="@AWK@" _CAT="@CAT@" diff -urN -x '*~' util-vserver-0.30.207/scripts/vpoldek util-vserver-0.30.207-poldek/scripts/vpoldek --- util-vserver-0.30.207/scripts/vpoldek 1970-01-01 01:00:00.000000000 +0100 +++ util-vserver-0.30.207-poldek/scripts/vpoldek 2005-05-17 15:47:26.103795744 +0200 @@ -0,0 +1,96 @@ +#! /bin/bash +# $Id$ + +# Copyright (C) 2003 Enrico Scholz +# +# 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. + +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} +test -e "$UTIL_VSERVER_VARS" || { + echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2 + exit 1 +} +. "$UTIL_VSERVER_VARS" +. "$_LIB_FUNCTIONS" + + +function showHelp() +{ + echo \ +$"Usage: $0 * [--all] -- + + +Report bugs to <$PACKAGE_BUGREPORT>." + exit 0 +} + +function showVersion() +{ + echo \ +$"vpoldek $PACKAGE_VERSION -- poldek for vservers +This program is part of $PACKAGE_STRING + +Copyright (C) 2003 Enrico Scholz +This program is free software; you may redistribute it under the terms of +the GNU General Public License. This program has absolutely no warranty." + exit 0 +} + +is_quiet= +declare -a vservers=() + +while test "$#" -ge 1; do + case "$1" in + --) shift; break;; + --help) showHelp $0;; + --quiet|-q) is_quiet=1 ;; + --all) + getAllVservers tmp + vservers=( "${vservers[@]}" "${tmp[@]}" ) + ;; + --version) + showVersion ;; + *) vservers=( "${vservers[@]}" "$1" ) + esac + shift +done + +cnt=0 +res=255 +for i in "${vservers[@]}"; do + cnt=$[ cnt + 1 ] + + test -n "$is_quiet" || { + colorize bold echo -n "vpoldek: operating on vserver " + colorize bold colorize emph echo "$i" + xtermTitle "vpoldek: operating on vserver '$i' [$cnt/${#vservers[@]}]" + } + + if pkgmgmt.isInternal "$i"; then + $_VSERVER "$i" exec poldek "$@" + else + callInNamespace "$i" \ + "$_VNAMESPACE" --new -- "$_VPOLDEK_WORKER" "$i" "$@" + fi + res=$? + + test $res -eq 0 -o -n "$is_quiet" || { + colorize error echo -n $"vpoldek failed on vserver '$i' with errorcode $res" + echo + } + + test -n "$is_quiet" || echo +done + +test "$cnt" -ge 0 || echo "No vservers specified" >&2 +exit $res diff -urN -x '*~' util-vserver-0.30.207/scripts/vpoldek-worker util-vserver-0.30.207-poldek/scripts/vpoldek-worker --- util-vserver-0.30.207/scripts/vpoldek-worker 1970-01-01 01:00:00.000000000 +0100 +++ util-vserver-0.30.207-poldek/scripts/vpoldek-worker 2005-05-17 17:50:10.974671552 +0200 @@ -0,0 +1,45 @@ +#! /bin/bash +# $Id$ + +# Copyright (C) 2003 Enrico Scholz +# +# 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. + +set -e + +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} +test -e "$UTIL_VSERVER_VARS" || { + echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2 + exit 1 +} +. "$UTIL_VSERVER_VARS" +. "$_LIB_FUNCTIONS" + + +vserver="$1" +shift + +pkgInit "$vserver" rpm poldek + +test -z "$_POLDEK" || { + warning $"The environment variable \$_POLDEK is not supported anymore; please use \$POLDEK instead of" + ${POLDEK:=$_POLDEK} +} + +exec ${_POLDEK:-poldek} \ + -v --root=$VDIR \ + --cachedir=$POLDEKCACHEDIR \ + --conf=$POLDEK_CONFIG \ + --pmcmd=$RPM_BINARY \ + "$@" diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build util-vserver-0.30.207-poldek/scripts/vserver-build --- util-vserver-0.30.207/scripts/vserver-build 2005-03-21 21:03:31.000000000 +0100 +++ util-vserver-0.30.207-poldek/scripts/vserver-build 2005-05-17 15:47:26.105795440 +0200 @@ -56,6 +56,9 @@ yum ... -- -d ... installs the base-packages of the given distribution with help of 'vyum' + poldek ... -- -d + ... installs the base-packages of the given distribution with + help of 'vpoldek' rpm ... -- [-d ] --empty|([--force] [--nodeps] )+ ... installs lists of rpm-packages skeleton ... -- [ *] @@ -121,7 +124,7 @@ case x"$method" in (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;; - (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm) + (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xpoldek) . $__PKGLIBDIR/vserver-build.$method ;; (x) panic $"No build-method specified";; diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build.functions.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek --- util-vserver-0.30.207/scripts/vserver-build.functions.poldek 1970-01-01 01:00:00.000000000 +0100 +++ util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek 2005-05-17 15:47:26.106795288 +0200 @@ -0,0 +1,67 @@ +# $Id$ --*- sh -*-- + +# Copyright (C) 2003 Enrico Scholz +# +# 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. + +function poldek.installBasePackages +{ + local name="$1" + local dir="$2" + + test "$dir" != / || return 0 + for filelist in "$dir"/*; do + isRegularFile "$filelist" || continue + local idx=0 + local can_fail=false + local flags='--install' + + set -- $(<$filelist) + while test "$#" -gt 0; do + case "$1" in + --reinstall) flags='--reinstall';; + --can-fail) can_fail=true;; + *) break;; + esac + shift + done + "$_VPOLDEK" "$name" -- $flags $* || $can_fail + done +} + +function poldek.initVariables +{ + findFile POLDEKCONFDEFAULT \ + "$__CONFDIR/.distributions/$DISTRIBUTION/poldek.conf" \ + "$__CONFDIR/.defaults/apps/pkgmgmt/poldek.conf" \ + "$__DISTRIBDIR/$DISTRIBUTION/poldek.conf" \ + "$__DISTRIBDIR/defaults/poldek.conf" \ + '' +} + +function poldek.initFilesystem +{ + mkdir -p "$PKGCFGDIR"/poldek/etc + mkdir -p "$PKGCFGBASE"/poldek-cache + + $_LN_S "$PKGCFGBASE"/poldek-cache "$PKGCFGDIR"/poldek/cache + + populateDirectory "$PKGCFGDIR/poldek/etc" \ + "$__DISTRIBDIR/defaults/poldek" \ + "$__DISTRIBDIR/$DISTRIBUTION/poldek" \ + "$__CONFDIR/.distributions/$DISTRIBUTION/poldek" + + test -z "$POLDEKCONFDEFAULT" || \ + $_LN_S "$POLDEKCONFDEFAULT" "$PKGCFGDIR"/poldek/etc/poldek.conf +} diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.poldek --- util-vserver-0.30.207/scripts/vserver-build.poldek 1970-01-01 01:00:00.000000000 +0100 +++ util-vserver-0.30.207-poldek/scripts/vserver-build.poldek 2005-05-17 15:47:26.106795288 +0200 @@ -0,0 +1,64 @@ +# $Id$ --*- sh -*-- + +# Copyright (C) 2003 Enrico Scholz +# +# 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. + +tmp=$(getopt -o +d: --long debug -n "$0" -- "$@") || exit 1 +eval set -- "$tmp" + +. "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM" +. "$_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK" +. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" + +while true; do + case "$1" in + (-d) DISTRIBUTION=$2; shift;; + (--debug) set -x;; + (--) shift; break ;; + (*) echo "vserver-build.poldek: internal error: unrecognized option '$1'" >&2 + exit 1 + ;; + esac + shift +done + +getDistribution + +base.init + +pkgmgmt.initVariables +rpm.initVariables +poldek.initVariables + +base.initFilesystem "$OPTION_FORCE" +pkgmgmt.initFilesystem "$OPTION_FORCE" +rpm.initFilesystem +poldek.initFilesystem + +setup_writeOption "$VSERVER_NAME" +setup_writeInitialFstab + +test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" +rpm.initDB "$SETUP_CONFDIR" +rpm.importGPGPubKeys "$SETUP_CONFDIR" \ + "$__CONFDIR/.distributions/$DISTRIBUTION/pubkeys" \ + "$__CONFDIR/.distributions/.common/pubkeys" \ + "$__DISTRIBDIR/$DISTRIBUTION/pubkeys" + +$_VPOLDEK "$SETUP_CONFDIR" -- --update-whole +poldek.installBasePackages "$SETUP_CONFDIR" "$PKGINSTALLDIR" +test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" + +base.setSuccess