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