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