summaryrefslogtreecommitdiff
blob: 9bb46be5f1370dca9caa4f50067c5c399f6df131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
diff -Nurp util-vserver-0.30.210.orig/contrib/manifest.dat.pathsubst util-vserver-0.30.210.clone/contrib/manifest.dat.pathsubst
--- util-vserver-0.30.210.orig/contrib/manifest.dat.pathsubst	2006-01-21 22:34:46.000000000 +0100
+++ util-vserver-0.30.210.clone/contrib/manifest.dat.pathsubst	2006-03-16 01:48:57.000000000 +0100
@@ -7,6 +7,7 @@ build  @PKGLIBDIR@/vserver-build.skeleto
 build  @PKGLIBDIR@/vserver-build.debootstrap
 build  @PKGLIBDIR@/vserver-build.yum
 build  @PKGLIBDIR@/vserver-build.rpm
+build  @PKGLIBDIR@/vserver-build.clone
 build  @PKGLIBDIR@/vserver-build.functions
 build  @PKGLIBDIR@/vserver-build.functions.apt
 build  @PKGLIBDIR@/vserver-build.functions.rpm
diff -Nurp util-vserver-0.30.210.orig/scripts/Makefile-files util-vserver-0.30.210.clone/scripts/Makefile-files
--- util-vserver-0.30.210.orig/scripts/Makefile-files	2005-04-28 19:45:34.000000000 +0200
+++ util-vserver-0.30.210.clone/scripts/Makefile-files	2006-03-16 02:08:32.000000000 +0100
@@ -43,6 +43,7 @@ scripts_pkglib_src_DTA =	scripts/functio
 				scripts/vserver-build.debootstrap \
 				scripts/vserver-build.rpm \
 				scripts/vserver-build.yum \
+				scripts/vserver-build.clone \
 				scripts/vserver-build.functions \
 				scripts/vserver-build.functions.apt \
 				scripts/vserver-build.functions.rpm \
diff -Nurp util-vserver-0.30.210.orig/scripts/vserver-build util-vserver-0.30.210.clone/scripts/vserver-build
--- util-vserver-0.30.210.orig/scripts/vserver-build	2005-07-03 19:45:43.000000000 +0200
+++ util-vserver-0.30.210.clone/scripts/vserver-build	2006-03-16 01:48:36.000000000 +0100
@@ -126,7 +126,7 @@ setup_setDefaults "$VSERVER_NAME"
 
 case x"$method" in
     (xlegacy)	exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;;
-    (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm)
+    (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xclone)
 		. $__PKGLIBDIR/vserver-build.$method
 		;;
     (x)		panic $"No build-method specified";;
diff -Nurp util-vserver-0.30.210.orig/scripts/vserver-build.clone util-vserver-0.30.210.clone/scripts/vserver-build.clone
--- util-vserver-0.30.210.orig/scripts/vserver-build.clone	1970-01-01 01:00:00.000000000 +0100
+++ util-vserver-0.30.210.clone/scripts/vserver-build.clone	2006-03-16 02:08:07.000000000 +0100
@@ -0,0 +1,60 @@
+# $Id$	--*- sh -*--
+
+# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#  
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#  
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#  
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+tmp=$(getopt -o '+d:' --long debug,pkgmgmt,source: -n "$0" -- "$@") || exit 1
+eval set -- "$tmp"
+
+. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
+
+DISTRIBUTION=:
+use_pkgmgmt=
+source=
+
+while true; do
+    case "$1" in
+	-d)		DISTRIBUTION=$2; shift;;
+	--debug)	set -x;;
+	--pkgmgmt)	use_pkgmgmt=1;;
+	--source)	source=$2; shift;;
+	--)		shift; break ;;
+	*)		echo "vserver-build.clone: internal error: unrecognized option '$1'" >&2
+			exit 1
+			;;
+    esac
+    shift
+done
+
+test -z "$source" && panic $"vserver-build.clone: --source <vserver> is required!"
+
+getDistribution '' 1
+
+base.init
+test -z "$use_pkgmgmt" || pkgmgmt.initVariables
+
+base.initFilesystem "$OPTION_FORCE"
+test -z "$use_pkgmgmt" || pkgmgmt.initFilesystem "$OPTION_FORCE"
+
+setup_writeOption "$VSERVER_NAME"
+setup_writeInitialFstab
+
+$_CP -a "$__CONFDIR/$source/vdir/." "$VDIR"
+
+test -z "$BUILD_INITPRE"  || "$BUILD_INITPRE" "$SETUP_CONFDIR"  "$UTIL_VSERVER_VARS"
+test -z "$1" || "$@"
+test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
+
+base.setSuccess