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