]> git.pld-linux.org Git - packages/util-vserver.git/blame - util-vserver-build-poldek.patch
- more 0.30.208 update
[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
97+ignore = kernel* dev devfs basesystem rc-scripts SysVinit
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
255@@ -341,6 +341,125 @@
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+
348+ else
349+ if test -n "$have_poldek"; then
350+ _copySecureRev "$vdir" /etc/poldek "$POLDEKETCDIR"
351+ _unhashAuto "$POLDEKETCDIR"/poldek.conf '/'
352+ fi
353+
354+ _copySecureRev "$vdir" /etc/rpm "$RPMETCDIR"
355+ _copySecureRev "$vdir" /var/lib/rpm "$RPMSTATEDIR"
356+ fi
357+
358+ ## Cleanups...
359+ if test -n "$is_internalize"; then
360+ :
361+ else
362+ tmpdir=$($_MKTEMPDIR /var/tmp/pgmgmt.XXXXXX)
363+ trap "$_RM -rf $tmpdir" EXIT
364+ pushd "$vdir" >/dev/null
365+ $_EXEC_CD /var/lib $_MV rpm $tmpdir/
366+ $_EXEC_CD /var/lib $_LN_S "$rpmdb_mntpoint" rpm
367+ $_RM -rf $tmpdir
368+ fi
369+
370+ ## Finish it...
371+ if test -n "$is_internalize"; then
372+ $_TOUCH "$cfgdir"/internal
373+ else
374+ $_RM -f "$cfgdir"/internal
375+ fi
376+}
377+
378 function processVserver_Debian()
379 {
380 local vserver=$1
381@@ -390,6 +509,7 @@
382
383 case "$style" in
384 (redhat|mandrake) processVserver_RH "$vserver" "$IS_INTERNALIZE";;
385+ (pld) processVserver_PLD "$vserver" "$IS_INTERNALIZE";;
386 (debian) processVserver_Debian "$vserver" "$IS_INTERNALIZE";;
387 (*)
388 echo $"Vserver style '$style' is not supported for packagemanagment" >&2
36705133 389diff -urN -x '*~' util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst
6c893a66 390--- util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst 2005-03-23 03:05:39.000000000 +0100
36705133 391+++ util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst 2005-05-17 15:47:26.102795896 +0200
6c893a66
JR
392@@ -49,6 +49,7 @@
393 _LIB_VSERVER_BUILD_FUNCTIONS_RPM="$__PKGLIBDIR/vserver-build.functions.rpm"
394 _LIB_VSERVER_BUILD_FUNCTIONS_YUM="$__PKGLIBDIR/vserver-build.functions.yum"
395 _LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT="$__PKGLIBDIR/vserver-build.functions.pkgmgmt"
396+_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK="$__PKGLIBDIR/vserver-build.functions.poldek"
397 _LISTDEVIP="$__LEGACYDIR/listdevip"
398 _LOCKFILE="$__PKGLIBDIR/lockfile"
399 _MASK2PREFIX="$__PKGLIBDIR/mask2prefix"
400@@ -91,6 +92,8 @@
401 _VUNIFY="$__PKGLIBDIR/vunify"
402 _VYUM="$__SBINDIR/vyum"
403 _VYUM_WORKER="$__PKGLIBDIR/vyum-worker"
404+_VPOLDEK="$__SBINDIR/vpoldek"
405+_VPOLDEK_WORKER="$__PKGLIBDIR/vpoldek-worker"
406
407 _AWK="@AWK@"
408 _CAT="@CAT@"
36705133 409diff -urN -x '*~' util-vserver-0.30.207/scripts/vpoldek util-vserver-0.30.207-poldek/scripts/vpoldek
6c893a66 410--- util-vserver-0.30.207/scripts/vpoldek 1970-01-01 01:00:00.000000000 +0100
36705133 411+++ util-vserver-0.30.207-poldek/scripts/vpoldek 2005-05-17 15:47:26.103795744 +0200
b8ffb90d 412@@ -0,0 +1,96 @@
6c893a66
JR
413+#! /bin/bash
414+# $Id$
415+
416+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
417+#
418+# This program is free software; you can redistribute it and/or modify
419+# it under the terms of the GNU General Public License as published by
420+# the Free Software Foundation; version 2 of the License.
421+#
422+# This program is distributed in the hope that it will be useful,
423+# but WITHOUT ANY WARRANTY; without even the implied warranty of
424+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425+# GNU General Public License for more details.
426+#
427+# You should have received a copy of the GNU General Public License
428+# along with this program; if not, write to the Free Software
429+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
430+
0e1ca031 431+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
6c893a66
JR
432+test -e "$UTIL_VSERVER_VARS" || {
433+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
434+ exit 1
435+}
436+. "$UTIL_VSERVER_VARS"
437+. "$_LIB_FUNCTIONS"
438+
439+
440+function showHelp()
441+{
442+ echo \
443+$"Usage: $0 <vserver-name>* [--all] -- <params>+
444+
445+Report bugs to <$PACKAGE_BUGREPORT>."
b8ffb90d 446+ exit 0
6c893a66
JR
447+}
448+
449+function showVersion()
450+{
451+ echo \
452+$"vpoldek $PACKAGE_VERSION -- poldek for vservers
453+This program is part of $PACKAGE_STRING
454+
455+Copyright (C) 2003 Enrico Scholz
456+This program is free software; you may redistribute it under the terms of
457+the GNU General Public License. This program has absolutely no warranty."
b8ffb90d 458+ exit 0
6c893a66
JR
459+}
460+
461+is_quiet=
462+declare -a vservers=()
463+
464+while test "$#" -ge 1; do
465+ case "$1" in
466+ --) shift; break;;
b8ffb90d 467+ --help) showHelp $0;;
6c893a66
JR
468+ --quiet|-q) is_quiet=1 ;;
469+ --all)
470+ getAllVservers tmp
471+ vservers=( "${vservers[@]}" "${tmp[@]}" )
472+ ;;
473+ --version)
b8ffb90d 474+ showVersion ;;
6c893a66
JR
475+ *) vservers=( "${vservers[@]}" "$1" )
476+ esac
477+ shift
478+done
479+
6c893a66
JR
480+cnt=0
481+res=255
482+for i in "${vservers[@]}"; do
483+ cnt=$[ cnt + 1 ]
484+
485+ test -n "$is_quiet" || {
486+ colorize bold echo -n "vpoldek: operating on vserver "
487+ colorize bold colorize emph echo "$i"
488+ xtermTitle "vpoldek: operating on vserver '$i' [$cnt/${#vservers[@]}]"
489+ }
490+
491+ if pkgmgmt.isInternal "$i"; then
492+ $_VSERVER "$i" exec poldek "$@"
493+ else
494+ callInNamespace "$i" \
495+ "$_VNAMESPACE" --new -- "$_VPOLDEK_WORKER" "$i" "$@"
496+ fi
497+ res=$?
498+
499+ test $res -eq 0 -o -n "$is_quiet" || {
500+ colorize error echo -n $"vpoldek failed on vserver '$i' with errorcode $res"
501+ echo
502+ }
503+
504+ test -n "$is_quiet" || echo
505+done
506+
507+test "$cnt" -ge 0 || echo "No vservers specified" >&2
508+exit $res
36705133 509diff -urN -x '*~' util-vserver-0.30.207/scripts/vpoldek-worker util-vserver-0.30.207-poldek/scripts/vpoldek-worker
6c893a66 510--- util-vserver-0.30.207/scripts/vpoldek-worker 1970-01-01 01:00:00.000000000 +0100
36705133 511+++ util-vserver-0.30.207-poldek/scripts/vpoldek-worker 2005-05-17 17:50:10.974671552 +0200
afcd33de 512@@ -0,0 +1,45 @@
6c893a66
JR
513+#! /bin/bash
514+# $Id$
515+
516+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
517+#
518+# This program is free software; you can redistribute it and/or modify
519+# it under the terms of the GNU General Public License as published by
520+# the Free Software Foundation; version 2 of the License.
521+#
522+# This program is distributed in the hope that it will be useful,
523+# but WITHOUT ANY WARRANTY; without even the implied warranty of
524+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
525+# GNU General Public License for more details.
526+#
527+# You should have received a copy of the GNU General Public License
528+# along with this program; if not, write to the Free Software
529+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
530+
531+set -e
532+
0e1ca031 533+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
6c893a66
JR
534+test -e "$UTIL_VSERVER_VARS" || {
535+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
536+ exit 1
537+}
538+. "$UTIL_VSERVER_VARS"
539+. "$_LIB_FUNCTIONS"
540+
541+
542+vserver="$1"
543+shift
544+
9ba4ee1d 545+pkgInit "$vserver" rpm poldek
6c893a66
JR
546+
547+test -z "$_POLDEK" || {
548+ warning $"The environment variable \$_POLDEK is not supported anymore; please use \$POLDEK instead of"
549+ ${POLDEK:=$_POLDEK}
550+}
551+
36705133
JR
552+exec ${_POLDEK:-poldek} \
553+ -v --root=$VDIR \
554+ --cachedir=$POLDEKCACHEDIR \
555+ --conf=$POLDEK_CONFIG \
f2452f9f 556+ --pmcmd=$RPM_BINARY \
36705133
JR
557+ "$@"
558diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build util-vserver-0.30.207-poldek/scripts/vserver-build
6c893a66 559--- util-vserver-0.30.207/scripts/vserver-build 2005-03-21 21:03:31.000000000 +0100
36705133 560+++ util-vserver-0.30.207-poldek/scripts/vserver-build 2005-05-17 15:47:26.105795440 +0200
6c893a66
JR
561@@ -56,6 +56,9 @@
562 yum ... -- -d <distribution>
563 ... installs the base-packages of the given distribution with
564 help of 'vyum'
565+ poldek ... -- -d <distribution>
566+ ... installs the base-packages of the given distribution with
567+ help of 'vpoldek'
568 rpm ... -- [-d <distribution>] --empty|([--force] [--nodeps] <manifest>)+
569 ... installs lists of rpm-packages
570 skeleton ... -- [<cmd> <args>*]
571@@ -121,7 +124,7 @@
572
573 case x"$method" in
574 (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;;
575- (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm)
576+ (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xpoldek)
577 . $__PKGLIBDIR/vserver-build.$method
578 ;;
579 (x) panic $"No build-method specified";;
36705133 580diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build.functions.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek
6c893a66 581--- util-vserver-0.30.207/scripts/vserver-build.functions.poldek 1970-01-01 01:00:00.000000000 +0100
36705133
JR
582+++ util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek 2005-05-17 15:47:26.106795288 +0200
583@@ -0,0 +1,67 @@
6c893a66
JR
584+# $Id$ --*- sh -*--
585+
586+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
587+#
588+# This program is free software; you can redistribute it and/or modify
589+# it under the terms of the GNU General Public License as published by
590+# the Free Software Foundation; version 2 of the License.
591+#
592+# This program is distributed in the hope that it will be useful,
593+# but WITHOUT ANY WARRANTY; without even the implied warranty of
594+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
595+# GNU General Public License for more details.
596+#
597+# You should have received a copy of the GNU General Public License
598+# along with this program; if not, write to the Free Software
599+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
600+
601+function poldek.installBasePackages
602+{
603+ local name="$1"
604+ local dir="$2"
605+
606+ test "$dir" != / || return 0
607+ for filelist in "$dir"/*; do
608+ isRegularFile "$filelist" || continue
609+ local idx=0
610+ local can_fail=false
afcd33de 611+ local flags='--install'
6c893a66
JR
612+
613+ set -- $(<$filelist)
614+ while test "$#" -gt 0; do
615+ case "$1" in
616+ --reinstall) flags='--reinstall';;
617+ --can-fail) can_fail=true;;
618+ *) break;;
619+ esac
620+ shift
621+ done
afcd33de 622+ "$_VPOLDEK" "$name" -- $flags $* || $can_fail
6c893a66
JR
623+ done
624+}
625+
626+function poldek.initVariables
627+{
36705133 628+ findFile POLDEKCONFDEFAULT \
6c893a66
JR
629+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek.conf" \
630+ "$__CONFDIR/.defaults/apps/pkgmgmt/poldek.conf" \
631+ "$__DISTRIBDIR/$DISTRIBUTION/poldek.conf" \
632+ "$__DISTRIBDIR/defaults/poldek.conf" \
633+ ''
634+}
635+
636+function poldek.initFilesystem
637+{
36705133 638+ mkdir -p "$PKGCFGDIR"/poldek/etc
0b87f1d5 639+ mkdir -p "$PKGCFGBASE"/poldek-cache
36705133
JR
640+
641+ $_LN_S "$PKGCFGBASE"/poldek-cache "$PKGCFGDIR"/poldek/cache
642+
6c893a66
JR
643+ populateDirectory "$PKGCFGDIR/poldek/etc" \
644+ "$__DISTRIBDIR/defaults/poldek" \
645+ "$__DISTRIBDIR/$DISTRIBUTION/poldek" \
646+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek"
647+
648+ test -z "$POLDEKCONFDEFAULT" || \
649+ $_LN_S "$POLDEKCONFDEFAULT" "$PKGCFGDIR"/poldek/etc/poldek.conf
650+}
36705133 651diff -urN -x '*~' util-vserver-0.30.207/scripts/vserver-build.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.poldek
6c893a66 652--- util-vserver-0.30.207/scripts/vserver-build.poldek 1970-01-01 01:00:00.000000000 +0100
36705133 653+++ util-vserver-0.30.207-poldek/scripts/vserver-build.poldek 2005-05-17 15:47:26.106795288 +0200
9bed2938 654@@ -0,0 +1,64 @@
6c893a66
JR
655+# $Id$ --*- sh -*--
656+
657+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
658+#
659+# This program is free software; you can redistribute it and/or modify
660+# it under the terms of the GNU General Public License as published by
661+# the Free Software Foundation; version 2 of the License.
662+#
663+# This program is distributed in the hope that it will be useful,
664+# but WITHOUT ANY WARRANTY; without even the implied warranty of
665+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
666+# GNU General Public License for more details.
667+#
668+# You should have received a copy of the GNU General Public License
669+# along with this program; if not, write to the Free Software
670+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
671+
672+tmp=$(getopt -o +d: --long debug -n "$0" -- "$@") || exit 1
673+eval set -- "$tmp"
674+
9ba4ee1d 675+. "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM"
6c893a66
JR
676+. "$_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK"
677+. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
678+
679+while true; do
680+ case "$1" in
681+ (-d) DISTRIBUTION=$2; shift;;
682+ (--debug) set -x;;
683+ (--) shift; break ;;
b8ffb90d 684+ (*) echo "vserver-build.poldek: internal error: unrecognized option '$1'" >&2
6c893a66
JR
685+ exit 1
686+ ;;
687+ esac
688+ shift
689+done
690+
691+getDistribution
692+
9bed2938
JR
693+base.init
694+
6c893a66 695+pkgmgmt.initVariables
9ba4ee1d 696+rpm.initVariables
6c893a66
JR
697+poldek.initVariables
698+
699+base.initFilesystem "$OPTION_FORCE"
700+pkgmgmt.initFilesystem "$OPTION_FORCE"
9ba4ee1d 701+rpm.initFilesystem
6c893a66
JR
702+poldek.initFilesystem
703+
704+setup_writeOption "$VSERVER_NAME"
705+setup_writeInitialFstab
706+
707+test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
9ba4ee1d
JR
708+rpm.initDB "$SETUP_CONFDIR"
709+rpm.importGPGPubKeys "$SETUP_CONFDIR" \
710+ "$__CONFDIR/.distributions/$DISTRIBUTION/pubkeys" \
711+ "$__CONFDIR/.distributions/.common/pubkeys" \
712+ "$__DISTRIBDIR/$DISTRIBUTION/pubkeys"
6c893a66
JR
713+
714+$_VPOLDEK "$SETUP_CONFDIR" -- --update-whole
715+poldek.installBasePackages "$SETUP_CONFDIR" "$PKGINSTALLDIR"
6c893a66 716+test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
9bed2938
JR
717+
718+base.setSuccess
This page took 0.114281 seconds and 4 git commands to generate.