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