]> git.pld-linux.org Git - packages/util-vserver.git/blame - util-vserver-build-poldek.patch
- updated to 0.30.209
[packages/util-vserver.git] / util-vserver-build-poldek.patch
CommitLineData
36705133
JR
1diff -urN -x '*~' util-vserver-0.30.207/distrib/Makefile.am util-vserver-0.30.207-poldek/distrib/Makefile.am
2--- util-vserver-0.30.207/distrib/Makefile.am 2005-05-17 17:53:31.514184912 +0200
3+++ util-vserver-0.30.207-poldek/distrib/Makefile.am 2005-05-17 16:39:41.661574720 +0200
4@@ -50,7 +50,8 @@
36705133
JR
5 fc2/apt/sources.list \
6 fc3/apt/sources.list \
ae9865f7 7 fc4/apt/sources.list \
36705133
JR
8- suse91/apt/sources.list
9+ suse91/apt/sources.list \
10+ pld2.0/poldek/poldek.conf
11
12 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT \
13 = $(nobase_distrib_SCRIPTS)
14@@ -69,6 +70,11 @@
15 ln -sf ../redhat/initpre $(DESTDIR)$(distribdir)/$$i/; \
16 done
17 ln -sf pld2.0 $(DESTDIR)$(distribdir)/pld1.99
18+ ln -sf pld2.0 $(DESTDIR)$(confdistribdir)/pld1.99
19+ POLDEKARCH=$(shell rpm -E '%{_target_cpu}' 2>/dev/null); \
20+ if [ -z "$$POLDEKARCH" ] ; then POLDEKARCH=$(shell uname -m) ; fi ; \
21+ sed "s|%ARCH%|$$POLDEKARCH|g" $(DESTDIR)$(confdistribdir)/pld2.0/poldek/poldek.conf > $(DESTDIR)$(confdistribdir)/pld2.0/poldek/poldek.conf.tmp ; \
22+ mv $(DESTDIR)$(confdistribdir)/pld2.0/poldek/poldek.conf.tmp $(DESTDIR)$(confdistribdir)/pld2.0/poldek/poldek.conf
23 $(mkinstalldirs) $(DESTDIR)$(confdir) \
24 $(DESTDIR)$(confdistribdir)/.common/pubkeys \
25 $(DESTDIR)$(confdefaultsdir) \
26diff -urN -x '*~' util-vserver-0.30.207/distrib/pld2.0/poldek/poldek.conf util-vserver-0.30.207-poldek/distrib/pld2.0/poldek/poldek.conf
27--- util-vserver-0.30.207/distrib/pld2.0/poldek/poldek.conf 1970-01-01 01:00:00.000000000 +0100
28+++ util-vserver-0.30.207-poldek/distrib/pld2.0/poldek/poldek.conf 2005-05-17 15:21:01.922627888 +0200
29@@ -0,0 +1,100 @@
30+# $Id$
31+
32+# main packages repository
33+source = ac ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/PLD/%ARCH%/PLD/RPMS/
34+
35+# security updates after Ac gets frozen
36+source = ac-updates-security ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/updates/security/%ARCH%/
37+
38+# non-critical fixes and updates which will be base for next version of Ac
39+source = ac-updates-general,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/updates/general/%ARCH%/
40+
41+# other, sometimes obsolete, stuff
42+source = ac-supported,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/supported/%ARCH%/
43+
44+# Things that are scheduled to move to updates/*
45+# Testers are *really* needed, but you have to know what are you doing
46+source = ac-ready,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/ready/%ARCH%/
47+
48+# everything that is built by AC-builders:
49+source = ac-test,noauto ftp://ftp.%ARCH%.ac.pld-linux.org/dists/ac/test/%ARCH%/
50+
51+#source = nest-test,noauto ftp://ftp.nest.pld-linux.org/test/%ARCH%/
52+
53+# NOTE: directory *must* exist; default is ${TMPDIR:-~/.poldek-cache}
54+# but if that fails /tmp is taken
55+cachedir = /var/tmp/poldek-cache
56+
57+# use root privileges for installation only; default "no"
58+#use_sudo = yes
59+
60+
61+# Installation options
62+
63+# install packages in small groups instead of doing all-or-nothing
64+# installation; default "yes"
65+particle_install = no
66+
67+# remove duplicate packages from available package set, i.e. this
68+# option ensures that only one instance (highest version from source
69+# with highest priority) of every package will be available
70+# for installation; default "no"
71+#unique_package_names = yes
72+
73+# automatically install packages required by installed ones; default "yes"
74+#follow = no
75+
76+# greedy upgrades; default "no"
77+#greedy = yes
78+
79+# "mercy" dependency checking; default "no"
80+#mercy = yes
81+
82+# don't remove downloaded packages after successful installation; default "no"
83+#keep_downloads = yes
84+
85+# confirm each installation; default "no"
86+#confirm_installs = yes
87+
88+# let the user select package among equivalents; default "no"
89+#choose_equivalents_manually = yes
90+
91+
92+# prevent kernel* and dev from being upgraded if they are already installed
93+#hold = kernel* dev
94+
95+# remove kernel* packages from available package set, i.e. make them
96+# invisible for the user
b830f972 97+ignore = kernel* dev devfs basesystem rc-scripts
36705133
JR
98+
99+# do not compare distribution versions of packages
100+#nodistver = no
101+
102+# External downloaders configuration
103+# Available semi-macros (as ws-separate tokens only):
104+# %p[n] - package basename
105+# %d - cache dir
106+# %D - cache dir/package basename
107+# %P[n] - package full path(URL)
108+#
109+# Hint: if you use several PLD powered machines, you may consider using a
110+# proxy server to speed up download. To make use of proxy with poldek set
111+# HTTP_PROXY and/or FTP_PROXY environment variables or setup transparent
112+# proxy and uncomment one of the lines below. For more info use man
113+# {poldek|wget|snarf|squid|ipchains or iptables}
114+
115+#ftp_get = /usr/bin/snarf %P %D
116+#ftp_get = /usr/bin/wget --dot-style=binary -P %d %Pn
117+#http_get = /usr/bin/wget -N --dot-style=binary -P %d %Pn
118+#http_get = /usr/bin/lwp-download %P %D
119+#https_get = /usr/bin/curl %P -o %D
120+#rsync_get = /usr/bin/rsync -v %P %d
121+#cdrom_get = /usr/bin/vfjuggle %d %Pn
122+
123+
124+# some rpm macros
125+#rpmdef = _install_langs pl:pl_PL:lt:lt_LT
126+
127+# don't install any documentation
128+#rpmdef = _netsharedpath /usr/share/info:/usr/share/man
129+#rpmdef = _excludedocs 1
130diff -urN -x '*~' util-vserver-0.30.207/scripts/Makefile-files util-vserver-0.30.207-poldek/scripts/Makefile-files
6c893a66 131--- util-vserver-0.30.207/scripts/Makefile-files 2005-04-28 19:45:34.000000000 +0200
36705133 132+++ util-vserver-0.30.207-poldek/scripts/Makefile-files 2005-05-17 15:47:26.101796048 +0200
6c893a66
JR
133@@ -21,6 +21,7 @@
134 scripts/vapt-get-worker \
135 scripts/vrpm-worker \
136 scripts/vyum-worker \
137+ scripts/vpoldek-worker \
138 scripts/vrpm-preload \
139 scripts/save_s_context \
140 scripts/vservers.grabinfo.sh \
141@@ -43,11 +44,13 @@
142 scripts/vserver-build.debootstrap \
143 scripts/vserver-build.rpm \
144 scripts/vserver-build.yum \
145+ scripts/vserver-build.poldek \
146 scripts/vserver-build.functions \
147 scripts/vserver-build.functions.apt \
148 scripts/vserver-build.functions.rpm \
149 scripts/vserver-build.functions.pkgmgmt \
150 scripts/vserver-build.functions.yum \
151+ scripts/vserver-build.functions.poldek \
152 scripts/vserver-setup.functions \
153 scripts/vserver.functions \
154 scripts/vserver.start \
155@@ -59,6 +62,7 @@
156 scripts_pkglib_src_SCRPTS = scripts/pkgmgmt \
157 scripts/vapt-get-worker \
158 scripts/vpkg \
159+ scripts/vpoldek-worker \
160 scripts/vrpm-worker \
161 scripts/vrpm-preload \
162 scripts/start-vservers \
163@@ -80,6 +84,7 @@
164
165 scripts_sbin_src_PRGS = scripts/chcontext \
166 scripts/vapt-get \
167+ scripts/vpoldek \
168 scripts/vpstree \
169 scripts/vrpm \
170 scripts/vserver \
36705133 171diff -urN -x '*~' util-vserver-0.30.207/scripts/functions util-vserver-0.30.207-poldek/scripts/functions
8373da2d 172--- util-vserver-0.30.207/scripts/functions 2005-04-28 20:02:27.000000000 +0200
36705133 173+++ util-vserver-0.30.207-poldek/scripts/functions 2005-05-17 15:47:26.102795896 +0200
8373da2d
JR
174@@ -324,6 +324,20 @@
175 fi
176 }
177
178+function _pkgSetVarsPoldek
179+{
180+ if test -n "$PKGDIR"; then
181+ findDir POLDEKETCDIR $PKGDIR/poldeketc $PKGDIR/base/poldek/etc /etc
36705133 182+ findDir POLDEKCACHEDIR $PKGDIR/poldek-cache $PKGDIR/base/poldek/cache
8373da2d
JR
183+ else
184+ findDir POLDEKETCDIR "$VDIR"/etc /etc
185+ findDir POLDEKCACHEDIR "$VDIR"/var/tmp/poldek-cache
186+ fi
187+
188+ findFile POLDEK_CONFIG "$POLDEKETCDIR"/poldek.conf ""
189+ test -z "$POLDEK_CONFIG" || export POLDEK_CONFIG
190+}
191+
192
193 function _pkgMountBase
194 {
195@@ -397,6 +411,7 @@
196 rpm) _pkgSetVarsRPM;;
197 apt) _pkgSetVarsApt;;
198 yum) _pkgSetVarsYum;;
199+ poldek) _pkgSetVarsPoldek;;
200 *) echo "Unknown packaging flavor" >&2; exit 1;;
201 esac
202 done
9ba4ee1d
JR
203@@ -741,6 +743,27 @@
204 test -n "$have_yum" && return 0 || return 1
205 }
206
207+## Usage: pkgmgmt.isPoldekAvailable <cfgdir> <vdir> [<is-internal>]
208+function pkgmgmt.isPoldekAvailable
209+{
210+ local cfgdir="$1"
211+ local vdir="$2"
212+ local is_internal="$3"
213+
214+ local have_poldek i
215+ if test -n "$is_internal"; then
216+ have_poldek=1
217+ test -d "$cfgdir"/base/poldek -o -d "$cfgdir"/poldeketc || have_poldek=
218+ else
219+ have_poldek=
220+ for i in /bin /usr/bin /usr/local/bin; do
221+ test ! -x "$vdir$i"/poldek || { have_poldek=1; break; }
222+ done
223+ fi
224+
225+ test -n "$have_poldek" && return 0 || return 1
226+}
227+
228
229 function vshelper.doSanityCheck
230 {
231diff -ur -x '*~' -x .libs -x .deps util-vserver-0.30.207/scripts/pkgmgmt util-vserver-0.30.207-poldek/scripts/pkgmgmt
232--- util-vserver-0.30.207/scripts/pkgmgmt 2005-04-28 20:03:22.000000000 +0200
233+++ util-vserver-0.30.207-poldek/scripts/pkgmgmt 2005-05-20 18:36:25.812617328 +0200
234@@ -174,7 +174,7 @@
235 "
236
237 case $2 in
238- (RH) pkgs=$(vrpm "$1" -- -q --qf '---%{NAME}---\n' rpm apt yum "${YUM_RELEASEPKGS[@]}")
239+ (RH) pkgs=$(vrpm "$1" -- -q --qf '---%{NAME}---\n' rpm apt yum poldek "${YUM_RELEASEPKGS[@]}")
240 hasSubstring "$pkgs" ---rpm--- || {
241 warning "$ERR
242 * The vserver does not seem to have the 'rpm' package which is required
243@@ -184,9 +184,9 @@
244 ERR=
245 }
246
247- hasSubstring "$pkgs" ---apt--- ---yum--- || {
248+ hasSubstring "$pkgs" ---apt--- ---yum--- ---poldek--- || {
249 warning "$ERR
250-* The vserver does not seem to have a depsolver like 'apt' or 'yum'
251+* The vserver does not seem to have a depsolver like 'apt', 'yum' or 'poldek'
252 installed. It is suggested to install such a program before setting
253 up internal package management."
254 res=1
edb01188 255@@ -341,6 +341,131 @@
9ba4ee1d
JR
256 fi
257 }
258
259+function processVserver_PLD()
260+{
261+ local vserver=$1
262+ local is_internalize=$2
263+ local cfgdir
264+ local i
265+
266+ cfgdir=$($_VSERVER_INFO "$vserver" APPDIR pkgmgmt) || \
267+ cfgdir=$($_VSERVER_INFO "$vserver" APPDIR)/pkgmgmt
268+
269+ ## Figure out the environment....
270+ pkgmgmt.isPoldekAvailable "$cfgdir" "$vdir" "$is_internalize" || have_poldek=
271+
272+ local POLDEKETCDIR=
273+ local POLDEKCACHEDIR=
274+ local RPMETCDIR=
275+ local RPMSTATEDIR=
276+
277+ ## Create directories and assign variables where configuration
278+ ## can/will be found on the host
279+ if test -n "$is_internalize"; then
280+ verifyInternalPackages "$vserver" RH || test -n "$IS_FORCE" ||
281+ panic "
282+Can not continue; use '--force' to override this check"
283+
284+ pushd "$vdir" >/dev/null
285+
286+ test ! -L var/lib/rpm || {
287+ $_EXEC_CD /var/lib $_RM rpm &&
288+ $_EXEC_CD /var/lib $_MKDIR -m755 rpm &&
289+ $_EXEC_CD /var/lib $_CHOWN rpm:rpm rpm ||
290+ :
291+ } </dev/null 2>/dev/null
292+
293+ for i in var/tmp/poldek-cache etc/rpm; do
294+ test -d "$i" ||
295+ $_EXEC_CD /$(dirname "$i") $_MKDIR -m755 $(basename "$i") || :
296+ done #2>/dev/null
297+
298+ popd >/dev/null
299+
300+ if test -n "$have_poldek"; then
301+ findDir POLDEKETCDIR "$cfgdir"/poldeketc "$cfgdir"/base/poldek/etc /etc
302+ fi
303+
304+ findDir RPMETCDIR "$cfgdir"/rpmetc "$cfgdir"/base/rpm/etc /etc/rpm /
305+ findDir RPMSTATEDIR "$cfgdir"/rpmstate "$cfgdir"/base/rpm/state
306+ else
307+ mkdir -m755 -p "$cfgdir"
308+ local need_base=
309+
310+ if test -n "$have_poldek"; then
311+ findDir POLDEKETCDIR "$cfgdir"/poldeketc "$cfgdir"/base/poldek/etc /etc /
312+ findDir POLDEKCACHEDIR "$cfgdir"/poldek-cache "$cfgdir"/base/poldek/cache /
313+
314+ test "$POLDEKETCDIR" != / || POLDEKETCDIR=$cfgdir/base/poldek/etc
315+ test "$POLDEKCACHEDIR" != / || POLDEKCACHEDIR=$cfgdir/base/poldek/cache
316+
317+ test -d "$cfgdir"/poldeketc -a -d "$cfgdir"/poldek-cache || need_base=1
318+ fi
319+
320+ findDir RPMETCDIR "$cfgdir"/rpmetc "$cfgdir"/base/rpm/etc /
321+ findDir RPMSTATEDIR "$cfgdir"/rpmstate "$cfgdir"/base/rpm/state /
322+
323+ test "$RPMETCDIR" != / || RPMETCDIR=$cfgdir/base/rpm/etc
324+ test "$RPMSTATEDIR" != / || RPMSTATEDIR=$cfgdir/base/rpm/state
325+
326+ test -d "$cfgdir"/rpmetc -a -d "$cfgdir"/rpmstate || need_base=1
327+ test ! -e "$cfgdir"/base || need_base=
328+
329+ test -z "$need_base" || ln -s "$PKGCFGDIR" "$cfgdir"/base
330+
331+ mkdir -m755 -p "$PKGCFGDIR"
332+ _createDirs "$POLDEKETCDIR" "$POLDEKCACHEDIR" \
333+ "$RPMETCDIR" "$RPMSTATEDIR"
334+ fi
335+
336+ ## Copy the files...
337+ if test -n "$is_internalize"; then
338+ if test -n "$have_poldek"; then
339+ _copySecure "$vdir" "$POLDEKETCDIR" /etc/poldek
340+ pushd "$vdir" >/dev/null
341+ _hashAuto /etc/poldek.conf '/'
342+ popd >/dev/null
343+ fi
344+
345+ _copySecure "$vdir" "$RPMETCDIR" /etc/rpm
346+ _copySecure "$vdir" "$RPMSTATEDIR" /var/lib/rpm
347+
edb01188
JR
348+ pushd "$vdir" >/dev/null
349+ ## remove %_dbpath settings
350+ _substFile /etc/rpm/macros '/^%_dbpath[ \t].*/D'
351+ popd >/dev/null
9ba4ee1d
JR
352+ else
353+ if test -n "$have_poldek"; then
354+ _copySecureRev "$vdir" /etc/poldek "$POLDEKETCDIR"
355+ _unhashAuto "$POLDEKETCDIR"/poldek.conf '/'
356+ fi
357+
358+ _copySecureRev "$vdir" /etc/rpm "$RPMETCDIR"
359+ _copySecureRev "$vdir" /var/lib/rpm "$RPMSTATEDIR"
edb01188
JR
360+
361+ echo -e "%_dbpath\t\t$rpmdb_mntpoint" >>$RPMETCDIR/macros
9ba4ee1d
JR
362+ fi
363+
364+ ## Cleanups...
365+ if test -n "$is_internalize"; then
366+ :
367+ else
368+ tmpdir=$($_MKTEMPDIR /var/tmp/pgmgmt.XXXXXX)
369+ trap "$_RM -rf $tmpdir" EXIT
370+ pushd "$vdir" >/dev/null
371+ $_EXEC_CD /var/lib $_MV rpm $tmpdir/
372+ $_EXEC_CD /var/lib $_LN_S "$rpmdb_mntpoint" rpm
373+ $_RM -rf $tmpdir
374+ fi
375+
376+ ## Finish it...
377+ if test -n "$is_internalize"; then
378+ $_TOUCH "$cfgdir"/internal
379+ else
380+ $_RM -f "$cfgdir"/internal
381+ fi
382+}
383+
384 function processVserver_Debian()
385 {
386 local vserver=$1
387@@ -390,6 +509,7 @@
388
389 case "$style" in
390 (redhat|mandrake) processVserver_RH "$vserver" "$IS_INTERNALIZE";;
391+ (pld) processVserver_PLD "$vserver" "$IS_INTERNALIZE";;
392 (debian) processVserver_Debian "$vserver" "$IS_INTERNALIZE";;
393 (*)
394 echo $"Vserver style '$style' is not supported for packagemanagment" >&2
36705133 395diff -urN -x '*~' util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst
6c893a66 396--- util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst 2005-03-23 03:05:39.000000000 +0100
36705133 397+++ util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst 2005-05-17 15:47:26.102795896 +0200
6c893a66
JR
398@@ -49,6 +49,7 @@
399 _LIB_VSERVER_BUILD_FUNCTIONS_RPM="$__PKGLIBDIR/vserver-build.functions.rpm"
400 _LIB_VSERVER_BUILD_FUNCTIONS_YUM="$__PKGLIBDIR/vserver-build.functions.yum"
401 _LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT="$__PKGLIBDIR/vserver-build.functions.pkgmgmt"
402+_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK="$__PKGLIBDIR/vserver-build.functions.poldek"
403 _LISTDEVIP="$__LEGACYDIR/listdevip"
404 _LOCKFILE="$__PKGLIBDIR/lockfile"
405 _MASK2PREFIX="$__PKGLIBDIR/mask2prefix"
406@@ -91,6 +92,8 @@
407 _VUNIFY="$__PKGLIBDIR/vunify"
408 _VYUM="$__SBINDIR/vyum"
409 _VYUM_WORKER="$__PKGLIBDIR/vyum-worker"
410+_VPOLDEK="$__SBINDIR/vpoldek"
411+_VPOLDEK_WORKER="$__PKGLIBDIR/vpoldek-worker"
412
413 _AWK="@AWK@"
414 _CAT="@CAT@"
36705133 415diff -urN -x '*~' util-vserver-0.30.207/scripts/vpoldek util-vserver-0.30.207-poldek/scripts/vpoldek
6c893a66 416--- util-vserver-0.30.207/scripts/vpoldek 1970-01-01 01:00:00.000000000 +0100
36705133 417+++ util-vserver-0.30.207-poldek/scripts/vpoldek 2005-05-17 15:47:26.103795744 +0200
b8ffb90d 418@@ -0,0 +1,96 @@
6c893a66
JR
419+#! /bin/bash
420+# $Id$
421+
422+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
423+#
424+# This program is free software; you can redistribute it and/or modify
425+# it under the terms of the GNU General Public License as published by
426+# the Free Software Foundation; version 2 of the License.
427+#
428+# This program is distributed in the hope that it will be useful,
429+# but WITHOUT ANY WARRANTY; without even the implied warranty of
430+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
431+# GNU General Public License for more details.
432+#
433+# You should have received a copy of the GNU General Public License
434+# along with this program; if not, write to the Free Software
435+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
436+
0e1ca031 437+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
6c893a66
JR
438+test -e "$UTIL_VSERVER_VARS" || {
439+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
440+ exit 1
441+}
442+. "$UTIL_VSERVER_VARS"
443+. "$_LIB_FUNCTIONS"
444+
445+
446+function showHelp()
447+{
448+ echo \
449+$"Usage: $0 <vserver-name>* [--all] -- <params>+
450+
451+Report bugs to <$PACKAGE_BUGREPORT>."
b8ffb90d 452+ exit 0
6c893a66
JR
453+}
454+
455+function showVersion()
456+{
457+ echo \
458+$"vpoldek $PACKAGE_VERSION -- poldek for vservers
459+This program is part of $PACKAGE_STRING
460+
461+Copyright (C) 2003 Enrico Scholz
462+This program is free software; you may redistribute it under the terms of
463+the GNU General Public License. This program has absolutely no warranty."
b8ffb90d 464+ exit 0
6c893a66
JR
465+}
466+
467+is_quiet=
468+declare -a vservers=()
469+
470+while test "$#" -ge 1; do
471+ case "$1" in
472+ --) shift; break;;
b8ffb90d 473+ --help) showHelp $0;;
6c893a66
JR
474+ --quiet|-q) is_quiet=1 ;;
475+ --all)
476+ getAllVservers tmp
477+ vservers=( "${vservers[@]}" "${tmp[@]}" )
478+ ;;
479+ --version)
b8ffb90d 480+ showVersion ;;
6c893a66
JR
481+ *) vservers=( "${vservers[@]}" "$1" )
482+ esac
483+ shift
484+done
485+
6c893a66
JR
486+cnt=0
487+res=255
488+for i in "${vservers[@]}"; do
489+ cnt=$[ cnt + 1 ]
490+
491+ test -n "$is_quiet" || {
492+ colorize bold echo -n "vpoldek: operating on vserver "
493+ colorize bold colorize emph echo "$i"
494+ xtermTitle "vpoldek: operating on vserver '$i' [$cnt/${#vservers[@]}]"
495+ }
496+
497+ if pkgmgmt.isInternal "$i"; then
498+ $_VSERVER "$i" exec poldek "$@"
499+ else
500+ callInNamespace "$i" \
501+ "$_VNAMESPACE" --new -- "$_VPOLDEK_WORKER" "$i" "$@"
502+ fi
503+ res=$?
504+
505+ test $res -eq 0 -o -n "$is_quiet" || {
506+ colorize error echo -n $"vpoldek failed on vserver '$i' with errorcode $res"
507+ echo
508+ }
509+
510+ test -n "$is_quiet" || echo
511+done
512+
513+test "$cnt" -ge 0 || echo "No vservers specified" >&2
514+exit $res
36705133 515diff -urN -x '*~' util-vserver-0.30.207/scripts/vpoldek-worker util-vserver-0.30.207-poldek/scripts/vpoldek-worker
6c893a66 516--- util-vserver-0.30.207/scripts/vpoldek-worker 1970-01-01 01:00:00.000000000 +0100
36705133 517+++ util-vserver-0.30.207-poldek/scripts/vpoldek-worker 2005-05-17 17:50:10.974671552 +0200
afcd33de 518@@ -0,0 +1,45 @@
6c893a66
JR
519+#! /bin/bash
520+# $Id$
521+
522+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
523+#
524+# This program is free software; you can redistribute it and/or modify
525+# it under the terms of the GNU General Public License as published by
526+# the Free Software Foundation; version 2 of the License.
527+#
528+# This program is distributed in the hope that it will be useful,
529+# but WITHOUT ANY WARRANTY; without even the implied warranty of
530+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
531+# GNU General Public License for more details.
532+#
533+# You should have received a copy of the GNU General Public License
534+# along with this program; if not, write to the Free Software
535+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
536+
537+set -e
538+
0e1ca031 539+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
6c893a66
JR
540+test -e "$UTIL_VSERVER_VARS" || {
541+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
542+ exit 1
543+}
544+. "$UTIL_VSERVER_VARS"
545+. "$_LIB_FUNCTIONS"
546+
547+
548+vserver="$1"
549+shift
550+
9ba4ee1d 551+pkgInit "$vserver" rpm poldek
6c893a66
JR
552+
553+test -z "$_POLDEK" || {
554+ warning $"The environment variable \$_POLDEK is not supported anymore; please use \$POLDEK instead of"
555+ ${POLDEK:=$_POLDEK}
556+}
557+
36705133
JR
558+exec ${_POLDEK:-poldek} \
559+ -v --root=$VDIR \
560+ --cachedir=$POLDEKCACHEDIR \
561+ --conf=$POLDEK_CONFIG \
f2452f9f 562+ --pmcmd=$RPM_BINARY \
36705133
JR
563+ "$@"
564diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build util-vserver-0.30.207-poldek/scripts/vserver-build
6c893a66 565--- util-vserver-0.30.207/scripts/vserver-build 2005-03-21 21:03:31.000000000 +0100
36705133 566+++ util-vserver-0.30.207-poldek/scripts/vserver-build 2005-05-17 15:47:26.105795440 +0200
6c893a66
JR
567@@ -56,6 +56,9 @@
568 yum ... -- -d <distribution>
569 ... installs the base-packages of the given distribution with
570 help of 'vyum'
571+ poldek ... -- -d <distribution>
572+ ... installs the base-packages of the given distribution with
573+ help of 'vpoldek'
574 rpm ... -- [-d <distribution>] --empty|([--force] [--nodeps] <manifest>)+
575 ... installs lists of rpm-packages
576 skeleton ... -- [<cmd> <args>*]
577@@ -121,7 +124,7 @@
578
579 case x"$method" in
580 (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;;
581- (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm)
582+ (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xpoldek)
583 . $__PKGLIBDIR/vserver-build.$method
584 ;;
585 (x) panic $"No build-method specified";;
36705133 586diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build.functions.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek
6c893a66 587--- util-vserver-0.30.207/scripts/vserver-build.functions.poldek 1970-01-01 01:00:00.000000000 +0100
36705133
JR
588+++ util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek 2005-05-17 15:47:26.106795288 +0200
589@@ -0,0 +1,67 @@
6c893a66
JR
590+# $Id$ --*- sh -*--
591+
592+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
593+#
594+# This program is free software; you can redistribute it and/or modify
595+# it under the terms of the GNU General Public License as published by
596+# the Free Software Foundation; version 2 of the License.
597+#
598+# This program is distributed in the hope that it will be useful,
599+# but WITHOUT ANY WARRANTY; without even the implied warranty of
600+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
601+# GNU General Public License for more details.
602+#
603+# You should have received a copy of the GNU General Public License
604+# along with this program; if not, write to the Free Software
605+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
606+
607+function poldek.installBasePackages
608+{
609+ local name="$1"
610+ local dir="$2"
611+
612+ test "$dir" != / || return 0
613+ for filelist in "$dir"/*; do
614+ isRegularFile "$filelist" || continue
615+ local idx=0
616+ local can_fail=false
afcd33de 617+ local flags='--install'
6c893a66
JR
618+
619+ set -- $(<$filelist)
620+ while test "$#" -gt 0; do
621+ case "$1" in
622+ --reinstall) flags='--reinstall';;
623+ --can-fail) can_fail=true;;
624+ *) break;;
625+ esac
626+ shift
627+ done
afcd33de 628+ "$_VPOLDEK" "$name" -- $flags $* || $can_fail
6c893a66
JR
629+ done
630+}
631+
632+function poldek.initVariables
633+{
36705133 634+ findFile POLDEKCONFDEFAULT \
6c893a66
JR
635+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek.conf" \
636+ "$__CONFDIR/.defaults/apps/pkgmgmt/poldek.conf" \
637+ "$__DISTRIBDIR/$DISTRIBUTION/poldek.conf" \
638+ "$__DISTRIBDIR/defaults/poldek.conf" \
639+ ''
640+}
641+
642+function poldek.initFilesystem
643+{
36705133 644+ mkdir -p "$PKGCFGDIR"/poldek/etc
0b87f1d5 645+ mkdir -p "$PKGCFGBASE"/poldek-cache
36705133
JR
646+
647+ $_LN_S "$PKGCFGBASE"/poldek-cache "$PKGCFGDIR"/poldek/cache
648+
6c893a66
JR
649+ populateDirectory "$PKGCFGDIR/poldek/etc" \
650+ "$__DISTRIBDIR/defaults/poldek" \
651+ "$__DISTRIBDIR/$DISTRIBUTION/poldek" \
652+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek"
653+
654+ test -z "$POLDEKCONFDEFAULT" || \
655+ $_LN_S "$POLDEKCONFDEFAULT" "$PKGCFGDIR"/poldek/etc/poldek.conf
656+}
36705133 657diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.poldek
6c893a66 658--- util-vserver-0.30.207/scripts/vserver-build.poldek 1970-01-01 01:00:00.000000000 +0100
36705133 659+++ util-vserver-0.30.207-poldek/scripts/vserver-build.poldek 2005-05-17 15:47:26.106795288 +0200
9bed2938 660@@ -0,0 +1,64 @@
6c893a66
JR
661+# $Id$ --*- sh -*--
662+
663+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
664+#
665+# This program is free software; you can redistribute it and/or modify
666+# it under the terms of the GNU General Public License as published by
667+# the Free Software Foundation; version 2 of the License.
668+#
669+# This program is distributed in the hope that it will be useful,
670+# but WITHOUT ANY WARRANTY; without even the implied warranty of
671+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
672+# GNU General Public License for more details.
673+#
674+# You should have received a copy of the GNU General Public License
675+# along with this program; if not, write to the Free Software
676+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
677+
678+tmp=$(getopt -o +d: --long debug -n "$0" -- "$@") || exit 1
679+eval set -- "$tmp"
680+
9ba4ee1d 681+. "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM"
6c893a66
JR
682+. "$_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK"
683+. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
684+
685+while true; do
686+ case "$1" in
687+ (-d) DISTRIBUTION=$2; shift;;
688+ (--debug) set -x;;
689+ (--) shift; break ;;
b8ffb90d 690+ (*) echo "vserver-build.poldek: internal error: unrecognized option '$1'" >&2
6c893a66
JR
691+ exit 1
692+ ;;
693+ esac
694+ shift
695+done
696+
697+getDistribution
698+
9bed2938
JR
699+base.init
700+
6c893a66 701+pkgmgmt.initVariables
9ba4ee1d 702+rpm.initVariables
6c893a66
JR
703+poldek.initVariables
704+
705+base.initFilesystem "$OPTION_FORCE"
706+pkgmgmt.initFilesystem "$OPTION_FORCE"
9ba4ee1d 707+rpm.initFilesystem
6c893a66
JR
708+poldek.initFilesystem
709+
710+setup_writeOption "$VSERVER_NAME"
711+setup_writeInitialFstab
712+
713+test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
9ba4ee1d
JR
714+rpm.initDB "$SETUP_CONFDIR"
715+rpm.importGPGPubKeys "$SETUP_CONFDIR" \
716+ "$__CONFDIR/.distributions/$DISTRIBUTION/pubkeys" \
717+ "$__CONFDIR/.distributions/.common/pubkeys" \
718+ "$__DISTRIBDIR/$DISTRIBUTION/pubkeys"
6c893a66
JR
719+
720+$_VPOLDEK "$SETUP_CONFDIR" -- --update-whole
721+poldek.installBasePackages "$SETUP_CONFDIR" "$PKGINSTALLDIR"
6c893a66 722+test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
9bed2938
JR
723+
724+base.setSuccess
This page took 0.123814 seconds and 4 git commands to generate.