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