]> git.pld-linux.org Git - packages/util-vserver.git/blob - util-vserver-pld.patch
do not pull glibc-misc (and bash) for pld th
[packages/util-vserver.git] / util-vserver-pld.patch
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
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 @@
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 \
25 @@ -85,7 +86,9 @@
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
30 +                          gentoo/reboot.sh gentoo/shutdown.sh\
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
33  
34  nobase_confdistrib_DATA        =  rh9/apt/sources.list \
35                            fc1/apt/sources.list \
36 @@ -95,7 +99,9 @@
37                            fc5/apt/sources.list \
38                            fc6/apt/sources.list \
39                            f7/apt/sources.list \
40 -                          suse91/apt/sources.list
41 +                          suse91/apt/sources.list \
42 +                          pld-ac/poldek/repos.d/pld.conf \
43 +                          pld-th/poldek/repos.d/pld.conf
44  
45  AM_INSTALLCHECK_STD_OPTIONS_EXEMPT \
46                         =  $(nobase_distrib_SCRIPTS)
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
49 @@ -0,0 +1,6 @@
50 +basesystem
51 +filesystem
52 +glibc-misc
53 +issue
54 +rpm-base
55 +vserver-packages
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
58 @@ -0,0 +1,64 @@
59 +# $Id$
60 +# PLD Linux Distribution <http://www.pld-linux.org/>.
61 +#
62 +# Main sources for PLD Linux 2.0 (Ac)
63 +
64 +# specify our packages architecture
65 +_arch   = %ARCH%
66 +
67 +# main PLD-site for often changed things:
68 +_pld_main_prefix = ftp://ftp.ac.pld-linux.org/dists/ac
69 +
70 +## Some mirrors
71 +## You can use them if you have better connection there
72 +# CI TASK:
73 +#_prefix = ftp://ftp.task.pld-linux.org/dists/ac
74 +_prefix = %{_pld_main_prefix}
75 +
76 +_type = pndir
77 +
78 +# PLD Linux 2.0 (Ac)
79 +[source]
80 +type   = %{_type}
81 +name   = ac-main
82 +path   = %{_prefix}/PLD/%{_arch}/PLD/RPMS/
83 +signed = yes
84 +pri    = 1
85 +# msmtp-sendmail is broken, yum noarch is older than in updates
86 +ignore = msmtp-sendmail* yum*
87 +
88 +[source]
89 +type   = %{_type}
90 +name   = ac-updates
91 +path   = %{_prefix}/updates/%{_arch}/
92 +signed = yes
93 +pri    = 1
94 +
95 +[source]
96 +type   = %{_type}
97 +name   = ac-supported
98 +path   = %{_prefix}/supported/%{_arch}/
99 +signed = yes
100 +auto   = no
101 +autoup = no
102 +
103 +[source]
104 +type   = %{_type}
105 +name   = ac-ready
106 +path   = %{_pld_main_prefix}/ready/%{_arch}/
107 +#signed = yes
108 +auto   = no
109 +autoup = no
110 +
111 +[source]
112 +type   = %{_type}
113 +name   = ac-test
114 +path   = %{_pld_main_prefix}/test/%{_arch}/
115 +auto   = no
116 +autoup = no
117 +
118 +# ac-main + ac-updates
119 +[source]
120 +type   = group
121 +name   = ac
122 +sources = ac-main ac-updates
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
125 @@ -0,0 +1,3 @@
126 +%_netsharedpath                /dev:/proc
127 +%_tmppath                      /tmp
128 +%_host_os                      %_os
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
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
137 @@ -0,0 +1,6 @@
138 +basesystem
139 +filesystem
140 +glibc
141 +issue
142 +rpm-base
143 +vserver-packages
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
146 @@ -0,0 +1,71 @@
147 +# PLD Linux Distribution <http://www.pld-linux.org/>.
148 +#
149 +# Main sources for PLD Linux 3.0 (Th)
150 +
151 +# specify our packages architecture
152 +_arch   = %ARCH%
153 +
154 +# main PLD-site for often changed things (test, ready):
155 +_pld_main_prefix = ftp://ftp.th.pld-linux.org/dists/th
156 +
157 +## Some mirrors
158 +## You can use them if you have better connection there
159 +# CI TASK:
160 +#_prefix = ftp://ftp.task.pld-linux.org/dists/th
161 +_prefix = %{_pld_main_prefix}
162 +
163 +# PLD Linux 3.0 (Th): main sources
164 +[source]
165 +type   = pndir
166 +name   = th
167 +path   = %{_prefix}/PLD/%{_arch}/RPMS/
168 +
169 +[source]
170 +type   = pndir
171 +name   = th
172 +path   = %{_prefix}/PLD/noarch/RPMS/
173 +
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
181 +
182 +[source]
183 +type   = pndir
184 +name   = th-obsolete
185 +path   = %{_prefix}/obsolete/noarch/RPMS/
186 +auto   = no
187 +autoup = no
188 +
189 +# PLD Linux 3.0 (Th): ready sources (testing stage before moved to main)
190 +[source]
191 +type   = pndir
192 +name   = th-ready
193 +path   = %{_pld_main_prefix}/ready/%{_arch}/RPMS/
194 +auto   = no
195 +autoup = no
196 +
197 +[source]
198 +type   = pndir
199 +name   = th-ready
200 +path   = %{_pld_main_prefix}/ready/noarch/RPMS/
201 +auto   = no
202 +autoup = no
203 +
204 +# PLD Linux 3.0 (Th): test sources (built packages to be moved to ready)
205 +[source]
206 +type   = pndir
207 +name   = th-test
208 +path   = %{_pld_main_prefix}/test/%{_arch}/RPMS/
209 +auto   = no
210 +autoup = no
211 +
212 +[source]
213 +type   = pndir
214 +name   = th-test
215 +path   = %{_pld_main_prefix}/test/noarch/RPMS/
216 +auto   = no
217 +autoup = no
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
220 @@ -0,0 +1,3 @@
221 +%_netsharedpath                /dev:/proc
222 +%_tmppath                      /tmp
223 +%_host_os                      %_os
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
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
232 @@ -403,6 +403,20 @@
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  {
253 @@ -476,6 +490,7 @@
254             apt)        _pkgSetVarsApt;;
255             yum)        _pkgSetVarsYum;;
256             urpmi)      _pkgSetVarsUrpmi;;
257 +           poldek)     _pkgSetVarsPoldek;;
258             *)          echo "Unknown packaging flavor" >&2; exit 1;;
259         esac
260      done
261 @@ -770,6 +785,8 @@
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
270 @@ -837,6 +854,27 @@
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  {
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
300 @@ -21,6 +21,7 @@
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 \
308 @@ -48,12 +49,14 @@
309                                 scripts/vserver-build.template \
310                                 scripts/vserver-build.rsync \
311                                 scripts/vserver-build.clone \
312 +                               scripts/vserver-build.poldek \
313                                 scripts/vserver-build.functions \
314                                 scripts/vserver-build.functions.apt \
315                                 scripts/vserver-build.functions.pkgmgmt \
316                                 scripts/vserver-build.functions.rpm \
317                                 scripts/vserver-build.functions.urpmi \
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 \
323 @@ -66,6 +69,7 @@
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 \
331 @@ -89,6 +93,7 @@
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 \
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
341 @@ -195,7 +195,7 @@
342  "
343      
344      case $2 in
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[@]}")
347                 hasSubstring "$pkgs" ---rpm--- || {
348                     warning "$ERR
349  * The vserver does not seem to have the 'rpm' package which is required
350 @@ -205,9 +205,9 @@
351                     ERR=
352                 }
353                 
354 -               hasSubstring "$pkgs"  ---apt--- ---yum--- ---urpmi--- || {
355 +               hasSubstring "$pkgs"  ---apt--- ---yum--- ---urpmi--- ---poldek--- || {
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
362 @@ -368,6 +368,131 @@
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
475 +       tmpdir=$($_MKTEMPDIR -p /var/tmp pgmgmt.XXXXXX)
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
494 @@ -422,6 +547,7 @@
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
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
504 @@ -54,6 +54,7 @@
505  _LIB_VSERVER_BUILD_FUNCTIONS_RPM="$__PKGLIBDIR/vserver-build.functions.rpm"
506  _LIB_VSERVER_BUILD_FUNCTIONS_YUM="$__PKGLIBDIR/vserver-build.functions.yum"
507  _LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT="$__PKGLIBDIR/vserver-build.functions.pkgmgmt"
508 +_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK="$__PKGLIBDIR/vserver-build.functions.poldek"
509  _LISTDEVIP="$__LEGACYDIR/listdevip"
510  _LOCKFILE="$__PKGLIBDIR/lockfile"
511  _MASK2PREFIX="$__PKGLIBDIR/mask2prefix"
512 @@ -109,6 +110,8 @@
513  _VUNIFY="$__PKGLIBDIR/vunify"
514  _VYUM="$__SBINDIR/vyum"
515  _VYUM_WORKER="$__PKGLIBDIR/vyum-worker"
516 +_VPOLDEK="$__SBINDIR/vpoldek"
517 +_VPOLDEK_WORKER="$__PKGLIBDIR/vpoldek-worker"
518  
519  _AWK="@AWK@"
520  _BZIP2="@BZIP2@"
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
523 @@ -115,6 +115,44 @@
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)
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
570 @@ -0,0 +1,74 @@
571 +#! /bin/bash
572 +# $Id$
573 +
574 +# Copyright (C) 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
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 +
589 +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
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 +
613 +Copyright (C) 2007 Enrico Scholz
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 +
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
623 +
624 +while true; do
625 +    case "$1" in
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
635 +done
636 +
637 +VSOMETHING_TITLE=vpoldek
638 +VSOMETHING_WORKER=$_VPOLDEK_WORKER
639 +VSOMETHING_PKGMGMT=1
640 +
641 +export VSOMETHING_TITLE VSOMETHING_WORKER VSOMETHING_PKGMGMT
642 +
643 +test ${#poldek_opts[@]} -eq 0 || poldek_opts=( "${poldek_opts[@]}" -- )
644 +exec $_VSOMETHING "${send_through[@]}" poldek "${poldek_opts[@]}" "$@"
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
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 +
668 +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
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 +       "$@"
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
695 @@ -57,6 +57,9 @@
696                  ...  installs the base-packages of the given distribution with
697                      help of 'vyum'
698      urpmi       ... -- -d <distribution> -m <mirror>
699 +    poldek      ... -- -d <distribution>
700 +                ...  installs the base-packages of the given distribution with
701 +                    help of 'vpoldek'
702      rpm         ... -- [-d <distribution>] --empty|([--force] [--nodeps] <manifest>)+
703                  ...  installs lists of rpm-packages
704      skeleton    ... -- [<cmd> <args>*]
705 @@ -136,7 +139,7 @@
706  
707  case x"$method" in
708      (xlegacy)  exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;;
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)
711                 . $__PKGLIBDIR/vserver-build.$method
712                 ;;
713      (x)                panic $"No build-method specified";;
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 @@
717         elif test -e /etc/slackware-version; then
718             set -- $(cat /etc/slackware-version)
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
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
731 @@ -0,0 +1,81 @@
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 +{
786 +    mkdir -p "$PKGCFGDIR"/poldek/etc/repos.d
787 +
788 +    $_LN_S "$__CONFDIR"/.defaults/cachebase/poldek "$PKGCFGDIR"/poldek/cache
789 +
790 +    populateDirectory "$PKGCFGDIR/poldek/etc" \
791 +       "$__DISTRIBDIR/defaults/poldek" \
792 +       "$__DISTRIBDIR/$DISTRIBUTION/poldek" \
793 +       "$__CONFDIR/.distributions/$DISTRIBUTION/poldek"
794 +
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 +
800 +       if [ -n "$SETUP_MACHINE" ]; then
801 +               say "Using $SETUP_MACHINE as machine"
802 +               sed -i -e "s#^\(_arch\s*\)=.*#\1= $SETUP_MACHINE#" "$PKGCFGDIR"/poldek/etc/repos.d/*.conf
803 +       fi
804 +
805 +       if [ -n "$MIRROR" ]; then
806 +               say "Using $MIRROR as mirror URL"
807 +               sed -i -e "s#^\(_prefix\s*\)=.*#\1= $MIRROR#" "$PKGCFGDIR"/poldek/etc/repos.d/*.conf
808 +       fi
809 +
810 +#    test -z "$POLDEKCONFDEFAULT" || \
811 +#      $_LN_S "$POLDEKCONFDEFAULT" "$PKGCFGDIR"/poldek/etc/
812 +}
813 --- util-vserver-0.30.216-r2837.orig/scripts/vserver-build.poldek       1970-01-01 01:00:00.000000000 +0100
814 +++ util-vserver-0.30.216-r2837/scripts/vserver-build.poldek    2009-06-22 17:48:26.000000000 +0200
815 @@ -0,0 +1,65 @@
816 +# $Id$ --*- sh -*--
817 +
818 +# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
819 +#  
820 +# This program is free software; you can redistribute it and/or modify
821 +# it under the terms of the GNU General Public License as published by
822 +# the Free Software Foundation; version 2 of the License.
823 +#  
824 +# This program is distributed in the hope that it will be useful,
825 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
826 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
827 +# GNU General Public License for more details.
828 +#  
829 +# You should have received a copy of the GNU General Public License
830 +# along with this program; if not, write to the Free Software
831 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
832 +
833 +tmp=$(getopt -o +d:,m: --long debug -n "$0" -- "$@") || exit 1
834 +eval set -- "$tmp"
835 +
836 +. "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM"
837 +. "$_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK"
838 +. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
839 +
840 +while true; do
841 +    case "$1" in
842 +       (-d)            DISTRIBUTION=$2; shift;;
843 +       (-m)            MIRROR=$2; shift;;
844 +       (--debug)       set -x;;
845 +       (--)            shift; break ;;
846 +       (*)             echo "vserver-build.poldek: internal error: unrecognized option '$1'" >&2
847 +                       exit 1
848 +                       ;;
849 +    esac
850 +    shift
851 +done
852 +
853 +getDistribution
854 +
855 +base.init
856 +
857 +pkgmgmt.initVariables
858 +rpm.initVariables
859 +poldek.initVariables
860 +
861 +base.initFilesystem    "$OPTION_FORCE"
862 +pkgmgmt.initFilesystem "$OPTION_FORCE"
863 +rpm.initFilesystem
864 +poldek.initFilesystem
865 +
866 +setup_writeOption "$VSERVER_NAME"
867 +setup_writeInitialFstab
868 +
869 +test -z "$BUILD_INITPRE"  || "$BUILD_INITPRE" "$SETUP_CONFDIR"  "$UTIL_VSERVER_VARS"
870 +rpm.initDB           "$SETUP_CONFDIR"
871 +rpm.importGPGPubKeys "$SETUP_CONFDIR" \
872 +       "$__CONFDIR/.distributions/$DISTRIBUTION/pubkeys" \
873 +       "$__CONFDIR/.distributions/.common/pubkeys" \
874 +       "$__DISTRIBDIR/$DISTRIBUTION/pubkeys"
875 +
876 +$_VPOLDEK "$SETUP_CONFDIR" -- --update-whole
877 +poldek.installBasePackages "$SETUP_CONFDIR" "$PKGINSTALLDIR"
878 +test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
879 +
880 +base.setSuccess
This page took 0.202904 seconds and 4 git commands to generate.