]>
Commit | Line | Data |
---|---|---|
b8ffb90d | 1 | diff -urN util-vserver-0.30.207/scripts/Makefile-files util-vserver-0.30.207-poldek/scripts/Makefile-files |
6c893a66 JR |
2 | --- util-vserver-0.30.207/scripts/Makefile-files 2005-04-28 19:45:34.000000000 +0200 |
3 | +++ util-vserver-0.30.207-poldek/scripts/Makefile-files 2005-05-16 16:28:02.627433152 +0200 | |
4 | @@ -21,6 +21,7 @@ | |
5 | scripts/vapt-get-worker \ | |
6 | scripts/vrpm-worker \ | |
7 | scripts/vyum-worker \ | |
8 | + scripts/vpoldek-worker \ | |
9 | scripts/vrpm-preload \ | |
10 | scripts/save_s_context \ | |
11 | scripts/vservers.grabinfo.sh \ | |
12 | @@ -43,11 +44,13 @@ | |
13 | scripts/vserver-build.debootstrap \ | |
14 | scripts/vserver-build.rpm \ | |
15 | scripts/vserver-build.yum \ | |
16 | + scripts/vserver-build.poldek \ | |
17 | scripts/vserver-build.functions \ | |
18 | scripts/vserver-build.functions.apt \ | |
19 | scripts/vserver-build.functions.rpm \ | |
20 | scripts/vserver-build.functions.pkgmgmt \ | |
21 | scripts/vserver-build.functions.yum \ | |
22 | + scripts/vserver-build.functions.poldek \ | |
23 | scripts/vserver-setup.functions \ | |
24 | scripts/vserver.functions \ | |
25 | scripts/vserver.start \ | |
26 | @@ -59,6 +62,7 @@ | |
27 | scripts_pkglib_src_SCRPTS = scripts/pkgmgmt \ | |
28 | scripts/vapt-get-worker \ | |
29 | scripts/vpkg \ | |
30 | + scripts/vpoldek-worker \ | |
31 | scripts/vrpm-worker \ | |
32 | scripts/vrpm-preload \ | |
33 | scripts/start-vservers \ | |
34 | @@ -80,6 +84,7 @@ | |
35 | ||
36 | scripts_sbin_src_PRGS = scripts/chcontext \ | |
37 | scripts/vapt-get \ | |
38 | + scripts/vpoldek \ | |
39 | scripts/vpstree \ | |
40 | scripts/vrpm \ | |
41 | scripts/vserver \ | |
b8ffb90d | 42 | diff -urN util-vserver-0.30.207/scripts/functions util-vserver-0.30.207-poldek/scripts/functions |
8373da2d JR |
43 | --- util-vserver-0.30.207/scripts/functions 2005-04-28 20:02:27.000000000 +0200 |
44 | +++ util-vserver-0.30.207-poldek/scripts/functions 2005-05-16 18:35:20.652426168 +0200 | |
45 | @@ -324,6 +324,20 @@ | |
46 | fi | |
47 | } | |
48 | ||
49 | +function _pkgSetVarsPoldek | |
50 | +{ | |
51 | + if test -n "$PKGDIR"; then | |
52 | + findDir POLDEKETCDIR $PKGDIR/poldeketc $PKGDIR/base/poldek/etc /etc | |
53 | + findDir POLDEKCACHEDIR $PKGDIR/poldekcache $PKGDIR/base/poldek/cache | |
54 | + else | |
55 | + findDir POLDEKETCDIR "$VDIR"/etc /etc | |
56 | + findDir POLDEKCACHEDIR "$VDIR"/var/tmp/poldek-cache | |
57 | + fi | |
58 | + | |
59 | + findFile POLDEK_CONFIG "$POLDEKETCDIR"/poldek.conf "" | |
60 | + test -z "$POLDEK_CONFIG" || export POLDEK_CONFIG | |
61 | +} | |
62 | + | |
63 | ||
64 | function _pkgMountBase | |
65 | { | |
66 | @@ -397,6 +411,7 @@ | |
67 | rpm) _pkgSetVarsRPM;; | |
68 | apt) _pkgSetVarsApt;; | |
69 | yum) _pkgSetVarsYum;; | |
70 | + poldek) _pkgSetVarsPoldek;; | |
71 | *) echo "Unknown packaging flavor" >&2; exit 1;; | |
72 | esac | |
73 | done | |
b8ffb90d | 74 | diff -urN util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst |
6c893a66 JR |
75 | --- util-vserver-0.30.207/scripts/util-vserver-vars.pathsubst 2005-03-23 03:05:39.000000000 +0100 |
76 | +++ util-vserver-0.30.207-poldek/scripts/util-vserver-vars.pathsubst 2005-05-16 16:24:45.250439016 +0200 | |
77 | @@ -49,6 +49,7 @@ | |
78 | _LIB_VSERVER_BUILD_FUNCTIONS_RPM="$__PKGLIBDIR/vserver-build.functions.rpm" | |
79 | _LIB_VSERVER_BUILD_FUNCTIONS_YUM="$__PKGLIBDIR/vserver-build.functions.yum" | |
80 | _LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT="$__PKGLIBDIR/vserver-build.functions.pkgmgmt" | |
81 | +_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK="$__PKGLIBDIR/vserver-build.functions.poldek" | |
82 | _LISTDEVIP="$__LEGACYDIR/listdevip" | |
83 | _LOCKFILE="$__PKGLIBDIR/lockfile" | |
84 | _MASK2PREFIX="$__PKGLIBDIR/mask2prefix" | |
85 | @@ -91,6 +92,8 @@ | |
86 | _VUNIFY="$__PKGLIBDIR/vunify" | |
87 | _VYUM="$__SBINDIR/vyum" | |
88 | _VYUM_WORKER="$__PKGLIBDIR/vyum-worker" | |
89 | +_VPOLDEK="$__SBINDIR/vpoldek" | |
90 | +_VPOLDEK_WORKER="$__PKGLIBDIR/vpoldek-worker" | |
91 | ||
92 | _AWK="@AWK@" | |
93 | _CAT="@CAT@" | |
b8ffb90d | 94 | diff -urN util-vserver-0.30.207/scripts/vpoldek util-vserver-0.30.207-poldek/scripts/vpoldek |
6c893a66 | 95 | --- util-vserver-0.30.207/scripts/vpoldek 1970-01-01 01:00:00.000000000 +0100 |
b8ffb90d JR |
96 | +++ util-vserver-0.30.207-poldek/scripts/vpoldek 2005-05-17 01:05:52.770786976 +0200 |
97 | @@ -0,0 +1,96 @@ | |
6c893a66 JR |
98 | +#! /bin/bash |
99 | +# $Id$ | |
100 | + | |
101 | +# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | |
102 | +# | |
103 | +# This program is free software; you can redistribute it and/or modify | |
104 | +# it under the terms of the GNU General Public License as published by | |
105 | +# the Free Software Foundation; version 2 of the License. | |
106 | +# | |
107 | +# This program is distributed in the hope that it will be useful, | |
108 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
109 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
110 | +# GNU General Public License for more details. | |
111 | +# | |
112 | +# You should have received a copy of the GNU General Public License | |
113 | +# along with this program; if not, write to the Free Software | |
114 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
115 | + | |
116 | +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} | |
117 | +test -e "$UTIL_VSERVER_VARS" || { | |
118 | + echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2 | |
119 | + exit 1 | |
120 | +} | |
121 | +. "$UTIL_VSERVER_VARS" | |
122 | +. "$_LIB_FUNCTIONS" | |
123 | + | |
124 | + | |
125 | +function showHelp() | |
126 | +{ | |
127 | + echo \ | |
128 | +$"Usage: $0 <vserver-name>* [--all] -- <params>+ | |
129 | + | |
130 | +Report bugs to <$PACKAGE_BUGREPORT>." | |
b8ffb90d | 131 | + exit 0 |
6c893a66 JR |
132 | +} |
133 | + | |
134 | +function showVersion() | |
135 | +{ | |
136 | + echo \ | |
137 | +$"vpoldek $PACKAGE_VERSION -- poldek for vservers | |
138 | +This program is part of $PACKAGE_STRING | |
139 | + | |
140 | +Copyright (C) 2003 Enrico Scholz | |
141 | +This program is free software; you may redistribute it under the terms of | |
142 | +the GNU General Public License. This program has absolutely no warranty." | |
b8ffb90d | 143 | + exit 0 |
6c893a66 JR |
144 | +} |
145 | + | |
146 | +is_quiet= | |
147 | +declare -a vservers=() | |
148 | + | |
149 | +while test "$#" -ge 1; do | |
150 | + case "$1" in | |
151 | + --) shift; break;; | |
b8ffb90d | 152 | + --help) showHelp $0;; |
6c893a66 JR |
153 | + --quiet|-q) is_quiet=1 ;; |
154 | + --all) | |
155 | + getAllVservers tmp | |
156 | + vservers=( "${vservers[@]}" "${tmp[@]}" ) | |
157 | + ;; | |
158 | + --version) | |
b8ffb90d | 159 | + showVersion ;; |
6c893a66 JR |
160 | + *) vservers=( "${vservers[@]}" "$1" ) |
161 | + esac | |
162 | + shift | |
163 | +done | |
164 | + | |
6c893a66 JR |
165 | +cnt=0 |
166 | +res=255 | |
167 | +for i in "${vservers[@]}"; do | |
168 | + cnt=$[ cnt + 1 ] | |
169 | + | |
170 | + test -n "$is_quiet" || { | |
171 | + colorize bold echo -n "vpoldek: operating on vserver " | |
172 | + colorize bold colorize emph echo "$i" | |
173 | + xtermTitle "vpoldek: operating on vserver '$i' [$cnt/${#vservers[@]}]" | |
174 | + } | |
175 | + | |
176 | + if pkgmgmt.isInternal "$i"; then | |
177 | + $_VSERVER "$i" exec poldek "$@" | |
178 | + else | |
179 | + callInNamespace "$i" \ | |
180 | + "$_VNAMESPACE" --new -- "$_VPOLDEK_WORKER" "$i" "$@" | |
181 | + fi | |
182 | + res=$? | |
183 | + | |
184 | + test $res -eq 0 -o -n "$is_quiet" || { | |
185 | + colorize error echo -n $"vpoldek failed on vserver '$i' with errorcode $res" | |
186 | + echo | |
187 | + } | |
188 | + | |
189 | + test -n "$is_quiet" || echo | |
190 | +done | |
191 | + | |
192 | +test "$cnt" -ge 0 || echo "No vservers specified" >&2 | |
193 | +exit $res | |
b8ffb90d | 194 | diff -urN util-vserver-0.30.207/scripts/vpoldek-worker util-vserver-0.30.207-poldek/scripts/vpoldek-worker |
6c893a66 | 195 | --- util-vserver-0.30.207/scripts/vpoldek-worker 1970-01-01 01:00:00.000000000 +0100 |
b8ffb90d | 196 | +++ util-vserver-0.30.207-poldek/scripts/vpoldek-worker 2005-05-17 00:50:36.995383984 +0200 |
6c893a66 JR |
197 | @@ -0,0 +1,40 @@ |
198 | +#! /bin/bash | |
199 | +# $Id$ | |
200 | + | |
201 | +# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | |
202 | +# | |
203 | +# This program is free software; you can redistribute it and/or modify | |
204 | +# it under the terms of the GNU General Public License as published by | |
205 | +# the Free Software Foundation; version 2 of the License. | |
206 | +# | |
207 | +# This program is distributed in the hope that it will be useful, | |
208 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
209 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
210 | +# GNU General Public License for more details. | |
211 | +# | |
212 | +# You should have received a copy of the GNU General Public License | |
213 | +# along with this program; if not, write to the Free Software | |
214 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
215 | + | |
216 | +set -e | |
217 | + | |
218 | +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} | |
219 | +test -e "$UTIL_VSERVER_VARS" || { | |
220 | + echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2 | |
221 | + exit 1 | |
222 | +} | |
223 | +. "$UTIL_VSERVER_VARS" | |
224 | +. "$_LIB_FUNCTIONS" | |
225 | + | |
226 | + | |
227 | +vserver="$1" | |
228 | +shift | |
229 | + | |
b8ffb90d | 230 | +pkgInit "$vserver" poldek |
6c893a66 JR |
231 | + |
232 | +test -z "$_POLDEK" || { | |
233 | + warning $"The environment variable \$_POLDEK is not supported anymore; please use \$POLDEK instead of" | |
234 | + ${POLDEK:=$_POLDEK} | |
235 | +} | |
236 | + | |
8373da2d | 237 | +exec ${_POLDEK:-poldek} -v --root=$VDIR --cachedir=$POLDEKCACHEDIR "$@" |
b8ffb90d | 238 | diff -urN util-vserver-0.30.207/scripts/vserver-build util-vserver-0.30.207-poldek/scripts/vserver-build |
6c893a66 | 239 | --- util-vserver-0.30.207/scripts/vserver-build 2005-03-21 21:03:31.000000000 +0100 |
8373da2d | 240 | +++ util-vserver-0.30.207-poldek/scripts/vserver-build 2005-05-16 18:48:36.353461224 +0200 |
6c893a66 JR |
241 | @@ -56,6 +56,9 @@ |
242 | yum ... -- -d <distribution> | |
243 | ... installs the base-packages of the given distribution with | |
244 | help of 'vyum' | |
245 | + poldek ... -- -d <distribution> | |
246 | + ... installs the base-packages of the given distribution with | |
247 | + help of 'vpoldek' | |
248 | rpm ... -- [-d <distribution>] --empty|([--force] [--nodeps] <manifest>)+ | |
249 | ... installs lists of rpm-packages | |
250 | skeleton ... -- [<cmd> <args>*] | |
251 | @@ -121,7 +124,7 @@ | |
252 | ||
253 | case x"$method" in | |
254 | (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;; | |
255 | - (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm) | |
256 | + (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xpoldek) | |
257 | . $__PKGLIBDIR/vserver-build.$method | |
258 | ;; | |
259 | (x) panic $"No build-method specified";; | |
b8ffb90d | 260 | diff -urN util-vserver-0.30.207/scripts/vserver-build.functions util-vserver-0.30.207-poldek/scripts/vserver-build.functions |
8373da2d JR |
261 | --- util-vserver-0.30.207/scripts/vserver-build.functions 2005-04-16 23:20:45.000000000 +0200 |
262 | +++ util-vserver-0.30.207-poldek/scripts/vserver-build.functions 2005-05-16 18:31:25.209218976 +0200 | |
263 | @@ -133,6 +133,9 @@ | |
264 | elif test -e /etc/slackware-release; then | |
265 | set -- $(cat /etc/slackware-release) | |
266 | DISTRIBUTION=slackware$2 | |
267 | + elif test -e /etc/pld-release; then | |
268 | + set -- $(cat /etc/pld-release) | |
269 | + DISTRIBUTION=pld$1 | |
270 | elif test -n "$1"; then | |
271 | DISTRIBUTION=$1 | |
272 | else | |
b8ffb90d | 273 | diff -urN util-vserver-0.30.207/scripts/vserver-build.functions.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek |
6c893a66 | 274 | --- util-vserver-0.30.207/scripts/vserver-build.functions.poldek 1970-01-01 01:00:00.000000000 +0100 |
8373da2d | 275 | +++ util-vserver-0.30.207-poldek/scripts/vserver-build.functions.poldek 2005-05-16 18:50:01.703486048 +0200 |
6c893a66 JR |
276 | @@ -0,0 +1,64 @@ |
277 | +# $Id$ --*- sh -*-- | |
278 | + | |
279 | +# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | |
280 | +# | |
281 | +# This program is free software; you can redistribute it and/or modify | |
282 | +# it under the terms of the GNU General Public License as published by | |
283 | +# the Free Software Foundation; version 2 of the License. | |
284 | +# | |
285 | +# This program is distributed in the hope that it will be useful, | |
286 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
287 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
288 | +# GNU General Public License for more details. | |
289 | +# | |
290 | +# You should have received a copy of the GNU General Public License | |
291 | +# along with this program; if not, write to the Free Software | |
292 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
293 | + | |
294 | +function poldek.installBasePackages | |
295 | +{ | |
296 | + local name="$1" | |
297 | + local dir="$2" | |
298 | + | |
299 | + test "$dir" != / || return 0 | |
300 | + for filelist in "$dir"/*; do | |
301 | + isRegularFile "$filelist" || continue | |
302 | + local idx=0 | |
303 | + local can_fail=false | |
304 | + local flags= | |
305 | + | |
306 | + set -- $(<$filelist) | |
307 | + while test "$#" -gt 0; do | |
308 | + case "$1" in | |
309 | + --reinstall) flags='--reinstall';; | |
310 | + --can-fail) can_fail=true;; | |
311 | + *) break;; | |
312 | + esac | |
313 | + shift | |
314 | + done | |
8373da2d | 315 | + "$_VPOLDEK" "$name" -- --install $flags $* || $can_fail |
6c893a66 JR |
316 | + done |
317 | +} | |
318 | + | |
319 | +function poldek.initVariables | |
320 | +{ | |
321 | + findFile APTCONFDEFAULT \ | |
322 | + "$__CONFDIR/.distributions/$DISTRIBUTION/poldek.conf" \ | |
323 | + "$__CONFDIR/.defaults/apps/pkgmgmt/poldek.conf" \ | |
324 | + "$__DISTRIBDIR/$DISTRIBUTION/poldek.conf" \ | |
325 | + "$__DISTRIBDIR/defaults/poldek.conf" \ | |
326 | + '' | |
327 | +} | |
328 | + | |
329 | +function poldek.initFilesystem | |
330 | +{ | |
331 | + mkdir -p "$PKGCFGDIR"/poldek/{etc,cache} | |
332 | + | |
333 | + populateDirectory "$PKGCFGDIR/poldek/etc" \ | |
334 | + "$__DISTRIBDIR/defaults/poldek" \ | |
335 | + "$__DISTRIBDIR/$DISTRIBUTION/poldek" \ | |
336 | + "$__CONFDIR/.distributions/$DISTRIBUTION/poldek" | |
337 | + | |
338 | + test -z "$POLDEKCONFDEFAULT" || \ | |
339 | + $_LN_S "$POLDEKCONFDEFAULT" "$PKGCFGDIR"/poldek/etc/poldek.conf | |
340 | +} | |
b8ffb90d | 341 | diff -urN util-vserver-0.30.207/scripts/vserver-build.poldek util-vserver-0.30.207-poldek/scripts/vserver-build.poldek |
6c893a66 | 342 | --- util-vserver-0.30.207/scripts/vserver-build.poldek 1970-01-01 01:00:00.000000000 +0100 |
b8ffb90d JR |
343 | +++ util-vserver-0.30.207-poldek/scripts/vserver-build.poldek 2005-05-17 00:52:02.964314720 +0200 |
344 | @@ -0,0 +1,54 @@ | |
6c893a66 JR |
345 | +# $Id$ --*- sh -*-- |
346 | + | |
347 | +# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | |
348 | +# | |
349 | +# This program is free software; you can redistribute it and/or modify | |
350 | +# it under the terms of the GNU General Public License as published by | |
351 | +# the Free Software Foundation; version 2 of the License. | |
352 | +# | |
353 | +# This program is distributed in the hope that it will be useful, | |
354 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
355 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
356 | +# GNU General Public License for more details. | |
357 | +# | |
358 | +# You should have received a copy of the GNU General Public License | |
359 | +# along with this program; if not, write to the Free Software | |
360 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
361 | + | |
362 | +tmp=$(getopt -o +d: --long debug -n "$0" -- "$@") || exit 1 | |
363 | +eval set -- "$tmp" | |
364 | + | |
6c893a66 JR |
365 | +. "$_LIB_VSERVER_BUILD_FUNCTIONS_POLDEK" |
366 | +. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" | |
367 | + | |
368 | +while true; do | |
369 | + case "$1" in | |
370 | + (-d) DISTRIBUTION=$2; shift;; | |
371 | + (--debug) set -x;; | |
372 | + (--) shift; break ;; | |
b8ffb90d | 373 | + (*) echo "vserver-build.poldek: internal error: unrecognized option '$1'" >&2 |
6c893a66 JR |
374 | + exit 1 |
375 | + ;; | |
376 | + esac | |
377 | + shift | |
378 | +done | |
379 | + | |
380 | +getDistribution | |
381 | + | |
382 | +base.initVariables | |
383 | +pkgmgmt.initVariables | |
6c893a66 JR |
384 | +poldek.initVariables |
385 | + | |
386 | +base.initFilesystem "$OPTION_FORCE" | |
387 | +pkgmgmt.initFilesystem "$OPTION_FORCE" | |
6c893a66 JR |
388 | +poldek.initFilesystem |
389 | + | |
390 | +setup_writeOption "$VSERVER_NAME" | |
391 | +setup_writeInitialFstab | |
392 | + | |
393 | +test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" | |
6c893a66 JR |
394 | + |
395 | +$_VPOLDEK "$SETUP_CONFDIR" -- --update-whole | |
396 | +poldek.installBasePackages "$SETUP_CONFDIR" "$PKGINSTALLDIR" | |
397 | +$_VPOLDEK "$SETUP_CONFDIR" -- --clean | |
398 | +test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" |