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