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