]> git.pld-linux.org Git - packages/util-vserver.git/blame - util-vserver-pld.patch
- rel 3; support for subdir per cgroup subsystem (default mount way used by libcgroup)
[packages/util-vserver.git] / util-vserver-pld.patch
CommitLineData
b7bfbdc3 1--- util-vserver-0.30.216-r2837.orig/distrib/defaults/poldek/poldek.conf 1970-01-01 01:00:00.000000000 +0100
2+++ util-vserver-0.30.216-r2837/distrib/defaults/poldek/poldek.conf 2009-06-22 17:48:26.000000000 +0200
3@@ -0,0 +1,11 @@
4+# poldek configuration file.
5+
6+%includedir repos.d
7+
8+[global]
9+particle install = no
10+choose equivalents manually = yes
11+unique package names = yes
12+
13+#hold =
14+ignore = kernel* udev devfs
b7bfbdc3 15--- util-vserver-0.30.216-r2837.orig/distrib/Makefile.am 2009-06-22 17:36:52.000000000 +0200
16+++ util-vserver-0.30.216-r2837/distrib/Makefile.am 2009-06-22 17:49:36.000000000 +0200
17@@ -45,6 +45,7 @@
61c3106d
ER
18 defaults/apt.conf \
19 defaults/rpm/macros \
20 defaults/apt/apt.conf \
21+ defaults/poldek/poldek.conf \
22 template/initpost template/initpre \
23 rh9/apt/rpmpriorities rh9/pkgs/01 rh9/pkgs/02 \
24 fc1/apt/rpmpriorities fc1/pkgs/01 fc1/pkgs/02 \
b7bfbdc3 25@@ -85,7 +86,10 @@
f7d49881
AM
26 suse91/apt/rpmpriorities suse91/pkgs/01 suse91/pkgs/02 \
27 suse91/rpm/macros \
28 gentoo/init-vserver.sh gentoo/net.vserver \
29- gentoo/reboot.sh gentoo/shutdown.sh
b7bfbdc3 30+ gentoo/reboot.sh gentoo/shutdown.sh\
67457f13 31+ pld-ac/pkgs/01 pld-ac/rpm/macros \
21e9a651 32+ pld-th/pkgs/01 pld-th/rpm/macros \
90b60b35 33+ pld-ti/pkgs/01 pld-ti/rpm/macros
e7229914
JR
34
35 nobase_confdistrib_DATA = rh9/apt/sources.list \
36 fc1/apt/sources.list \
b7bfbdc3 37@@ -95,7 +99,10 @@
fe9ea50c 38 fc5/apt/sources.list \
39 fc6/apt/sources.list \
67457f13 40 f7/apt/sources.list \
4fadbbef
JR
41- suse91/apt/sources.list
42+ suse91/apt/sources.list \
61c3106d
ER
43+ pld-ac/poldek/repos.d/pld.conf \
44+ pld-th/poldek/repos.d/pld.conf \
90b60b35 45+ pld-ti/poldek/repos.d/pld.conf
4fadbbef
JR
46
47 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT \
48 = $(nobase_distrib_SCRIPTS)
b7bfbdc3 49--- util-vserver-0.30.216-r2837.orig/distrib/pld-ac/pkgs/01 1970-01-01 01:00:00.000000000 +0100
50+++ util-vserver-0.30.216-r2837/distrib/pld-ac/pkgs/01 2009-06-22 17:48:26.000000000 +0200
9a398558 51@@ -0,0 +1,6 @@
452506e7 52+basesystem
9a398558
ER
53+filesystem
54+glibc-misc
4e5a2018 55+issue
f5f1d176 56+rpm-base
34158836 57+vserver-packages
b7bfbdc3 58--- util-vserver-0.30.216-r2837.orig/distrib/pld-ac/poldek/repos.d/pld.conf 1970-01-01 01:00:00.000000000 +0100
59+++ util-vserver-0.30.216-r2837/distrib/pld-ac/poldek/repos.d/pld.conf 2009-06-22 17:48:26.000000000 +0200
cfe366e0 60@@ -0,0 +1,64 @@
4fadbbef 61+# $Id$
f0b1d0c6 62+# PLD Linux Distribution <http://www.pld-linux.org/>.
cfe366e0
ER
63+#
64+# Main sources for PLD Linux 2.0 (Ac)
4fadbbef 65+
f0b1d0c6 66+# specify our packages architecture
4fc43fd1 67+_arch = %ARCH%
f0b1d0c6
ER
68+
69+# main PLD-site for often changed things:
70+_pld_main_prefix = ftp://ftp.ac.pld-linux.org/dists/ac
71+
4fadbbef
JR
72+## Some mirrors
73+## You can use them if you have better connection there
74+# CI TASK:
4fc43fd1 75+#_prefix = ftp://ftp.task.pld-linux.org/dists/ac
4fc43fd1 76+_prefix = %{_pld_main_prefix}
4fadbbef 77+
4fc43fd1 78+_type = pndir
4fadbbef 79+
cfe366e0 80+# PLD Linux 2.0 (Ac)
4fadbbef 81+[source]
4fc43fd1 82+type = %{_type}
cfe366e0 83+name = ac-main
4fc43fd1 84+path = %{_prefix}/PLD/%{_arch}/PLD/RPMS/
f0b1d0c6 85+signed = yes
f0b1d0c6 86+pri = 1
cfe366e0
ER
87+# msmtp-sendmail is broken, yum noarch is older than in updates
88+ignore = msmtp-sendmail* yum*
4fadbbef
JR
89+
90+[source]
4fc43fd1 91+type = %{_type}
f0b1d0c6 92+name = ac-updates
4fc43fd1 93+path = %{_prefix}/updates/%{_arch}/
f0b1d0c6
ER
94+signed = yes
95+pri = 1
4fadbbef
JR
96+
97+[source]
4fc43fd1 98+type = %{_type}
f0b1d0c6 99+name = ac-supported
4fc43fd1 100+path = %{_prefix}/supported/%{_arch}/
cfe366e0 101+signed = yes
f0b1d0c6
ER
102+auto = no
103+autoup = no
4fadbbef
JR
104+
105+[source]
4fc43fd1 106+type = %{_type}
f0b1d0c6 107+name = ac-ready
4fc43fd1 108+path = %{_pld_main_prefix}/ready/%{_arch}/
cfe366e0 109+#signed = yes
f0b1d0c6
ER
110+auto = no
111+autoup = no
4fadbbef
JR
112+
113+[source]
4fc43fd1 114+type = %{_type}
f0b1d0c6 115+name = ac-test
4fc43fd1 116+path = %{_pld_main_prefix}/test/%{_arch}/
f0b1d0c6
ER
117+auto = no
118+autoup = no
cfe366e0
ER
119+
120+# ac-main + ac-updates
121+[source]
122+type = group
123+name = ac
124+sources = ac-main ac-updates
b7bfbdc3 125--- util-vserver-0.30.216-r2837.orig/distrib/pld-ac/rpm/macros 1970-01-01 01:00:00.000000000 +0100
126+++ util-vserver-0.30.216-r2837/distrib/pld-ac/rpm/macros 2009-06-22 17:48:26.000000000 +0200
7ca29501 127@@ -0,0 +1,6 @@
909684f7
AM
128+# Because of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=52725
129+# you have to use at least one language beside 'C'
130+%_install_langs C:en:pl
273c55b8 131+%_netsharedpath /dev:/proc
d3569d8d 132+%_tmppath /tmp
7ca29501 133+%_host_os %_os
b7bfbdc3 134--- util-vserver-0.30.216-r2837.orig/distrib/pld-th/pkgs/01 1970-01-01 01:00:00.000000000 +0100
135+++ util-vserver-0.30.216-r2837/distrib/pld-th/pkgs/01 2009-06-22 17:48:26.000000000 +0200
9a398558 136@@ -0,0 +1,6 @@
909684f7 137+basesystem
9a398558
ER
138+filesystem
139+glibc-misc
909684f7
AM
140+issue
141+rpm-base
142+vserver-packages
b7bfbdc3 143--- util-vserver-0.30.216-r2837.orig/distrib/pld-th/poldek/repos.d/pld.conf 1970-01-01 01:00:00.000000000 +0100
144+++ util-vserver-0.30.216-r2837/distrib/pld-th/poldek/repos.d/pld.conf 2009-06-22 17:48:26.000000000 +0200
08411a3e 145@@ -0,0 +1,71 @@
f97a9ff7 146+# PLD Linux Distribution <http://www.pld-linux.org/>.
08411a3e
ER
147+#
148+# Main sources for PLD Linux 3.0 (Th)
909684f7 149+
08411a3e 150+# specify our packages architecture
4fc43fd1 151+_arch = %ARCH%
08411a3e
ER
152+
153+# main PLD-site for often changed things (test, ready):
154+_pld_main_prefix = ftp://ftp.th.pld-linux.org/dists/th
155+
909684f7
AM
156+## Some mirrors
157+## You can use them if you have better connection there
158+# CI TASK:
4fc43fd1 159+#_prefix = ftp://ftp.task.pld-linux.org/dists/th
08411a3e 160+_prefix = %{_pld_main_prefix}
909684f7 161+
08411a3e 162+# PLD Linux 3.0 (Th): main sources
909684f7 163+[source]
08411a3e 164+type = pndir
f97a9ff7
ER
165+name = th
166+path = %{_prefix}/PLD/%{_arch}/RPMS/
909684f7
AM
167+
168+[source]
08411a3e 169+type = pndir
f97a9ff7
ER
170+name = th
171+path = %{_prefix}/PLD/noarch/RPMS/
909684f7 172+
08411a3e
ER
173+# PLD Linux 3.0 (Th): obsolete sources (kde3, ...)
174+[source]
175+type = pndir
176+name = th-obsolete
177+path = %{_prefix}/obsolete/%{_arch}/RPMS/
178+auto = no
179+autoup = no
f97a9ff7 180+
08411a3e
ER
181+[source]
182+type = pndir
183+name = th-obsolete
184+path = %{_prefix}/obsolete/noarch/RPMS/
185+auto = no
186+autoup = no
909684f7 187+
08411a3e 188+# PLD Linux 3.0 (Th): ready sources (testing stage before moved to main)
909684f7 189+[source]
08411a3e 190+type = pndir
f97a9ff7 191+name = th-ready
08411a3e 192+path = %{_pld_main_prefix}/ready/%{_arch}/RPMS/
f97a9ff7
ER
193+auto = no
194+autoup = no
909684f7 195+
f97a9ff7 196+[source]
08411a3e 197+type = pndir
f97a9ff7 198+name = th-ready
08411a3e 199+path = %{_pld_main_prefix}/ready/noarch/RPMS/
f97a9ff7
ER
200+auto = no
201+autoup = no
909684f7 202+
08411a3e 203+# PLD Linux 3.0 (Th): test sources (built packages to be moved to ready)
909684f7 204+[source]
08411a3e 205+type = pndir
f97a9ff7 206+name = th-test
08411a3e 207+path = %{_pld_main_prefix}/test/%{_arch}/RPMS/
f97a9ff7
ER
208+auto = no
209+autoup = no
909684f7
AM
210+
211+[source]
08411a3e 212+type = pndir
f97a9ff7 213+name = th-test
08411a3e 214+path = %{_pld_main_prefix}/test/noarch/RPMS/
f97a9ff7
ER
215+auto = no
216+autoup = no
b7bfbdc3 217--- util-vserver-0.30.216-r2837.orig/distrib/pld-th/rpm/macros 1970-01-01 01:00:00.000000000 +0100
218+++ util-vserver-0.30.216-r2837/distrib/pld-th/rpm/macros 2009-06-22 17:48:26.000000000 +0200
7ca29501 219@@ -0,0 +1,6 @@
e7229914
JR
220+# Because of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=52725
221+# you have to use at least one language beside 'C'
222+%_install_langs C:en:pl
273c55b8 223+%_netsharedpath /dev:/proc
d3569d8d 224+%_tmppath /tmp
7ca29501 225+%_host_os %_os
b7bfbdc3 226--- util-vserver-0.30.216-r2837.orig/distrib/pld-ti/pkgs/01 1970-01-01 01:00:00.000000000 +0100
227+++ util-vserver-0.30.216-r2837/distrib/pld-ti/pkgs/01 2009-06-22 17:48:26.000000000 +0200
9a398558 228@@ -0,0 +1,6 @@
21e9a651 229+basesystem
9a398558
ER
230+filesystem
231+glibc-misc
21e9a651 232+issue
233+rpm-base
234+vserver-packages
b7bfbdc3 235--- util-vserver-0.30.216-r2837.orig/distrib/pld-ti/poldek/repos.d/pld.conf 1970-01-01 01:00:00.000000000 +0100
236+++ util-vserver-0.30.216-r2837/distrib/pld-ti/poldek/repos.d/pld.conf 2009-06-22 17:48:26.000000000 +0200
21e9a651 237@@ -0,0 +1,46 @@
238+# PLD Titanium
239+# Unofficial version of PLD Linux Distribution
240+# http://www.pld-linux.org/Titanium
241+
242+_arch = %ARCH%
243+_prefix = ftp://ftp.titanium.pld-linux.org/branches/titanium
244+
245+_type = pndir
246+
247+[source]
248+type = %{_type}
249+name = titanium
250+path = %{_prefix}/PLD/%{_arch}/RPMS/
251+
252+[source]
253+type = %{_type}
254+name = titanium
255+path = %{_prefix}/PLD/noarch/RPMS/
256+
257+[source]
258+type = %{_type}
259+name = titanium-ready
260+path = %{_prefix}/ready/%{_arch}/RPMS/
261+auto = no
262+autoup = no
263+
264+[source]
265+type = %{_type}
266+name = titanium-ready
267+path = %{_prefix}/ready/noarch/RPMS/
268+auto = no
269+autoup = no
270+
271+[source]
272+type = %{_type}
273+name = titanium-test
274+path = %{_prefix}/test/%{_arch}/RPMS/
275+auto = no
276+autoup = no
277+
278+[source]
279+type = %{_type}
280+name = titanium-test
281+path = %{_prefix}/test/noarch/RPMS/
282+auto = no
283+autoup = no
b7bfbdc3 284--- util-vserver-0.30.216-r2837.orig/distrib/pld-ti/rpm/macros 1970-01-01 01:00:00.000000000 +0100
285+++ util-vserver-0.30.216-r2837/distrib/pld-ti/rpm/macros 2009-06-22 17:48:26.000000000 +0200
7ca29501 286@@ -0,0 +1,6 @@
21e9a651 287+# Because of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=52725
288+# you have to use at least one language beside 'C'
289+%_install_langs C:en:pl
273c55b8 290+%_netsharedpath /dev:/proc
d3569d8d 291+%_tmppath /tmp
7ca29501 292+%_host_os %_os
b7bfbdc3 293--- util-vserver-0.30.216-r2837.orig/scripts/functions 2009-06-22 17:36:35.000000000 +0200
294+++ util-vserver-0.30.216-r2837/scripts/functions 2009-06-22 17:48:26.000000000 +0200
21e9a651 295@@ -403,6 +403,20 @@
4fadbbef
JR
296 fi
297 }
298
299+function _pkgSetVarsPoldek
300+{
301+ if test -n "$PKGDIR"; then
302+ findDir POLDEKETCDIR $PKGDIR/poldeketc $PKGDIR/base/poldek/etc /etc/poldek
303+ findDir POLDEKCACHEDIR $PKGDIR/poldek-cache $PKGDIR/base/poldek/cache
304+ else
305+ findDir POLDEKETCDIR "$VDIR"/etc/poldek /etc/poldek
306+ findDir POLDEKCACHEDIR "$VDIR"/var/tmp/poldek-cache
307+ fi
308+
309+ findFile POLDEK_CONFIG "$POLDEKETCDIR"/poldek.conf ""
310+ test -z "$POLDEK_CONFIG" || export POLDEK_CONFIG
311+}
312+
313
314 function _pkgMountBase
315 {
21e9a651 316@@ -476,6 +490,7 @@
4fadbbef
JR
317 rpm) _pkgSetVarsRPM;;
318 apt) _pkgSetVarsApt;;
319 yum) _pkgSetVarsYum;;
320+ poldek) _pkgSetVarsPoldek;;
321 *) echo "Unknown packaging flavor" >&2; exit 1;;
322 esac
323 done
b7bfbdc3 324@@ -770,6 +785,8 @@
4e5a2018
JR
325 style=redhat
326 elif test -e "$_pgs_vdir"/etc/mandrake-release; then
327 style=mandrake
328+ elif test -e "$_pgs_vdir"/etc/pld-release; then
329+ style=pld
330 elif test -e "$_pgs_vdir"/etc/debian_version; then
331 style=debian
332 elif test -e "$_pgs_vdir"/etc/SuSE-release; then
b7bfbdc3 333@@ -837,6 +854,27 @@
4fadbbef
JR
334 test -n "$have_yum" && return 0 || return 1
335 }
336
337+## Usage: pkgmgmt.isPoldekAvailable <cfgdir> <vdir> [<is-internal>]
338+function pkgmgmt.isPoldekAvailable
339+{
340+ local cfgdir="$1"
341+ local vdir="$2"
342+ local is_internal="$3"
343+
344+ local have_poldek i
345+ if test -n "$is_internal"; then
346+ have_poldek=1
347+ test -d "$cfgdir"/base/poldek -o -d "$cfgdir"/poldeketc || have_poldek=
348+ else
349+ have_poldek=
350+ for i in /bin /usr/bin /usr/local/bin; do
351+ test ! -x "$vdir$i"/poldek || { have_poldek=1; break; }
352+ done
353+ fi
354+
355+ test -n "$have_poldek" && return 0 || return 1
356+}
357+
358
359 function vshelper.doSanityCheck
360 {
b7bfbdc3 361--- util-vserver-0.30.216-r2837.orig/scripts/Makefile-files 2009-06-22 17:36:35.000000000 +0200
362+++ util-vserver-0.30.216-r2837/scripts/Makefile-files 2009-06-22 17:48:26.000000000 +0200
909684f7 363@@ -21,6 +21,7 @@
fe9ea50c 364 scripts/vapt-get-worker \
365 scripts/vrpm-worker \
366 scripts/vyum-worker \
367+ scripts/vpoldek-worker \
368 scripts/vrpm-preload \
369 scripts/save_s_context \
370 scripts/vservers.grabinfo.sh \
b7bfbdc3 371@@ -48,11 +49,13 @@
fe9ea50c 372 scripts/vserver-build.template \
373 scripts/vserver-build.rsync \
893c90d5 374 scripts/vserver-build.clone \
fe9ea50c 375+ scripts/vserver-build.poldek \
376 scripts/vserver-build.functions \
377 scripts/vserver-build.functions.apt \
378 scripts/vserver-build.functions.rpm \
379 scripts/vserver-build.functions.pkgmgmt \
380 scripts/vserver-build.functions.yum \
381+ scripts/vserver-build.functions.poldek \
382 scripts/vserver-setup.functions \
383 scripts/vserver.functions \
384 scripts/vserver.start \
b7bfbdc3 385@@ -66,6 +69,7 @@
fe9ea50c 386 scripts_pkglib_src_SCRPTS = scripts/pkgmgmt \
387 scripts/vapt-get-worker \
388 scripts/vpkg \
389+ scripts/vpoldek-worker \
390 scripts/vrpm-worker \
391 scripts/vrpm-preload \
392 scripts/start-vservers \
b7bfbdc3 393@@ -89,6 +93,7 @@
fe9ea50c 394 scripts_sbin_src_PRGS = scripts/chbind \
395 scripts/chcontext \
396 scripts/vapt-get \
397+ scripts/vpoldek \
398 scripts/vdispatch-conf \
399 scripts/vemerge \
400 scripts/vesync \
b7bfbdc3 401--- util-vserver-0.30.216-r2837.orig/scripts/pkgmgmt 2009-06-22 17:36:34.000000000 +0200
402+++ util-vserver-0.30.216-r2837/scripts/pkgmgmt 2009-06-22 17:48:26.000000000 +0200
909684f7 403@@ -195,7 +195,7 @@
4fadbbef
JR
404 "
405
406 case $2 in
407- (RH) pkgs=$(vrpm "$1" -- -q --qf '---%{NAME}---\n' rpm apt yum "${YUM_RELEASEPKGS[@]}")
408+ (RH) pkgs=$(vrpm "$1" -- -q --qf '---%{NAME}---\n' rpm apt yum poldek "${YUM_RELEASEPKGS[@]}")
409 hasSubstring "$pkgs" ---rpm--- || {
410 warning "$ERR
411 * The vserver does not seem to have the 'rpm' package which is required
909684f7 412@@ -205,9 +205,9 @@
4fadbbef
JR
413 ERR=
414 }
415
416- hasSubstring "$pkgs" ---apt--- ---yum--- || {
417+ hasSubstring "$pkgs" ---apt--- ---yum--- ---poldek--- || {
418 warning "$ERR
419-* The vserver does not seem to have a depsolver like 'apt' or 'yum'
420+* The vserver does not seem to have a depsolver like 'apt', 'yum' or 'poldek'
421 installed. It is suggested to install such a program before setting
422 up internal package management."
423 res=1
909684f7 424@@ -368,6 +368,131 @@
4fadbbef
JR
425 fi
426 }
427
428+function processVserver_PLD()
429+{
430+ local vserver=$1
431+ local is_internalize=$2
432+ local cfgdir
433+ local i
434+
435+ cfgdir=$($_VSERVER_INFO "$vserver" APPDIR pkgmgmt) || \
436+ cfgdir=$($_VSERVER_INFO "$vserver" APPDIR)/pkgmgmt
437+
438+ ## Figure out the environment....
439+ pkgmgmt.isPoldekAvailable "$cfgdir" "$vdir" "$is_internalize" || have_poldek=
440+
441+ local POLDEKETCDIR=
442+ local POLDEKCACHEDIR=
443+ local RPMETCDIR=
444+ local RPMSTATEDIR=
445+
446+ ## Create directories and assign variables where configuration
447+ ## can/will be found on the host
448+ if test -n "$is_internalize"; then
449+ verifyInternalPackages "$vserver" RH || test -n "$IS_FORCE" ||
450+ panic "
451+Can not continue; use '--force' to override this check"
452+
453+ pushd "$vdir" >/dev/null
454+
455+ test ! -L var/lib/rpm || {
456+ $_EXEC_CD /var/lib $_RM rpm &&
457+ $_EXEC_CD /var/lib $_MKDIR -m755 rpm &&
458+ $_EXEC_CD /var/lib $_CHOWN rpm:rpm rpm ||
459+ :
460+ } </dev/null 2>/dev/null
461+
462+ for i in var/tmp/poldek-cache etc/rpm etc/poldek; do
463+ test -d "$i" ||
464+ $_EXEC_CD /$(dirname "$i") $_MKDIR -m755 $(basename "$i") || :
465+ done #2>/dev/null
466+
467+ popd >/dev/null
468+
469+ if test -n "$have_poldek"; then
470+ findDir POLDEKETCDIR "$cfgdir"/poldeketc "$cfgdir"/base/poldek/etc /etc/poldek
471+ fi
472+
473+ findDir RPMETCDIR "$cfgdir"/rpmetc "$cfgdir"/base/rpm/etc /etc/rpm /
474+ findDir RPMSTATEDIR "$cfgdir"/rpmstate "$cfgdir"/base/rpm/state
475+ else
476+ mkdir -m755 -p "$cfgdir"
477+ local need_base=
478+
479+ if test -n "$have_poldek"; then
480+ findDir POLDEKETCDIR "$cfgdir"/poldeketc "$cfgdir"/base/poldek/etc /
481+ findDir POLDEKCACHEDIR "$cfgdir"/poldek-cache "$cfgdir"/base/poldek/cache /
482+
483+ test "$POLDEKETCDIR" != / || POLDEKETCDIR=$cfgdir/base/poldek/etc
484+ test "$POLDEKCACHEDIR" != / || POLDEKCACHEDIR=$cfgdir/base/poldek/cache
485+
486+ test -d "$cfgdir"/poldeketc -a -d "$cfgdir"/poldek-cache || need_base=1
487+ fi
488+
489+ findDir RPMETCDIR "$cfgdir"/rpmetc "$cfgdir"/base/rpm/etc /
490+ findDir RPMSTATEDIR "$cfgdir"/rpmstate "$cfgdir"/base/rpm/state /
491+
492+ test "$RPMETCDIR" != / || RPMETCDIR=$cfgdir/base/rpm/etc
493+ test "$RPMSTATEDIR" != / || RPMSTATEDIR=$cfgdir/base/rpm/state
494+
495+ test -d "$cfgdir"/rpmetc -a -d "$cfgdir"/rpmstate || need_base=1
496+ test ! -e "$cfgdir"/base || need_base=
497+
498+ test -z "$need_base" || ln -s "$PKGCFGDIR" "$cfgdir"/base
499+
500+ mkdir -m755 -p "$PKGCFGDIR"
501+ _createDirs "$POLDEKETCDIR" "$POLDEKCACHEDIR" \
502+ "$RPMETCDIR" "$RPMSTATEDIR"
503+ fi
504+
505+ ## Copy the files...
506+ if test -n "$is_internalize"; then
507+ if test -n "$have_poldek"; then
508+ _copySecure "$vdir" "$POLDEKETCDIR" /etc/poldek
509+ pushd "$vdir" >/dev/null
510+ _hashAuto /etc/poldek.conf '/'
511+ popd >/dev/null
512+ fi
513+
514+ _copySecure "$vdir" "$RPMETCDIR" /etc/rpm
515+ _copySecure "$vdir" "$RPMSTATEDIR" /var/lib/rpm
516+
517+ pushd "$vdir" >/dev/null
518+ ## remove %_dbpath settings
519+ _substFile /etc/rpm/macros '/^%_dbpath[ \t].*/D'
520+ popd >/dev/null
521+ else
522+ if test -n "$have_poldek"; then
523+ _copySecureRev "$vdir" /etc/poldek "$POLDEKETCDIR"
524+ _unhashAuto "$POLDEKETCDIR"/poldek.conf '/'
525+ fi
526+
527+ _copySecureRev "$vdir" /etc/rpm "$RPMETCDIR"
528+ _copySecureRev "$vdir" /var/lib/rpm "$RPMSTATEDIR"
529+
530+ echo -e "%_dbpath\t\t$rpmdb_mntpoint" >>$RPMETCDIR/macros
531+ fi
532+
533+ ## Cleanups...
534+ if test -n "$is_internalize"; then
535+ :
536+ else
8d5b8ef9 537+ tmpdir=$($_MKTEMPDIR -p /var/tmp pgmgmt.XXXXXX)
4fadbbef
JR
538+ trap "$_RM -rf $tmpdir" EXIT
539+ pushd "$vdir" >/dev/null
540+ $_EXEC_CD /var/lib $_MV rpm $tmpdir/
541+ $_EXEC_CD /var/lib $_LN_S "$rpmdb_mntpoint" rpm
542+ $_RM -rf $tmpdir
543+ fi
544+
545+ ## Finish it...
546+ if test -n "$is_internalize"; then
547+ $_TOUCH "$cfgdir"/internal
548+ else
549+ $_RM -f "$cfgdir"/internal
550+ fi
551+}
552+
553 function processVserver_Debian()
554 {
555 local vserver=$1
21e9a651 556@@ -422,6 +547,7 @@
4fadbbef
JR
557
558 case "$style" in
559 (redhat|mandrake) processVserver_RH "$vserver" "$IS_INTERNALIZE";;
560+ (pld) processVserver_PLD "$vserver" "$IS_INTERNALIZE";;
561 (debian) processVserver_Debian "$vserver" "$IS_INTERNALIZE";;
562 (*)
563 echo $"Vserver style '$style' is not supported for packagemanagment" >&2
b7bfbdc3 564--- util-vserver-0.30.216-r2837.orig/scripts/util-vserver-vars.pathsubst 2009-06-22 17:36:34.000000000 +0200
565+++ util-vserver-0.30.216-r2837/scripts/util-vserver-vars.pathsubst 2009-06-22 17:48:26.000000000 +0200
566@@ -54,6 +54,7 @@
4fadbbef
JR
567 _LIB_VSERVER_BUILD_FUNCTIONS_RPM="$__PKGLIBDIR/vserver-build.functions.rpm"
568 _LIB_VSERVER_BUILD_FUNCTIONS_YUM="$__PKGLIBDIR/vserver-build.functions.yum"
569 _LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT="$__PKGLIBDIR/vserver-build.functions.pkgmgmt"
570+_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK="$__PKGLIBDIR/vserver-build.functions.poldek"
571 _LISTDEVIP="$__LEGACYDIR/listdevip"
572 _LOCKFILE="$__PKGLIBDIR/lockfile"
573 _MASK2PREFIX="$__PKGLIBDIR/mask2prefix"
b7bfbdc3 574@@ -109,6 +110,8 @@
4fadbbef
JR
575 _VUNIFY="$__PKGLIBDIR/vunify"
576 _VYUM="$__SBINDIR/vyum"
577 _VYUM_WORKER="$__PKGLIBDIR/vyum-worker"
578+_VPOLDEK="$__SBINDIR/vpoldek"
579+_VPOLDEK_WORKER="$__PKGLIBDIR/vpoldek-worker"
580
581 _AWK="@AWK@"
fe9ea50c 582 _BZIP2="@BZIP2@"
b7bfbdc3 583--- util-vserver-0.30.216-r2837.orig/scripts/vpkg 2009-06-22 17:36:34.000000000 +0200
584+++ util-vserver-0.30.216-r2837/scripts/vpkg 2009-06-22 17:48:26.000000000 +0200
909684f7 585@@ -115,6 +115,44 @@
4e5a2018
JR
586 fi
587 fi
588 ;;
589+ (pld)
590+ rpm_param=
591+ poldek_param=
592+ case "$tag" in
593+ ## rpm outputs sometimes '(contains no files)', so return
594+ ## only the valid output
595+ (get-conffiles)
596+ rpm_param=( -qac --pipe "$_SED '\!^/!p;d'" );;
597+ (install)
598+ rpm_param=( -Uvh "$@" )
599+ poldek_param=( --install -v "$@" )
600+ ;;
601+ esac
602+
603+ if test -n "$is_external"; then
604+ have_poldek=1
605+ test -d "$cfgdir"/base/poldek -o -d "$cfgdir"/poldeketc || have_poldek=
606+ else
607+ have_poldek=
608+ for i in /bin /usr/bin /usr/local/bin; do
609+ test ! -x "$vdir$i"/poldek || { have_poldek=1; break; }
610+ done
611+ fi
612+
613+ if test -n "$is_external"; then
614+ if test "$have_poldek" -a "$poldek_param"; then
615+ cmd=( "$_VPOLDEK" "$vserver" -- "${poldek_param[@]}" )
616+ else
617+ cmd=( "$_VRPM" "$vserver" -- "${rpm_param[@]}" )
618+ fi
619+ else
620+ if test "$have_poldek" -a "$poldek_param"; then
621+ cmd=( "$_VSERVER" --silent "$vserver" exec poldek "${poldek_param[@]}" )
622+ else
623+ cmd=( "$_VSERVER" --silent "$vserver" exec rpm "${rpm_param[@]}" )
624+ fi
625+ fi
626+ ;;
627 (debian)
628 case "$tag" in
629 (get-conffiles)
b7bfbdc3 630--- util-vserver-0.30.216-r2837.orig/scripts/vpoldek 1970-01-01 01:00:00.000000000 +0100
631+++ util-vserver-0.30.216-r2837/scripts/vpoldek 2009-06-22 17:48:26.000000000 +0200
521e98dd 632@@ -0,0 +1,74 @@
4fadbbef
JR
633+#! /bin/bash
634+# $Id$
635+
521e98dd 636+# Copyright (C) 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4fadbbef
JR
637+#
638+# This program is free software; you can redistribute it and/or modify
639+# it under the terms of the GNU General Public License as published by
640+# the Free Software Foundation; version 2 of the License.
641+#
642+# This program is distributed in the hope that it will be useful,
643+# but WITHOUT ANY WARRANTY; without even the implied warranty of
644+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645+# GNU General Public License for more details.
646+#
647+# You should have received a copy of the GNU General Public License
648+# along with this program; if not, write to the Free Software
649+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
650+
651+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
652+test -e "$UTIL_VSERVER_VARS" || {
653+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
654+ exit 1
655+}
656+. "$UTIL_VSERVER_VARS"
657+. "$_LIB_FUNCTIONS"
658+
659+
660+function showHelp()
661+{
662+ echo \
663+$"Usage: $0 <vserver-name>* [--all] -- <params>+
664+
665+Report bugs to <$PACKAGE_BUGREPORT>."
666+ exit 0
667+}
668+
669+function showVersion()
670+{
671+ echo \
672+$"vpoldek $PACKAGE_VERSION -- poldek for vservers
673+This program is part of $PACKAGE_STRING
674+
521e98dd 675+Copyright (C) 2007 Enrico Scholz
4fadbbef
JR
676+This program is free software; you may redistribute it under the terms of
677+the GNU General Public License. This program has absolutely no warranty."
678+ exit 0
679+}
680+
521e98dd
AM
681+tmp=$(getopt -o +q --long help,version,debug,quiet,all -n "$0" -- "$@") || exit 1
682+eval set -- "$tmp"
683+
684+declare -a send_through poldek_opts
4fadbbef 685+
521e98dd 686+while true; do
4fadbbef 687+ case "$1" in
521e98dd
AM
688+ (--help) showHelp $0 ;;
689+ (--version) showVersion ;;
690+ (--debug) send_through=( "${send_through[@]}" "$1" ); set -x;;
691+ (--quiet|-q) send_through=( "${send_through[@]}" "$1" );;
692+ (--all) poldek_opts=( "${poldek_opts[@]}" "$1" );;
693+ (--) shift; break;;
694+ (*) echo $"vpoldek: internal error; arg=='$1'" >&2; exit 1;;
695+ esac
696+ shift
4fadbbef
JR
697+done
698+
521e98dd
AM
699+VSOMETHING_TITLE=vpoldek
700+VSOMETHING_WORKER=$_VPOLDEK_WORKER
701+VSOMETHING_PKGMGMT=1
4fadbbef 702+
521e98dd 703+export VSOMETHING_TITLE VSOMETHING_WORKER VSOMETHING_PKGMGMT
4fadbbef 704+
521e98dd
AM
705+test ${#poldek_opts[@]} -eq 0 || poldek_opts=( "${poldek_opts[@]}" -- )
706+exec $_VSOMETHING "${send_through[@]}" poldek "${poldek_opts[@]}" "$@"
b7bfbdc3 707--- util-vserver-0.30.216-r2837.orig/scripts/vpoldek-worker 1970-01-01 01:00:00.000000000 +0100
708+++ util-vserver-0.30.216-r2837/scripts/vpoldek-worker 2009-06-22 17:48:26.000000000 +0200
4fadbbef
JR
709@@ -0,0 +1,45 @@
710+#! /bin/bash
711+# $Id$
712+
713+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
714+#
715+# This program is free software; you can redistribute it and/or modify
716+# it under the terms of the GNU General Public License as published by
717+# the Free Software Foundation; version 2 of the License.
718+#
719+# This program is distributed in the hope that it will be useful,
720+# but WITHOUT ANY WARRANTY; without even the implied warranty of
721+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
722+# GNU General Public License for more details.
723+#
724+# You should have received a copy of the GNU General Public License
725+# along with this program; if not, write to the Free Software
726+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
727+
728+set -e
729+
730+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
731+test -e "$UTIL_VSERVER_VARS" || {
732+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
733+ exit 1
734+}
735+. "$UTIL_VSERVER_VARS"
736+. "$_LIB_FUNCTIONS"
737+
738+
739+vserver="$1"
740+shift
741+
742+pkgInit "$vserver" rpm poldek
743+
744+test -z "$_POLDEK" || {
745+ warning $"The environment variable \$_POLDEK is not supported anymore; please use \$POLDEK instead of"
746+ ${POLDEK:=$_POLDEK}
747+}
748+
749+exec ${_POLDEK:-poldek} \
750+ -v --root=$VDIR \
751+ --cachedir=$POLDEKCACHEDIR \
752+ --conf=$POLDEK_CONFIG \
753+ --pmcmd=$RPM_BINARY \
754+ "$@"
b7bfbdc3 755--- util-vserver-0.30.216-r2837.orig/scripts/vserver-build 2009-06-22 17:36:34.000000000 +0200
756+++ util-vserver-0.30.216-r2837/scripts/vserver-build 2009-06-22 17:48:26.000000000 +0200
909684f7 757@@ -57,6 +57,9 @@
fe9ea50c 758 yum ... -- -d <distribution>
4fadbbef
JR
759 ... installs the base-packages of the given distribution with
760 help of 'vyum'
fe9ea50c 761+ poldek ... -- -d <distribution>
4fadbbef
JR
762+ ... installs the base-packages of the given distribution with
763+ help of 'vpoldek'
fe9ea50c 764 rpm ... -- [-d <distribution>] --empty|([--force] [--nodeps] <manifest>)+
4fadbbef 765 ... installs lists of rpm-packages
fe9ea50c 766 skeleton ... -- [<cmd> <args>*]
21e9a651 767@@ -136,7 +139,7 @@
4fadbbef
JR
768
769 case x"$method" in
770 (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;;
893c90d5 771- (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xtemplate|xfai|xrsync|xclone)
772+ (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xtemplate|xfai|xrsync|xclone|xpoldek)
4fadbbef
JR
773 . $__PKGLIBDIR/vserver-build.$method
774 ;;
775 (x) panic $"No build-method specified";;
b7bfbdc3 776--- util-vserver-0.30.216-r2837.orig/scripts/vserver-build.functions 2009-06-22 17:36:35.000000000 +0200
777+++ util-vserver-0.30.216-r2837/scripts/vserver-build.functions 2009-06-22 17:48:26.000000000 +0200
778@@ -170,6 +170,12 @@
fe9ea50c 779 elif test -e /etc/slackware-version; then
780 set -- $(cat /etc/slackware-version)
4fadbbef
JR
781 DISTRIBUTION=slackware$2
782+ elif test -e /etc/pld-release; then
783+ old_IFS=$IFS
784+ IFS='()'
785+ set -- $(cat /etc/pld-release)
786+ DISTRIBUTION=pld-$(echo $2 | tr A-Z a-z)
787+ IFS=$old_IFS
788 elif test -n "$1"; then
789 DISTRIBUTION=$1
790 else
b7bfbdc3 791--- util-vserver-0.30.216-r2837.orig/scripts/vserver-build.functions.poldek 1970-01-01 01:00:00.000000000 +0100
792+++ util-vserver-0.30.216-r2837/scripts/vserver-build.functions.poldek 2009-06-22 17:48:26.000000000 +0200
bf7f78a3 793@@ -0,0 +1,81 @@
4fadbbef
JR
794+# $Id$ --*- sh -*--
795+
796+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
797+#
798+# This program is free software; you can redistribute it and/or modify
799+# it under the terms of the GNU General Public License as published by
800+# the Free Software Foundation; version 2 of the License.
801+#
802+# This program is distributed in the hope that it will be useful,
803+# but WITHOUT ANY WARRANTY; without even the implied warranty of
804+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
805+# GNU General Public License for more details.
806+#
807+# You should have received a copy of the GNU General Public License
808+# along with this program; if not, write to the Free Software
809+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
810+
811+function poldek.installBasePackages
812+{
813+ local name="$1"
814+ local dir="$2"
815+
816+ test "$dir" != / || return 0
817+ for filelist in "$dir"/*; do
818+ isRegularFile "$filelist" || continue
819+ local idx=0
820+ local can_fail=false
821+ local flags='--install'
822+
823+ set -- $(<$filelist)
824+ while test "$#" -gt 0; do
825+ case "$1" in
826+ --reinstall) flags='--reinstall';;
827+ --can-fail) can_fail=true;;
828+ *) break;;
829+ esac
830+ shift
831+ done
832+ "$_VPOLDEK" "$name" -- $flags $* || $can_fail
833+ done
834+}
835+
836+function poldek.initVariables
837+{
838+ findFile POLDEKCONFDEFAULT \
839+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek/poldek.conf" \
840+ "$__CONFDIR/.defaults/apps/pkgmgmt/poldek/poldek.conf" \
841+ "$__DISTRIBDIR/$DISTRIBUTION/poldek/poldek.conf" \
842+ "$__DISTRIBDIR/defaults/poldek/poldek.conf" \
843+ ''
844+}
845+
846+function poldek.initFilesystem
847+{
b7494608 848+ mkdir -p "$PKGCFGDIR"/poldek/etc/repos.d
4fadbbef 849+
bf7f78a3 850+ $_LN_S "$__CONFDIR"/.defaults/cachebase/poldek "$PKGCFGDIR"/poldek/cache
4fadbbef
JR
851+
852+ populateDirectory "$PKGCFGDIR/poldek/etc" \
853+ "$__DISTRIBDIR/defaults/poldek" \
854+ "$__DISTRIBDIR/$DISTRIBUTION/poldek" \
855+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek"
856+
b7494608
ER
857+ populateDirectory "$PKGCFGDIR/poldek/etc/repos.d" \
858+ "$__DISTRIBDIR/defaults/poldek/repos.d" \
859+ "$__DISTRIBDIR/$DISTRIBUTION/poldek/repos.d" \
860+ "$__CONFDIR/.distributions/$DISTRIBUTION/poldek/repos.d"
861+
3ec2a3c2
ER
862+ if [ -n "$SETUP_MACHINE" ]; then
863+ say "Using $SETUP_MACHINE as machine"
9e5c5359 864+ sed -i -e "s#^\(_arch\s*\)=.*#\1= $SETUP_MACHINE#" "$PKGCFGDIR"/poldek/etc/repos.d/*.conf
3ec2a3c2
ER
865+ fi
866+
867+ if [ -n "$MIRROR" ]; then
868+ say "Using $MIRROR as mirror URL"
9e5c5359 869+ sed -i -e "s#^\(_prefix\s*\)=.*#\1= $MIRROR#" "$PKGCFGDIR"/poldek/etc/repos.d/*.conf
3ec2a3c2
ER
870+ fi
871+
78219c44
JR
872+# test -z "$POLDEKCONFDEFAULT" || \
873+# $_LN_S "$POLDEKCONFDEFAULT" "$PKGCFGDIR"/poldek/etc/
4fadbbef 874+}
b7bfbdc3 875--- util-vserver-0.30.216-r2837.orig/scripts/vserver-build.poldek 1970-01-01 01:00:00.000000000 +0100
876+++ util-vserver-0.30.216-r2837/scripts/vserver-build.poldek 2009-06-22 17:48:26.000000000 +0200
3ec2a3c2 877@@ -0,0 +1,65 @@
4fadbbef
JR
878+# $Id$ --*- sh -*--
879+
880+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
881+#
882+# This program is free software; you can redistribute it and/or modify
883+# it under the terms of the GNU General Public License as published by
884+# the Free Software Foundation; version 2 of the License.
885+#
886+# This program is distributed in the hope that it will be useful,
887+# but WITHOUT ANY WARRANTY; without even the implied warranty of
888+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
889+# GNU General Public License for more details.
890+#
891+# You should have received a copy of the GNU General Public License
892+# along with this program; if not, write to the Free Software
893+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
894+
3ec2a3c2 895+tmp=$(getopt -o +d:,m: --long debug -n "$0" -- "$@") || exit 1
4fadbbef
JR
896+eval set -- "$tmp"
897+
898+. "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM"
899+. "$_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK"
900+. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
901+
902+while true; do
903+ case "$1" in
904+ (-d) DISTRIBUTION=$2; shift;;
3ec2a3c2 905+ (-m) MIRROR=$2; shift;;
4fadbbef
JR
906+ (--debug) set -x;;
907+ (--) shift; break ;;
908+ (*) echo "vserver-build.poldek: internal error: unrecognized option '$1'" >&2
909+ exit 1
910+ ;;
911+ esac
912+ shift
913+done
914+
915+getDistribution
916+
917+base.init
918+
919+pkgmgmt.initVariables
920+rpm.initVariables
921+poldek.initVariables
922+
923+base.initFilesystem "$OPTION_FORCE"
924+pkgmgmt.initFilesystem "$OPTION_FORCE"
925+rpm.initFilesystem
926+poldek.initFilesystem
927+
928+setup_writeOption "$VSERVER_NAME"
929+setup_writeInitialFstab
930+
931+test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
932+rpm.initDB "$SETUP_CONFDIR"
933+rpm.importGPGPubKeys "$SETUP_CONFDIR" \
934+ "$__CONFDIR/.distributions/$DISTRIBUTION/pubkeys" \
935+ "$__CONFDIR/.distributions/.common/pubkeys" \
936+ "$__DISTRIBDIR/$DISTRIBUTION/pubkeys"
937+
938+$_VPOLDEK "$SETUP_CONFDIR" -- --update-whole
939+poldek.installBasePackages "$SETUP_CONFDIR" "$PKGINSTALLDIR"
940+test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
941+
942+base.setSuccess
This page took 0.198776 seconds and 4 git commands to generate.