[Ultrapossum-cvs 679] demo/uml/debian ...

アーカイブの一覧に戻る

Masato Taruishi taru****@users*****
2004年 10月 6日 (水) 21:23:00 JST


===================================================================
RCS file: demo/uml/debian/config,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- demo/uml/debian/config	2004/09/08 15:25:15	1.9
+++ demo/uml/debian/config	2004/10/06 12:22:59	1.10
@@ -4,11 +4,28 @@
 
 . /usr/share/debconf/confmodule
 
-eval `ultrapossum-config init`
-trap "eval `ultrapossum-config term`" 0
-
 db_version 2.0
 
+if test -x "/usr/share/ultrapossum/update.d/update-uml"; then
+  eval `/usr/bin/ultrapossum-config init`
+  trap "eval `ultrapossum-config term`" 0
+else
+  :
+fi
+
+if test "x$1" = "xreconfigure"; then
+  set() {
+    db_set "$1" "$2"
+  }
+else
+  set() {
+    db_fget "$1" seen
+    if test "x$RET" = "xfalse"; then
+      db_set "$1" "$2"
+    fi
+  }
+fi
+
 uml_hosts="$MASTER"
 if test "x$ULTRAMONKEYNODES" != "x"; then
   for h in $ULTRAMONKEYNODES
@@ -36,30 +53,9 @@
 db_subst ultrapossum-uml/uml_hosts hosts "$uml_hosts"
 db_subst ultrapossum-uml/uml_mirror_candidates candidates "$uml_mirror_candidates"
 
-db_fget ultrapossum-uml/uml_hosts seen
-if test "x$RET" = "xtrue"; then
-  db_get ultrapossum-uml/uml_hosts
-  us=`echo $RET | tr , ' '`
-  for u in $us; do
-    if ! include "$u" "`echo $uml_hosts | tr -d ,`"; then
-      db_fset ultrapossum-uml/uml_hosts seen false
-    fi
-  done
-fi
-
-if test "x$RET" = "xfalse" || test "x$1" = "xreconfigure"; then
-  db_set ultrapossum-uml/uml_hosts "`echo $UML_HOSTS | sed 's/ /, /g'`"
-fi
-
-db_fget ultrapossum-uml/uml_dist seen
-if test "x$RET" = "xfalse" || test "x$1" = "xreconfigure"; then
-  db_set ultrapossum-uml/uml_dist "$UML_DIST"
-fi
-
-db_fget ultrapossum-uml/uml_mem seen
-if test "x$RET" = "xfalse" || test "x$1" = "xreconfigure"; then
-  db_set ultrapossum-uml/uml_mem "$UML_MEM"
-fi
+set ultrapossum-uml/uml_hosts "`echo $UML_HOSTS | sed 's/ /, /g'`"
+set ultrapossum-uml/uml_dist "$UML_DIST"
+set ultrapossum-uml/uml_mem "$UML_MEM"
 
 db_input medium ultrapossum-uml/uml_dist || true
 db_input low ultrapossum-uml/uml_mem || true
@@ -73,6 +69,25 @@
   db_input medium ultrapossum-uml/uml_mirror || true
   db_go
 else
-  db_set ultrapossum-uml/uml_mirror "$RET"
+  set ultrapossum-uml/uml_mirror "$RET"
 fi
+
+db_get ultrapossum-uml/uml_hosts
+hosts=$(echo "$RET" | tr -d ,)
+for h in $hosts
+do
+  db_register ultrapossum-uml/packages ultrapossum-uml/$h/packages
+  db_subst ultrapossum-uml/$h/packages host $h
+  if test -x "$MODULEDIR/uml/map"; then
+    eval "`$MODULEDIR/uml/map $h 2> /dev/null`"
+    s="`echo $suggests | sed 's/ /, /g'`"
+    db_subst ultrapossum-uml/$h/packages packages "$s"
+    set ultrapossum-uml/$h/packages "$s"
+  else
+    db_subst ultrapossum-uml/$h/packages packages "ultrapossum-common"
+    set ultrapossum-uml/$h/packages "ultrapossum-common"
+  fi
+  db_input low ultrapossum-uml/$h/packages || true
+done
+db_go
 
===================================================================
RCS file: demo/uml/debian/templates,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- demo/uml/debian/templates	2004/09/16 15:57:10	1.4
+++ demo/uml/debian/templates	2004/10/06 12:22:59	1.5
@@ -25,3 +25,8 @@
 Default: http://http.us.debian.org/debian/
 Description: Where do you retrieve packages from?
 
+Template: ultrapossum-uml/packages
+Type: multiselect
+Choices: ${packages}
+Description: What packages do you want to install in ${host}?
+
===================================================================
RCS file: demo/uml/debian/ultrapossum-uml.postinst,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- demo/uml/debian/ultrapossum-uml.postinst	2004/07/09 02:45:52	1.7
+++ demo/uml/debian/ultrapossum-uml.postinst	2004/10/06 12:22:59	1.8
@@ -38,6 +38,16 @@
 	db_get ultrapossum-uml/uml_mirror
 	UML_MIRROR=$RET
 	ultrapossum-config set uml UML_HOSTS="$UML_HOSTS" UML_DIST="$UML_DIST" UML_MEM="$UML_MEM" UML_MIRROR="$UML_MIRROR"
+	for h in $UML_HOSTS
+	do
+	  install -d $UML_CONFDIR/$h
+	  /bin/cp /dev/null $UML_CONFDIR/$h/selections
+          db_get ultrapossum-uml/$h/packages
+	  for p in `echo "$RET" | tr -d ,`
+	  do
+            echo "$p				install" >> $UML_CONFDIR/$h/selections
+	  done
+	done
 	/usr/share/ultrapossum/update.d/update-uml configure
         for h in $UML_HOSTS
         do



Ultrapossum-cvs メーリングリストの案内
アーカイブの一覧に戻る