Author: locilka
Date: Wed Oct 10 14:08:04 2007
New Revision: 41316
URL: http://svn.opensuse.org/viewcvs/yast?rev=41316&view=rev
Log:
- initial version of POS-Installation module
* POS Data Migration client
* POS Pattern Selector
- 2.13.0
Added:
trunk/pos-installation/
trunk/pos-installation/.cvsignore
trunk/pos-installation/MAINTAINER
trunk/pos-installation/Makefile.cvs
trunk/pos-installation/RPMNAME
trunk/pos-installation/VERSION
trunk/pos-installation/agents/
trunk/pos-installation/agents/.cvsignore
trunk/pos-installation/agents/Makefile.am
trunk/pos-installation/configure.in.in
trunk/pos-installation/control/
trunk/pos-installation/control/Makefile.am
trunk/pos-installation/control/README.txt
trunk/pos-installation/control/installation.xml
trunk/pos-installation/control/slepos_migration.xml
trunk/pos-installation/doc/
trunk/pos-installation/doc/.cvsignore
trunk/pos-installation/doc/Makefile.am
trunk/pos-installation/doc/autodocs/
trunk/pos-installation/doc/autodocs/.cvsignore
trunk/pos-installation/doc/autodocs/Makefile.am
trunk/pos-installation/package/
trunk/pos-installation/package/.cvsignore
trunk/pos-installation/package/yast2-pos-installation.changes
trunk/pos-installation/src/
trunk/pos-installation/src/.cvsignore
trunk/pos-installation/src/Makefile.am
trunk/pos-installation/src/clients/
trunk/pos-installation/src/clients/Makefile.am
trunk/pos-installation/src/clients/slepos_data_migration.ycp
trunk/pos-installation/src/clients/slepos_server_selection.ycp
trunk/pos-installation/src/scripts/
trunk/pos-installation/src/scripts/Makefile.am
trunk/pos-installation/src/scripts/slepos_post.pl (with props)
trunk/pos-installation/testsuite/
trunk/pos-installation/testsuite/.cvsignore
trunk/pos-installation/testsuite/Makefile.am
trunk/pos-installation/testsuite/tests/
trunk/pos-installation/testsuite/tests/.cvsignore
trunk/pos-installation/yast2-pos-installation.spec.in
Added: trunk/pos-installation/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/.cvsignore?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/.cvsignore (added)
+++ trunk/pos-installation/.cvsignore Wed Oct 10 14:08:04 2007
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+pos-installation.pot
+autom4te.cache
Added: trunk/pos-installation/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/MAINTAINER?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/MAINTAINER (added)
+++ trunk/pos-installation/MAINTAINER Wed Oct 10 14:08:04 2007
@@ -0,0 +1 @@
+Lukas Ocilka
Added: trunk/pos-installation/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/Makefile.cvs?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/Makefile.cvs (added)
+++ trunk/pos-installation/Makefile.cvs Wed Oct 10 14:08:04 2007
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: trunk/pos-installation/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/RPMNAME?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/RPMNAME (added)
+++ trunk/pos-installation/RPMNAME Wed Oct 10 14:08:04 2007
@@ -0,0 +1 @@
+yast2-pos-installation
Added: trunk/pos-installation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/VERSION?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/VERSION (added)
+++ trunk/pos-installation/VERSION Wed Oct 10 14:08:04 2007
@@ -0,0 +1 @@
+2.13.0
Added: trunk/pos-installation/agents/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/agents/.cvsignore?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/agents/.cvsignore (added)
+++ trunk/pos-installation/agents/.cvsignore Wed Oct 10 14:08:04 2007
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/pos-installation/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/agents/Makefile.am?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/agents/Makefile.am (added)
+++ trunk/pos-installation/agents/Makefile.am Wed Oct 10 14:08:04 2007
@@ -0,0 +1,7 @@
+# Makefile.am for pos-installation/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA =
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: trunk/pos-installation/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/configure.in.in?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/configure.in.in (added)
+++ trunk/pos-installation/configure.in.in Wed Oct 10 14:08:04 2007
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: trunk/pos-installation/control/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/control/Makefile.am?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/control/Makefile.am (added)
+++ trunk/pos-installation/control/Makefile.am Wed Oct 10 14:08:04 2007
@@ -0,0 +1,12 @@
+# Makefile.am for installation/general
+#
+SUBDIRS = docs tests
+
+controldir = $(yast2dir)/control
+
+control_DATA = slepos_migration.xml
+
+EXTRA_DIST = $(control_DATA) $(product_DATA)
+
+include $(top_srcdir)/Makefile.am.common
+
Added: trunk/pos-installation/control/README.txt
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/control/README.txt?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/control/README.txt (added)
+++ trunk/pos-installation/control/README.txt Wed Oct 10 14:08:04 2007
@@ -0,0 +1,8 @@
+Here you can find description of files:
+
+installation.xml
+ - Additional workflow modifications
+
+slepos_migration.xml
+ - Configuration for POS Migration Assisten (FATE #302870)
+
Added: trunk/pos-installation/control/installation.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/control/installation.xml?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/control/installation.xml (added)
+++ trunk/pos-installation/control/installation.xml Wed Oct 10 14:08:04 2007
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!DOCTYPE productDefines SYSTEM "/usr/share/YaST2/control/control.dtd">
+<productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
+ <textdomain>control-SLEPOS</textdomain>
+
+ <workflows config:type="list">
+
+ <workflow>
+ <defaults>
+ no
+ no
+ </defaults>
+
+ <stage>normal</stage>
+ <mode>installation,normal</mode>
+
+ <modules config:type="list">
+ <module>
+ <label>Server Type Selection</label>
+ <name>slepos_server_selection</name>
+ no
+ yes
+ </module>
+ <module>
+ <label>Install Software</label>
+ <name>inst_rpmcopy</name>
+ yes
+ yes
+ </module>
+ <module>
+ <label>Data Migration</label>
+ <name>slepos_data_migration</name>
+ yes
+ yes
+ </module>
+ </modules>
+ </workflow>
+ </workflows>
+
+ <update>
+ <workflows config:type="list">
+ <workflow>
+ <defaults>
+ yes
+ yes
+ </defaults>
+
+ <!-- Second Stage - Update -->
+ <stage>continue</stage>
+ <mode>update</mode>
+
+ <!-- Update: Insert -->
+
+
+ <before>congratulate</before>
+ <modules config:type="list">
+ <module>
+ <label>Data Migration</label>
+ <name>slepos_data_migration</name>
+ </module>
+ </modules>
+
+
+ </workflow>
+ </workflows>
+ </update>
+</productDefines>
Added: trunk/pos-installation/control/slepos_migration.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/control/slepos_migration.xml?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/control/slepos_migration.xml (added)
+++ trunk/pos-installation/control/slepos_migration.xml Wed Oct 10 14:08:04 2007
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+http://www.suse.com/1.0/yast2ns"
+ xmlns:config="http://www.suse.com/1.0/configns">
+ <config>
+ <!-- Default archive location -->
+ /var/adm/backup/SLEPOS_DATA/
+
+ <!-- Default archive name -->
+ SLEPOS_DATA_
+
+ <!-- Defines whether backup is selected by default -->
+ false
+
+ <!-- UI sleep in msecs -->
+ 50
+
+ <!-- Either 'copy' or 'move' -->
+ copy
+
+ <!-- Script running after the migration (optional) -->
+ /var/lib/YaST2/slepos_post.pl
+ </config>
+
+ <itemcopies config:type="list">
+
+ <itemcopy>
+ <type>directory</type>
+ <source>/yast/test/XML</source>
+ <destination>/srv/SLEPOS/1/</destination>
+ </itemcopy>
+
+ <itemcopy>
+ <type>directory</type>
+ <source>/yast/Botanicka</source>
+ <destination>/srv/SLEPOS/15/</destination>
+ </itemcopy>
+
+ <itemcopy>
+ <type>directory</type>
+ <source>/yast/CODE11/SL_11.0/zypp/</source>
+ <!-- Destination is always directory! -->
+ <destination>/srv/SLEPOS/2/</destination>
+ </itemcopy>
+
+ <itemcopy>
+ <type>file</type>
+ <source>/yast/CODE11/Alpha6Test.xml</source>
+ <!-- Destination is always directory! -->
+ <destination>/srv/SLEPOS/3</destination>
+ </itemcopy>
+
+ <itemcopy>
+ <type>file</type>
+ <source>/yast/docs/Behavioral_Indicators_Release_2.3</source>
+ <!-- Destination is always directory! -->
+ <destination>/srv/SLEPOS/4/</destination>
+ </itemcopy>
+
+ <itemcopy>
+ <type>directory</type>
+ <source>/tmp/some/missing/dir</source>
+ <destination>/srv/SLEPOS/5/</destination>
+ </itemcopy>
+
+ <!-- Erroneous -->
+ <itemcopy>
+ <type>directory</type>
+ <destination>/srv/SLEPOS/12/</destination>
+ </itemcopy>
+
+ <!-- Erroneous -->
+ <itemcopy>
+ <type>dyrectori</type>
+ <source>/tmp/</source>
+ <destination>/tmp/</destination>
+ </itemcopy>
+
+ </itemcopies>
+</migrate>
Added: trunk/pos-installation/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/doc/.cvsignore?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/doc/.cvsignore (added)
+++ trunk/pos-installation/doc/.cvsignore Wed Oct 10 14:08:04 2007
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/pos-installation/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/doc/Makefile.am?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/doc/Makefile.am (added)
+++ trunk/pos-installation/doc/Makefile.am Wed Oct 10 14:08:04 2007
@@ -0,0 +1,10 @@
+# Makefile.am for pos-installation/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/pos-installation/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/doc/autodocs/.cvsignore?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/doc/autodocs/.cvsignore (added)
+++ trunk/pos-installation/doc/autodocs/.cvsignore Wed Oct 10 14:08:04 2007
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/pos-installation/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/doc/autodocs/Makefile.am?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/doc/autodocs/Makefile.am (added)
+++ trunk/pos-installation/doc/autodocs/Makefile.am Wed Oct 10 14:08:04 2007
@@ -0,0 +1,3 @@
+# Makefile.am for pos-installation/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/pos-installation/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/package/.cvsignore?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/package/.cvsignore (added)
+++ trunk/pos-installation/package/.cvsignore Wed Oct 10 14:08:04 2007
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/pos-installation/package/yast2-pos-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/package/yast2-pos-installation.changes?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/package/yast2-pos-installation.changes (added)
+++ trunk/pos-installation/package/yast2-pos-installation.changes Wed Oct 10 14:08:04 2007
@@ -0,0 +1,7 @@
+-------------------------------------------------------------------
+Wed Oct 10 13:52:53 2007 - locilka@suse.cz
+
+- initial version
+ * POS Data Migration client
+ * POS Pattern Selector
+- 2.13.0
Added: trunk/pos-installation/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/src/.cvsignore?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/src/.cvsignore (added)
+++ trunk/pos-installation/src/.cvsignore Wed Oct 10 14:08:04 2007
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/pos-installation/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/src/Makefile.am?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/src/Makefile.am (added)
+++ trunk/pos-installation/src/Makefile.am Wed Oct 10 14:08:04 2007
@@ -0,0 +1,5 @@
+#
+# Makefile.am for installation/src
+#
+
+SUBDIRS = clients scripts
Added: trunk/pos-installation/src/clients/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/src/clients/Makefile.am?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/src/clients/Makefile.am (added)
+++ trunk/pos-installation/src/clients/Makefile.am Wed Oct 10 14:08:04 2007
@@ -0,0 +1,11 @@
+# Makefile.am for installation/general
+
+client_DATA = $(wildcard *.ycp)
+YCPCFLAGS = -M ../modules
+
+EXTRA_DIST = $(client_DATA)
+
+install-data-local:
+ -install -d -m 755 $(DESTDIR)/var/lib/YaST2
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/pos-installation/src/clients/slepos_data_migration.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/src/clients/slepos_data_migration.ycp?rev=41316&view=auto
==============================================================================
--- trunk/pos-installation/src/clients/slepos_data_migration.ycp (added)
+++ trunk/pos-installation/src/clients/slepos_data_migration.ycp Wed Oct 10 14:08:04 2007
@@ -0,0 +1,947 @@
+{
+ // Configuration
+ string migration_conf = "/etc/YaST2/slepos_migration.xml";
+
+ // Default values are defined in $migration_conf file
+ // Fallback values below
+ boolean default_do_backup = nil;
+ string default_backupdir = "";
+ string default_backupname = "";
+ integer migration_redraw_sleep = nil;
+ string migration_type = "";
+ string slepos_migration_post_script = "";
+
+ // FIXME
+ textdomain "SLEPOS";
+
+ import "FileUtils";
+ import "Wizard";
+ import "Mode";
+ import "Label";
+ import "Popup";
+ import "Sequencer";
+ import "String";
+ import "Report";
+
+ // Variables
+
+ list <map> copy_data_dirs = [];
+ list <map> copy_data_files = [];
+
+ string backup_archive = "";
+
+ // Functions
+
+ integer size_kB = 1024;
+ integer size_MB = 1024 * 1024;
+ integer size_GB = 1024 * 1024 * 1024;
+
+ string SizeInReadableFormat (integer size_in_b) {
+ integer current = (size_in_b / size_kB);
+
+ // more than a kB
+ if (current > size_kB) {
+ current = (size_in_b / size_MB);
+ // more than a MB
+ if (current > size_kB) {
+ return sformat ("%1 GB", (size_in_b / size_MB));
+ // less than a GB
+ } else {
+ return sformat ("%1 MB", current);
+ }
+ // less than a kB
+ } else {
+ return sformat ("%1 kB", current);
+ }
+ }
+
+ void ParseOneDirItem (map one_item) {
+ string source = one_item["source"]:"";
+ string destination = one_item["destination"]:"";
+
+ if (source == "") {
+ y2error (">source< not defined %1", one_item);
+ return;
+ }
+
+ if (destination == "") {
+ y2error (">destination< not defined %1", one_item);
+ return;
+ }
+
+ if (! regexpmatch (source, "/$")) {
+ source = source + "/";
+ }
+
+ if (! regexpmatch (destination, "/$")) {
+ destination = destination + "/";
+ }
+
+ if (! FileUtils::Exists (source)) {
+ y2warning ("Directory '%1' doesn't exist - it will not be migrated", source);
+ return;
+ }
+
+ copy_data_dirs = add (copy_data_dirs, $[
+ "source" : source,
+ "destination" : destination,
+ ]);
+ }
+
+ void ParseOneFileItem (map one_item) {
+ string source = one_item["source"]:"";
+ string destination = one_item["destination"]:"";
+
+ if (source == "") {
+ y2error (">source< not defined %1", one_item);
+ return;
+ }
+
+ if (destination == "") {
+ y2error (">destination< not defined %1", one_item);
+ return;
+ }
+
+ if (! regexpmatch (destination, "/$")) {
+ destination = destination + "/";
+ }
+
+ if (! FileUtils::Exists (source)) {
+ y2warning ("File '%1' doesn't exist - it will not be migrated", source);
+ return;
+ }
+
+ copy_data_files = add (copy_data_files, $[
+ "source" : source,
+ "destination" : destination,
+ ]);
+ }
+
+ boolean ReadParseAndCheckXMLConfig () {
+ if (! FileUtils::Exists (migration_conf)) {
+ y2error ("Can't read migration config file!");
+ return false;
+ }
+
+ y2milestone ("Reading %1", migration_conf);
+ map conf = (map ) SCR::Read (.xml, migration_conf);
+
+ if (migration_conf == nil) {
+ y2error ("Can't parse migration config file!");
+ return false;
+ }
+
+ foreach (map one_item, (list