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