Hello community,

here is the log from the commit of package yast2-wagon for openSUSE:Factory
checked in at Tue Jul 12 14:03:25 CEST 2011.



--------
--- yast2-wagon/yast2-wagon.changes     2011-02-18 14:39:36.000000000 +0100
+++ yast2-wagon/yast2-wagon.changes     2011-07-01 12:54:00.000000000 +0200
@@ -1,0 +2,30 @@
+Fri Jul  1 08:52:27 UTC 2011 - lsle...@suse.cz
+
+- .spec file - fixed file list
+- 2.21.2
+
+-------------------------------------------------------------------
+Thu Jun 30 14:13:52 UTC 2011 - lsle...@suse.cz
+
+- fixed typos (bnc#702648), fixed help text for migration repo
+  selection dialog
+
+-------------------------------------------------------------------
+Wed Jun 22 14:40:00 UTC 2011 - lsle...@suse.cz
+
+- added a new client for selecting DUP repositories (fate#311994)
+- 2.21.1
+
+-------------------------------------------------------------------
+Thu Jun 16 14:41:31 UTC 2011 - lsle...@suse.cz
+
+- added a new client for checking registration status before
+  starting migration (fate#309594)
+
+-------------------------------------------------------------------
+Tue Jun 14 08:42:02 UTC 2011 - lsle...@suse.cz
+
+- implemented download in advance mode support (fate#308951)
+- 2.21.0
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  yast2-wagon-2.20.3.tar.bz2

New:
----
  yast2-wagon-2.21.2.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-wagon.spec ++++++
--- /var/tmp/diff_new_pack.6YnT4N/_old  2011-07-12 14:02:32.000000000 +0200
+++ /var/tmp/diff_new_pack.6YnT4N/_new  2011-07-12 14:02:32.000000000 +0200
@@ -19,24 +19,30 @@
 
 
 Name:           yast2-wagon
-Version:        2.20.3
+Version:        2.21.2
 Release:        1
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Source0:        yast2-wagon-2.20.3.tar.bz2
+Source0:        yast2-wagon-2.21.2.tar.bz2
 
 Prefix:         /usr
 
 Group:          System/YaST
-License:        GPLv2+
+License:        GPL v2 or later
 # PackagesUI::RunPackageSelector
 Requires:       yast2 >= 2.17.40
 Requires:       yast2-online-update-frontend >= 2.17.9
-# BNC #571621, Returns <upgrades> section from product file
-Requires:       yast2-pkg-bindings >= 2.19.1
+# Pkg::AddUpgradeRepo()
+Requires:       yast2-pkg-bindings >= 2.21.2
+# Pkg::AddUpgradeRepo()
+BuildRequires:  yast2-pkg-bindings >= 2.21.2
+
+BuildRequires:  perl-XML-Simple
+Requires:       perl-XML-Simple
 
 # Called in proposal and in code
-Requires:       yast2-packager yast2-add-on
+Requires:       yast2-packager >= 2.21.2
+Requires:       yast2-add-on
 
 # Counting packages directly in packages proposal (BNC #573482)
 Requires:       yast2-update >= 2.18.7
@@ -68,7 +74,7 @@
 through command line tools.
 
 %prep
-%setup -n yast2-wagon-2.20.3
+%setup -n yast2-wagon-2.21.2
 
 %build
 %{prefix}/bin/y2tool y2autoconf
@@ -106,10 +112,11 @@
 /usr/share/YaST2/clients/*.ycp
 /usr/share/YaST2/modules/*.ycp
 /usr/share/YaST2/modules/*.ybc
-%{prefix}/share/applications/YaST2/*.desktop
-%doc %{prefix}/share/doc/packages/yast2-wagon
+/usr/share/YaST2/modules/*.pm
 %dir /usr/share/YaST2/include/wagon
 /usr/share/YaST2/include/wagon/*.ycp
+%{prefix}/share/applications/YaST2/*.desktop
+%doc %{prefix}/share/doc/packages/yast2-wagon
 %exclude %{_datadir}/YaST2/control
 %exclude %{_datadir}/YaST2/control/*.xml
 
@@ -123,7 +130,7 @@
 Provides:       wagon-control-file
 
 Group:          System/YaST
-License:        GPLv2+
+License:        GPL v2 or later
 
 Conflicts:      otherproviders(wagon-control-file)
 Supplements:    packageand(yast2-wagon:branding-openSUSE)
@@ -152,7 +159,7 @@
 Provides:       wagon-control-file
 
 Group:          System/YaST
-License:        GPLv2+
+License:        GPL v2 or later
 
 # Prevent from crashes (BNC #551613)
 Requires:       yast2-registration >= 2.18.0

++++++ yast2-wagon-2.20.3.tar.bz2 -> yast2-wagon-2.21.2.tar.bz2 ++++++
++++ 5520 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/MAINTAINER new/yast2-wagon-2.21.2/MAINTAINER
--- old/yast2-wagon-2.20.3/MAINTAINER   2010-03-18 14:57:58.000000000 +0100
+++ new/yast2-wagon-2.21.2/MAINTAINER   2011-03-23 12:33:40.000000000 +0100
@@ -1 +1 @@
-Lukas Ocilka <loci...@suse.cz>
+Ladislav Slezak <lsle...@suse.cz>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/VERSION new/yast2-wagon-2.21.2/VERSION
--- old/yast2-wagon-2.20.3/VERSION      2011-02-18 14:37:28.000000000 +0100
+++ new/yast2-wagon-2.21.2/VERSION      2011-07-01 10:52:52.000000000 +0200
@@ -1 +1 @@
-2.20.3
+2.21.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/configure.in new/yast2-wagon-2.21.2/configure.in
--- old/yast2-wagon-2.20.3/configure.in 2011-02-18 16:26:58.000000000 +0100
+++ new/yast2-wagon-2.21.2/configure.in 2011-07-01 11:00:28.000000000 +0200
@@ -3,7 +3,7 @@
 dnl -- This file is generated by y2autoconf 2.18.11 - DO NOT EDIT! --
 dnl    (edit configure.in.in instead)
 
-AC_INIT(yast2-wagon, 2.20.3, http://bugs.opensuse.org/, yast2-wagon)
+AC_INIT(yast2-wagon, 2.21.2, http://bugs.opensuse.org/, yast2-wagon)
 dnl Check for presence of file 'RPMNAME'
 AC_CONFIG_SRCDIR([RPMNAME])
 
@@ -18,9 +18,9 @@
 AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
 
 dnl Important YaST2 variables
-VERSION="2.20.3"
+VERSION="2.21.2"
 RPMNAME="yast2-wagon"
-MAINTAINER="Lukas Ocilka <loci...@suse.cz>"
+MAINTAINER="Ladislav Slezak <lsle...@suse.cz>"
 
 dnl pkgconfig honors lib64
 pkgconfigdir=\${libdir}/pkgconfig
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/clients/wagon.ycp 
new/yast2-wagon-2.21.2/src/clients/wagon.ycp
--- old/yast2-wagon-2.20.3/src/clients/wagon.ycp        2011-02-18 
16:19:28.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/clients/wagon.ycp        2011-06-30 
16:22:47.000000000 +0200
@@ -12,7 +12,7 @@
  * Summary:
  *     Online Migration Tool
  *
- * $Id: wagon.ycp 63059 2011-01-03 14:54:37Z locilka $
+ * $Id: wagon.ycp 64676 2011-06-30 14:22:45Z lslezak $
  *
  */
 {
@@ -28,7 +28,6 @@
     import "PackageCallbacks";
     import "Report";
     import "FileUtils";
-    import "Popup";
 
     include "wagon/common_func.ycp";
 
@@ -279,7 +278,7 @@
        });
 
        if (size (removed_packages) > 0) {
-           y2milestone ("%1 products were removed, reseting packager", size 
(removed_packages));
+           y2milestone ("%1 products were removed, resetting packager", size 
(removed_packages));
            ResetPackager();
 
            foreach (string one_package, removed_packages, {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/clients/wagon_dup_repositories.ycp 
new/yast2-wagon-2.21.2/src/clients/wagon_dup_repositories.ycp
--- old/yast2-wagon-2.20.3/src/clients/wagon_dup_repositories.ycp       
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/clients/wagon_dup_repositories.ycp       
2011-06-30 16:03:48.000000000 +0200
@@ -0,0 +1,159 @@
+/**
+ * File:
+ *     clients/wagon_dup_repositories.ycp
+ *
+ * Module:
+ *     Wagon
+ *
+ * Authors:
+ *     Ladislav Slezak <lsle...@suse.cz>
+ *
+ * Summary:
+ *     Display dialog for selecting distribution upgrade repositories.
+ *
+ *
+ */
+
+{
+    textdomain "wagon";
+
+    import "Wagon";
+    import "GetInstArgs";
+    import "Wizard";
+    import "Popup";
+
+
+    define list TableContent()
+    {
+       // current enabled repositories
+       list<integer> repos = Pkg::SourceGetCurrent(true);
+       list<integer> dup_repos = Wagon::DupRepos();
+       list ret = [];
+
+       y2internal("Current repositories: %1", repos);
+       y2internal("DUP repositories: %1", dup_repos);
+
+       foreach(integer repo, repos,
+           {
+               map info = Pkg::SourceGeneralData(repo);
+               // if nothing selected yet propose all repositories
+               string selected = (dup_repos == [] || contains(dup_repos, 
repo)) ? UI::Glyph(`CheckMark) : "";
+
+               ret = add(ret, `item(`id(repo), selected, info["name"]:"", 
info["url"]:""));
+           });
+
+       y2internal("Table content: %1", ret);
+
+       return ret;
+    }
+
+    // display the repository selection dialog
+    define void SetContent()
+    {
+       // heading text
+       string heading_text = _("Migration Repositories");
+
+       term contents = `VBox(
+           `Left(`Label(_("The packages will be switched to versions in the 
selected repositories."))),
+           `Table(`id(`table), `opt(`notify, `immediate, `keepSorting), 
`header(`Center(_("Selected")), _("Name"), _("URL")), TableContent()),
+           `HBox(
+               `PushButton(`id(`select), _("Select")),
+               `PushButton(`id(`deselect), _("Deselect"))
+           )
+       );
+
+       // help text
+       string help_text = "<p>" + _("Here select the repositories which will 
be used for migration.")
+           + "</p><p>" + _("The installed packages will be switched to the 
versions available in the selected migration repositories.") + "</p>";
+
+       Wizard::SetContents (heading_text, contents, help_text,
+           GetInstArgs::enable_back(), GetInstArgs::enable_next());
+    }
+
+    // run the repository selection dialog
+    define symbol DupSelectionDialog()
+    {
+       SetContent();
+
+       symbol ret = nil;
+
+       while (true) {
+           map event = UI::WaitForEvent();
+           ret = event["ID"]:`nothing;
+
+           if (ret == `table && event["EventReason"]:"" == "Activated")
+           {
+               ret = `toggle;
+           }
+
+           if (ret == `back)
+           {
+               break;
+           }
+           else if (ret == `next)
+           {
+               y2milestone("Table content: %1", UI::QueryWidget(`id(`table), 
`Items));
+
+               list<term> table_lines = 
(list<term>)UI::QueryWidget(`id(`table), `Items);
+               list<integer> selected = [];
+
+               foreach(term table_line, table_lines,
+                   {
+                       if (table_line[1]:"" != "")
+                       {
+                           selected = add(selected, table_line[0,0]:-1);
+                       }
+                   });
+
+               if (size(selected) == 0)
+               {
+                   // error message, no migration repository selected in the 
table
+                   Popup::Error("Select at least one migration repository.");
+                   continue;
+               }
+
+               y2milestone("Selected repositories for distribution upgrade: 
%1", selected);
+
+               Wagon::SetDupRepos(selected);
+
+               break;
+           }
+           else if ((ret == `abort || ret == `cancel || ret == `close) && 
Popup::ConfirmAbort (`painless))
+           {
+               ret = `abort;
+               break;
+           }
+           else if (ret == `select || ret == `deselect || ret == `toggle)
+           {
+               integer current = (integer) UI::QueryWidget(`id(`table), 
`CurrentItem);
+               string selected = "";
+
+               if (ret == `toggle)
+               {
+                   // toggle the flag
+                   string current_value = (string)UI::QueryWidget(`id(`table), 
`Cell(current, 0));
+                   selected = (current_value == "") ? UI::Glyph(`CheckMark) : 
"";
+               }
+               else
+               {
+                   selected = (ret == `select) ? UI::Glyph(`CheckMark) : "";
+               }
+
+               UI::ChangeWidget(`id(`table), `Cell(current, 0), selected);
+           }
+           else
+           {
+               y2error("Unknown user input: %1", ret);
+           }
+       }
+
+       return ret;
+    }
+
+
+    symbol ret = DupSelectionDialog();
+
+    y2milestone ("Result: %1", ret);
+
+    return ret;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/clients/wagon_point_of_no_return.ycp 
new/yast2-wagon-2.21.2/src/clients/wagon_point_of_no_return.ycp
--- old/yast2-wagon-2.20.3/src/clients/wagon_point_of_no_return.ycp     
2010-03-18 14:57:59.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/clients/wagon_point_of_no_return.ycp     
2011-06-30 10:51:06.000000000 +0200
@@ -36,7 +36,7 @@
     Wagon::abort_can_revert_products = false;
 
     // @see BNC 575102
-    y2milestone ("Reseting repos_already_registered flag");
+    y2milestone ("Resetting repos_already_registered flag");
     Wagon::repos_already_registered = false;
 
     return `auto;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/clients/wagon_registration_check.ycp 
new/yast2-wagon-2.21.2/src/clients/wagon_registration_check.ycp
--- old/yast2-wagon-2.20.3/src/clients/wagon_registration_check.ycp     
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/clients/wagon_registration_check.ycp     
2011-06-30 10:52:38.000000000 +0200
@@ -0,0 +1,292 @@
+/**
+ * File:
+ *     clients/wagon_registration_check.ycp
+ *
+ * Module:
+ *     Wagon
+ *
+ * Authors:
+ *     Ladislav Slezak <lsle...@suse.cz>
+ *
+ * Summary:
+ *     Online Migration Tool
+ *
+ *
+ */
+
+{
+    textdomain "wagon";
+
+    import "GetInstArgs";
+    import "Wagon";
+    import "Wizard";
+    import "Popup";
+
+    // max age for the registration status (in days)
+    integer max_age_days = 90;
+    // max age for the registration status (in seconds)
+    integer max_age = max_age_days * 24 * 60 * 60;
+
+    // is the registration status file outdated?
+    define boolean OutdatedStatus(map<string,any> status)
+    {
+       // missing data, we cannot tell if it's outdated, suppose not
+       if (!haskey(status, "timestamp") || status["timestamp"]:0 <= 0)
+       {
+           return false;
+       }
+
+       boolean ret = status["timestamp"]:time() + max_age < time();
+       y2milestone("Registration status is outdated: %1", ret);
+
+       return ret;
+    }
+
+    // get deatils about an installed product
+    define map<string,any> InstalledProduct(string name)
+    {
+       list<map<string,any> > products = Pkg::ResolvableProperties(name, 
`product, "");
+       products = filter(map<string,any> prod, products, {
+           return prod["status"]:nil == `installed;
+       });
+
+       if (size(products) > 1)
+       {
+           y2warning("Found %1 products: %2", size(products), products);
+       }
+
+       return products[0]:$[];
+    }
+
+    // return list of installed but unregistered products
+    define list<map<string,any> > UnknownProducts(map<string,any> status)
+    {
+       list<string> known_products = (list<string>)(status["registered"]:[] + 
status["provisional"]:[]
+           + status["rma"]:[] + status["expired"]:[] + 
status["no_subscription"]:[] + status["failed"]:[]);
+
+       list<map<string,any> > unknown_products = Pkg::ResolvableProperties("", 
`product, "");
+       unknown_products = filter(map<string,any> prod, unknown_products, {
+           return prod["status"]:nil == `installed && 
!contains(known_products, prod["name"]:"");
+       });
+
+       y2milestone("Found unregistered installed products: %1", 
unknown_products);
+
+       return unknown_products;
+    }
+
+    // convert registration status map into a rich text summary
+    define string RegistrationSummary(map<string,any> status)
+    {
+       string msg = "<h3>" + _("Registration Summary") + "</h3>";
+
+       if (!status["registered_system"]:false)
+       {
+           msg = msg + "<p>" + _("The system is not registered") + "</p>";
+       }
+       else
+       {
+           msg = msg + "<ul>";
+
+           foreach(string prod, (list<string>)status["registered"]:[],
+               {
+                   msg = msg + "<li>" + sformat(_("Product <b>%1</b> has a 
valid registration"),
+                       InstalledProduct(prod)["display_name"]:prod) + "</li>";
+               }
+           );
+
+           foreach(string prod, (list<string>)status["no_subscription"]:[],
+               {
+                   msg = msg + "<li>" + sformat(_("Product <b>%1</b> does not 
need a subscription"),
+                   InstalledProduct(prod)["display_name"]:prod) + "</li>";
+               }
+           );
+
+           foreach(map<string,any> prod, UnknownProducts(status),
+               {
+                   msg = msg + "<li>"
+                       + sformat(_("Registration status of product <b>%1</b> 
is unknown"), prod["display_name"]:"")
+                       + "</li>";
+               }
+           );
+
+           foreach(string prod, (list<string>)status["failed"]:[],
+               {
+                   msg = msg + "<li><font color=\"red\">"
+                       + sformat(_("Product <b>%1</b> is not registered, 
registration failed"),
+                           InstalledProduct(prod)["display_name"]:prod)
+                       + "</font></li>";
+               }
+           );
+
+           foreach(string prod, (list<string>)status["rma"]:[],
+               {
+                   msg = msg + "<li><font color=\"red\">"
+                       + sformat(_("Registration for product <b>%1</b> has 
been refunded, the product is not registered"),
+                           InstalledProduct(prod)["display_name"]:prod)
+                       + "</font></li>";
+               }
+           );
+
+           foreach(string prod, (list<string>)status["expired"]:[],
+               {
+                   msg = msg + "<li><font color=\"red\">"
+                       + sformat(_("Registration for product <b>%1</b> has 
expired, the registration is not valid anymore"),
+                           InstalledProduct(prod)["display_name"]:prod)
+                       + "</font></li>";
+               }
+           );
+
+           foreach(string prod, (list<string>)status["provisional"]:[],
+               {
+                   msg = msg + "<li><font color=\"red\">"
+                       + sformat(_("Registration for product <b>%1</b> is 
provisional only, no updates available"),
+                           InstalledProduct(prod)["display_name"]:prod)
+                       + "</font></li>";
+               }
+           );
+
+           msg = msg + "</ul>";
+       }
+
+       msg = msg + "<br>";
+
+       if (OutdatedStatus(status))
+       {
+           integer days_outdated = (time() - status["timestamp"]:0) / 60 / 60 
/ 24;
+           msg = msg + "<p>" +
+               sformat(_("The registration status is %1 days old. The summary 
above might not be correct, run registration to update the status."), 
days_outdated)
+               + "</p>";
+       }
+
+       // display a critical warning
+       if (size(status["provisional"]:[]) > 0 || size(status["rma"]:[]) > 0
+           || size(status["expired"]:[]) > 0 || size(status["failed"]:[]) > 0
+           || size(UnknownProducts(status)) > 0 || 
!status["registered_system"]:false)
+       {
+           msg = msg + "<p><b>" + _("Warning:") + " </b>"
+               + _("It is strongly recommended to register the unregistered or 
expired products before starting migration.")
+               + "<br>" + _("Migrating unregistered or partly registered 
system might result in broken system.")
+               + "</p>";
+       }
+
+       y2milestone("Registration summary: %1", msg);
+
+       return msg;
+    }
+
+    // set registration summary dialog content
+    define void SetContent(map<string,any> status)
+    {
+       // heading text
+       string heading_text = _("Registration Check");
+
+       term contents = `VBox(
+           `RichText(RegistrationSummary(status)),
+           `PushButton(`id(`registration), _("Run Registration..."))
+       );
+
+       // help text
+       string help_text = "<p>" + _("YaST checks whether the installed 
products are registered.")
+           + "</p><p>" + _("Migrating unregistered or partly registered system 
might result in broken system.") + "</p>";
+
+       Wizard::SetContents (heading_text, contents, help_text,
+           GetInstArgs::enable_back(), GetInstArgs::enable_next());
+
+       Wizard::EnableAbortButton();
+    }
+
+    // run registration summary dialog
+    define symbol RegistrationSummaryDialog(map<string,any> status)
+    {
+       SetContent(status);
+
+       symbol ret = nil;
+
+       while (true) {
+           ret = (symbol)UI::UserInput();
+
+           if (ret == `back || ret == `next)
+           {
+               break;
+           }
+           else if ((ret == `abort || ret == `cancel || ret == `close) && 
Popup::ConfirmAbort (`painless))
+           {
+               ret = `abort;
+               break;
+           }
+           else if (ret == `registration)
+           {
+               // start registration
+               WFM::CallFunction("inst_suse_register");
+
+               // refresh the registration status
+               map<string,any> new_status = Wagon::RegistrationStatus();
+               SetContent(new_status);
+           }
+       }
+
+       return ret;
+    }
+
+    // check whether the parsed registration status contains unregistered or
+    // some other problem and user has to be informed about it
+    define boolean Interactive(map<string,any> status)
+    {
+       // the system is not registered at all
+       if (status["registered_system"]:false)
+       {
+           y2milestone("Registration status is missing, interaction needed");
+           return true;
+       }
+
+       // the registration status is too old
+       if (OutdatedStatus(status))
+       {
+           y2milestone("Registration status is too old, interaction needed");
+           return true;
+       }
+
+       // a product in unregistered state
+       if (size(status["provisional"]:[]) > 0 || size(status["rma"]:[]) > 0
+           || size(status["expired"]:[]) > 0 || size(status["failed"]:[]) > 0)
+       {
+           y2milestone("Unregistered product found, interaction needed");
+           return true;
+       }
+
+       // an unknown product
+       if (size(UnknownProducts(status)) > 0)
+       {
+           y2milestone("Unknown product found, interaction needed");
+           return true;
+       }
+
+       y2milestone("Registration OK, skipping registration dialog");
+       return false;
+    }
+
+    Wagon::InitPkg();
+    // read the registration XML file
+    map<string,any> reg_status = Wagon::RegistrationStatus();
+
+    y2milestone("Read registration status: %1", reg_status);
+
+    // if no user interation needed then go on
+    if (!Interactive(reg_status))
+    {
+       if (GetInstArgs::going_back()) {
+           y2milestone ("Going back...");
+           return `back;
+       }
+       else
+       {
+           return `next;
+       }
+    }
+
+    symbol ret = RegistrationSummaryDialog(reg_status);
+
+    y2milestone ("Result: %1", ret);
+
+    return ret;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/clients/wagon_repositories_handler.ycp 
new/yast2-wagon-2.21.2/src/clients/wagon_repositories_handler.ycp
--- old/yast2-wagon-2.20.3/src/clients/wagon_repositories_handler.ycp   
2010-03-18 14:57:59.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/clients/wagon_repositories_handler.ycp   
2011-06-22 13:18:12.000000000 +0200
@@ -41,7 +41,7 @@
 //     Mode::SetMode ("normal");
        y2milestone ("Running repositories...");
        ret = (symbol) WFM::call ("repositories");
-       y2milestone ("Script inst_suse_register returned: %1", ret);
+       y2milestone ("Script repositories returned: %1", ret);
 //     Mode::SetMode ("update");
 
        if (ret == `cancel || ret == `abort) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/clients/wagon_update_proposal.ycp 
new/yast2-wagon-2.21.2/src/clients/wagon_update_proposal.ycp
--- old/yast2-wagon-2.20.3/src/clients/wagon_update_proposal.ycp        
2010-03-18 14:57:59.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/clients/wagon_update_proposal.ycp        
2011-06-14 14:00:23.000000000 +0200
@@ -11,7 +11,7 @@
  * Summary:
  *     Online Migration Tool
  *
- * $Id: wagon_update_proposal.ycp 61316 2010-03-12 16:42:32Z locilka $
+ * $Id: wagon_update_proposal.ycp 64343 2011-06-14 12:00:22Z lslezak $
  *
  */
 
@@ -20,6 +20,7 @@
 
     import "Wagon";
     import "Report";
+    import "PackageInstallation";
 
     string func = (string) WFM::Args(0);
     map param = (map) WFM::Args(1);
@@ -40,11 +41,23 @@
        }
 
        Wagon::ProposeDUP();
+       Wagon::ProposeDownloadMode();
 
        ret = Wagon::ProposalSummary();
 
     } else if (func == "AskUser") {
-       Report::Message (_("There is nothing to set."));
+       string chosen_id = param["chosen_id"]:"";
+
+       // toggle the download mode status
+       if (chosen_id == Wagon::GetDownloadModeLink())
+       {
+           
PackageInstallation::SetDownloadInAdvance(!PackageInstallation::DownloadInAdvance());
+       }
+       else
+       {
+           Report::Message (_("There is nothing to set."));
+       }
+
        ret = $[ "workflow_sequence" : `next ];
 
     } else if (func == "Description") {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/config/online_migration-SLE.xml 
new/yast2-wagon-2.21.2/src/config/online_migration-SLE.xml
--- old/yast2-wagon-2.20.3/src/config/online_migration-SLE.xml  2011-02-18 
13:30:13.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/config/online_migration-SLE.xml  2011-06-22 
15:06:49.000000000 +0200
@@ -28,10 +28,13 @@
                <name>running_by_applet</name>
                <modules config:type="list">
                    <module>welcome</module>
+                   <module>registration_check</module>
                    <module>update_online_mechanism</module>
                    <module>install_migration_products</module>
                    <module>suse_register_workflow</module>
+                   <module>wagon_dup_repositories</module>
                    <module>wagon_modify_repositories</module>
+
                    <module>prepare_progress</module>
                    <module>point_of_no_return</module>
                    <module>wagon_kickoff</module>
@@ -55,14 +58,17 @@
                <name>manual</name>
                <modules config:type="list">
                    <module>welcome</module>
+                   <module>registration_check</module>
                    <module>update_online_mechanism</module>
                    <module>install_migration_products</module>
                    <!-- Workflow is tuned after this module -->
                    <module>update_url_dialog</module>
                    <module>suse_register_workflow</module>
                    <module>wagon_manual_url_repositories</module>
+                   <module>wagon_dup_repositories</module>
                    <module>wagon_modify_repositories</module>
                    <module>wagon_check_repositories</module>
+
                    <module>prepare_progress</module>
                    <module>point_of_no_return</module>
                    <module>wagon_kickoff</module>
@@ -84,8 +90,11 @@
                <name>PatchCD</name>
                <modules config:type="list">
                    <module>welcome</module>
+                   <module>registration_check</module>
                    <module>wagon_custom_url</module>
                    <module>wagon_selfupdate_from_url</module>
+                   <module>wagon_dup_repositories</module>
+
                    <module>prepare_progress</module>
                    <module>point_of_no_return</module>
                    <module>wagon_kickoff</module>
@@ -163,6 +172,12 @@
                    <enable_back>no</enable_back>
                </module>
 
+               <module>
+                   <label>Registration Check</label>
+                   <name>registration_check</name>
+                   <execute>wagon_registration_check</execute>
+               </module>
+
                <!-- Update itself -->
                <module>
                    <label>Renew Update Stack</label>
@@ -245,6 +260,12 @@
                </module>
 
                <module>
+                   <label>Migration Configuration</label>
+                   <name>wagon_dup_repositories</name>
+                   <execute>wagon_dup_repositories</execute>
+               </module>
+
+               <module>
                    <heading>yes</heading>
                    <label>Migration</label>
                </module>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/config/online_migration-openSUSE.xml 
new/yast2-wagon-2.21.2/src/config/online_migration-openSUSE.xml
--- old/yast2-wagon-2.20.3/src/config/online_migration-openSUSE.xml     
2011-02-18 13:39:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/config/online_migration-openSUSE.xml     
2011-06-22 14:57:30.000000000 +0200
@@ -30,6 +30,7 @@
                    <module>welcome</module>
                    <module>update_online_mechanism</module>
                    <module>install_migration_products</module>
+                   <module>wagon_dup_repositories</module>
                    <module>wagon_modify_repositories</module>
                    <module>prepare_progress</module>
                    <module>point_of_no_return</module>
@@ -50,6 +51,7 @@
                    <module>update_online_mechanism</module>
                    <module>install_migration_products</module>
                    <module>wagon_manual_url_repositories</module>
+                   <module>wagon_dup_repositories</module>
                    <module>wagon_modify_repositories</module>
                    <module>wagon_check_repositories</module>
                    <module>prepare_progress</module>
@@ -73,6 +75,7 @@
                    <module>welcome</module>
                    <module>wagon_custom_url</module>
                    <module>wagon_selfupdate_from_url</module>
+                   <module>wagon_dup_repositories</module>
                    <module>prepare_progress</module>
                    <module>point_of_no_return</module>
                    <module>wagon_kickoff</module>
@@ -148,6 +151,12 @@
                    <enable_back>no</enable_back>
                </module>
 
+               <module>
+                   <label>Registration Check</label>
+                   <name>registration_check</name>
+                   <execute>wagon_registration_check</execute>
+               </module>
+
                <!-- Update itself -->
                <module>
                    <label>Renew Update Stack</label>
@@ -203,6 +212,12 @@
                </module>
 
                <module>
+                   <label>Migration Configuration</label>
+                   <name>wagon_dup_repositories</name>
+                   <execute>wagon_dup_repositories</execute>
+               </module>
+
+               <module>
                    <heading>yes</heading>
                    <label>Migration</label>
                </module>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/include/common_func.ycp 
new/yast2-wagon-2.21.2/src/include/common_func.ycp
--- old/yast2-wagon-2.20.3/src/include/common_func.ycp  2010-03-18 
14:57:59.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/include/common_func.ycp  2011-06-30 
10:50:59.000000000 +0200
@@ -119,13 +119,13 @@
 
     void ResetPackager () {
        Wizard::SetContents (
-           _("Reseting Package Manager"),
-           `Label(_("Reseting package manager...")),
+           _("Resetting Package Manager"),
+           `Label(_("Resetting package manager...")),
            "",
            false, true
        );
 
-       y2milestone ("Reseting Pkg");
+       y2milestone ("Resetting Pkg");
        Pkg::PkgApplReset();
        Pkg::PkgReset();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/include/wagon_helpers.ycp 
new/yast2-wagon-2.21.2/src/include/wagon_helpers.ycp
--- old/yast2-wagon-2.20.3/src/include/wagon_helpers.ycp        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/include/wagon_helpers.ycp        2011-06-20 
14:56:40.000000000 +0200
@@ -0,0 +1,61 @@
+/**
+ *
+ * Copyright (c) 2011 Novell, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail,
+ * you may find current contact information at www.novell.com
+ *
+ * File:
+ *     include/wagon/wagon_helpers.ycp
+ *
+ * Module:
+ *     Wagon
+ *
+ * Authors:
+ *     Ladislav Slezak <lsle...@suse.cz>
+ *
+ * Summary:
+ *     Online Migration Tool
+ *
+ * $Id$
+ *
+ */
+{
+    /*
+    * Find a mount point for given directory/file path. Returns "/" if no 
mount point matches
+    * @param dir requested path
+    * @param dirs list of mount points
+    * @return string a mount point from the input list or "/" if not found
+    */
+    string FindMountPoint(string dir, list<string> dirs)
+    {
+       while (dir != nil && dir != "" && !contains(dirs, dir))
+       {
+           // strip the last path component and try it again
+           list<string> comps = splitstring(dir, "/");
+           comps = remove(comps, size(comps) - 1);
+           dir = mergestring(comps, "/");
+       }
+
+       if (dir == nil || dir == "")
+       {
+           dir = "/";
+       }
+
+       return dir;
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/modules/Makefile.am 
new/yast2-wagon-2.21.2/src/modules/Makefile.am
--- old/yast2-wagon-2.20.3/src/modules/Makefile.am      2010-03-18 
14:57:59.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/modules/Makefile.am      2011-06-20 
14:56:43.000000000 +0200
@@ -2,8 +2,16 @@
 # Makefile.am for wagon/src/modules
 #
 
-module_DATA = $(wildcard *.ycp)
+module_DATA = Wagon.ycp RegistrationStatus.pm
 
 EXTRA_DIST = $(module_DATA)
 
+YCPCFLAGS = -I .
+
+ycpchook = wagon
+
+wagon:
+       ln -s ../include wagon
+
+
 include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/modules/RegistrationStatus.pm 
new/yast2-wagon-2.21.2/src/modules/RegistrationStatus.pm
--- old/yast2-wagon-2.20.3/src/modules/RegistrationStatus.pm    1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/modules/RegistrationStatus.pm    2011-06-20 
14:56:54.000000000 +0200
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2011 Novell, Inc.
+# 
+# All Rights Reserved.
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+# 
+# 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, contact Novell, Inc.
+# 
+# To contact Novell about this file by physical or electronic mail,
+# you may find current contact information at www.novell.com
+#
+
+package RegistrationStatus;
+
+use strict;
+use Data::Dumper;
+use XML::Simple;
+
+use YaST::YCP qw(:DATA :LOGGING);
+
+our %TYPEINFO;
+
+# see 
https://wiki.innerweb.novell.com/index.php/Registration#Add_Registration_Status_to_zmdconfig
+# for more datils about the file format
+my $reg_file = "/var/lib/suseRegister/registration-status.xml";
+
+# return the default registration status file name
+BEGIN{ $TYPEINFO{RegFile} = ["function", "string"]; }
+sub RegFile {
+    my ($self) = @_;
+    return $reg_file;
+}
+
+# parse the default registration XML status file
+BEGIN{ $TYPEINFO{Read} = ["function", ["map","any","any"]]; }
+sub Read {
+    my ($self) = @_;
+    return ReadFile($reg_file);
+}
+
+# parse the requested registration XML status file, convert the XML file into 
a map
+BEGIN{ $TYPEINFO{ReadFile} = ["function", ["map","any","any"], "string"]; }
+sub ReadFile {
+    my $self = shift;
+    my $file = shift;
+
+    # create XML parser
+    my $parser = new XML::Simple;
+
+    # parse the file
+    my $data = $parser->XMLin($file);
+
+    my $dump = Dumper($data);
+    y2milestone("Parsed file $file: $dump");
+
+    return $data;
+}
+
+1
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/src/modules/Wagon.ycp 
new/yast2-wagon-2.21.2/src/modules/Wagon.ycp
--- old/yast2-wagon-2.20.3/src/modules/Wagon.ycp        2010-03-18 
14:57:59.000000000 +0100
+++ new/yast2-wagon-2.21.2/src/modules/Wagon.ycp        2011-06-24 
15:06:41.000000000 +0200
@@ -5,7 +5,7 @@
  * Authors:    Lukas Ocilka <loci...@suse.cz>
  * Internal
  *
- * $Id: Wagon.ycp 61324 2010-03-15 16:17:02Z locilka $
+ * $Id: Wagon.ycp 64589 2011-06-24 13:06:40Z lslezak $
  *
  * Module for handling WAGON.
  *
@@ -31,6 +31,11 @@
     import "Update";
     import "FileUtils";
     import "String";
+    import "Packages";
+    import "PackageInstallation";
+    import "RegistrationStatus";
+
+    include "wagon/wagon_helpers.ycp";
 
     boolean running_by_applet = false;
 
@@ -75,6 +80,13 @@
        return update_workflow_type;
     }
 
+    const string download_mode_link = "wagon-download_in_advance";
+
+    global define string GetDownloadModeLink()
+    {
+       return download_mode_link;
+    }
+
     string migration_method = nil;
 
     global string migration_method_file = sformat 
("%1/wagon_migration_method", Directory::vardir);
@@ -98,6 +110,20 @@
        return migration_method;
     }
 
+    // do the distribution upgrade from selected repositories
+    list<integer> dup_repos = [];
+
+    global list<integer> DupRepos()
+    {
+       return dup_repos;
+    }
+
+    global void SetDupRepos(list<integer> repos)
+    {
+       dup_repos = repos;
+    }
+
+
     void ResetWorkflowSteps () {
        ProductControl::UnDisableAllModulesAndProposals (Mode::mode(), 
Stage::stage());
     }
@@ -369,16 +395,100 @@
            return true;
        }
 
-       map <string, any> update_conf = GetUpdateConf();
+       // reset upgrade repo config
+       y2milestone("Resetting upgrade repos config");
+       list<integer> repos = Pkg::GetUpgradeRepos();
+       foreach(integer repo, repos, {Pkg::RemoveUpgradeRepo(repo);});
+
+       // all repositories selected for upgrade?
+       if (sort(Pkg::SourceGetCurrent(true)) == sort(dup_repos))
+       {
+           // reset solver flags (needed when switching from full DUP to 
partial DUP
+           Pkg::SetSolverFlags($["reset" : true]);
+
+           // do full distribution upgrade
+           map <string, any> update_conf = GetUpdateConf();
+           map <symbol, integer> update_sum = Pkg::PkgUpdateAll (update_conf);
+           y2milestone ("Update configuration: %1, update summary: %2", 
update_conf, update_sum);
+       }
+       else
+       {
+           // do partial DUP
+           // add upgrade repositories
+           y2milestone("Adding upgrade repos: %1", dup_repos);
+           foreach(integer repo, dup_repos, {Pkg::AddUpgradeRepo(repo);});
+
+           // be compatible with "zypper dup --from"
+           Pkg::SetSolverFlags($["ignoreAlreadyRecommended" : true]);
+       }
 
-       map <symbol, integer> update_sum = Pkg::PkgUpdateAll (update_conf);
-       y2milestone ("Update configuration: %1, update summary: %2", 
update_conf, update_sum);
+       Pkg::PkgSolve(true);
 
        already_proposed = true;
 
        return true;
     }
 
+    map<string, any> CheckDownloadSpace()
+    {
+       // display a warning if estimated free size after migration is below 
100MB
+       integer min_free_space = 100 << 20;
+
+       map<string, list> du = Pkg::TargetGetDU();
+       list<string> mounts = maplist(string dir, list info, du, {return dir;});
+
+       map<string,any> zconfig = Pkg::ZConfig();
+       string pkg_path = zconfig["repo_packages_path"]:"";
+
+       string packages_mount = FindMountPoint(pkg_path, mounts);
+       y2milestone("Packages will we downloaded to %1 (mountpoint %2)", 
pkg_path, packages_mount);
+
+       // download size in bytes
+       integer download_size = Packages::CountSizeToBeDownloaded();
+       y2milestone("Size of packages to download: %1MB", download_size >> 20);
+
+       // du contains maps: $[ "dir" : [ total, used, pkgusage, readonly ], 
.... ]
+       integer after_install = du[packages_mount, 2]:0;
+       integer total = du[packages_mount, 0]:0;
+       y2milestone("Size after installation: %1MB (of %2MB)", after_install >> 
20, total >> 20);
+
+       symbol result = `ok;
+       string message = "";
+
+       if (after_install + download_size < total)
+       {
+           result = `error;
+           message = sformat(_("There is not enough free space to migrate the 
system using download in advance mode. Partition %1 needs at least %2MB more 
free disk space. (The needed size is estimated, it is recommended to add 
slightly more free space.) Add more disk space or disable download in advance 
mode."),
+                packages_mount, (after_install + download_size - total) >> 20);
+           y2error("Not enough free space for download in advance upgrade: "
+               + "estimated size after installation: %1MB, download size: 
%2MB, "
+               + "total size: %3MB, estimated free space: %4MB", after_install 
>> 20,
+               download_size >> 20, total >> 20, (total - after_install - 
download_size) >> 20);
+       }
+       else if (after_install + download_size + min_free_space < total)
+       {
+           result = `warning;
+           message = sformat(_("There might not be enough free space for 
download in advance mode migration. The estimated free space after migration is 
%2MB, it is recommended to increase the free space in case the estimation is 
inaccurate to avoid installation errors."),
+               (total - after_install - download_size) >> 20);
+           y2warning("Low free space: estimated size after installation: %1MB, 
"
+               + "download size: %2MB, total size: %3MB, estimated free space: 
%4MB",
+               after_install >> 20, download_size >> 20, total >> 20, (total - 
after_install - download_size) >> 20);
+       }
+
+       return $[ "result" : result, "message" : message ];
+    }
+
+    global void ProposeDownloadMode()
+    {
+       if (PackageInstallation::DownloadInAdvance() == nil)
+       {
+           map<string, any> dwspace = CheckDownloadSpace();
+
+           PackageInstallation::SetDownloadInAdvance(dwspace["result"]:nil == 
`ok);
+           y2milestone("Proposed download in advance mode: %1", 
PackageInstallation::DownloadInAdvance());
+       }
+    }
+
     global map <string,any> MinimizeProductMap (map <string,any> product) {
        if (haskey (product, "license")) product["license"] = "...";
        if (haskey (product, "description")) product["description"] = "...";
@@ -510,10 +620,15 @@
 
        ret = "<ul>\n" + ret + "</ul>\n";
 
+       ret = ret + "<ul><li>\n" + _("Download all packages before upgrade: ") +
+           sformat("<a href=\"%1\">%2</a>", download_mode_link, 
(PackageInstallation::DownloadInAdvance() ? _("Enabled") : _("Disabled")))
+            + "</li></ul>\n";
+
        map <string, any> summary = $[
            "preformatted_proposal" : ret,
+           "links" : [ download_mode_link ],
            // help text
-           "help" : _("<p>To change the update settings, go to <p>Packages 
Proposal</p> section.</p>"),
+           "help" : _("<p>To change the update settings, go to <b>Packages 
Proposal</b> section.</p>"),
        ];
 
        // Product removal MUST be confirmed by user, otherwise migration will 
not continue.
@@ -630,5 +745,131 @@
 
        return true;
     }
+
+    /*
+    * Read registration status and sort products according their status
+    * @param file Read this registration status file
+    * @return map<string,any> result: $[
+    *
+           "registered_system" : (boolean) - true registration was run, false 
registration has never run or there is no product to register (e.g. openSUSE 
installation) or the registration completely failed
+           "timestamp"         : (integer) - time when the status was saved 
(unix time), -1 in an unregistered system
+           "registered"        : (list<string>) - registered products
+           "provisional"       : (list<string>) - products with provisional 
subscription (registered, but no updates available)
+           "rma"               : (list<string>) - refunded subscriptions, not 
active anymore
+           "expired"           : (list<string>) - expired subscriptions
+           "no_subscription"   : (list<string>) - products which do not need a 
subscription (e.g. SLES-SDK)
+           "failed"            : (list<string>) - registration failed (e.g. 
invalid registration code)
+    * ]
+    */
+    global define map<string,any> RegistrationStatusFromFile(string file)
+    {
+       boolean registered_system = true;
+       integer timestamp = -1;
+
+       list<string> failed = [];
+       list<string> no_subscription = [];
+       list<string> expired = [];
+       list<string> rma = [];
+       list<string> provisional = [];
+       list<string> registered = [];
+
+       // 0 = empty file, -1 = missing
+       if (FileUtils::GetSize(file) <= 0)
+       {
+           y2milestone("File %1 does not exist", file);
+           registered_system = false;
+       }
+       else
+       {
+           // read the registration status
+           // see 
https://wiki.innerweb.novell.com/index.php/Registration#Add_Registration_Status_to_zmdconfig
+           // for more datils about the file format
+           map status = RegistrationStatus::ReadFile(file);
+
+           timestamp = tointeger(status["generated"]:"-1");
+           list<map> products = status["productstatus"]:[];
+
+           // check each product
+           foreach(map product, products,
+               {
+                   string product_name = product["product"]:"";
+
+                   // not registered (error present, but not "expired")
+                   if (product["result"]:"" == "error" && 
product["errorcode"]:"" != "ERR_SUB_EXP")
+                   {
+                       failed = add(failed, product_name);
+                   }
+                   else
+                   {
+                       // registered, but subscription is not needed (e.g. 
SLES-SDK)
+                       if (product["subscription"]:$[] == $[])
+                       {
+                           no_subscription = add(no_subscription, 
product_name);
+                       }
+                       else
+                       {
+                           string status = product["subscription", 
"status"]:"";
+                           string expiration = product["subscription", 
"expiration"]:"";
+
+                           // expired subscription (status == EXPIRED or the 
timestamp is in the past)
+                           if (status == "EXPIRED" || (expiration != "" && 
tointeger(expiration) < time()))
+                           {
+                               expired = add(expired, product_name);
+                           }
+                           else if (status == "RMA")
+                           {
+                               rma = add(rma, product_name);
+                           }
+                           else
+                           {
+                               string type = product["subscription", 
"type"]:"";
+
+                               // provisional subscription
+                               if (type == "PROVISIONAL")
+                               {
+                                   provisional = add(provisional, 
product_name);
+                               }
+                               else
+                               {
+                                   registered = add(registered, product_name);
+                               }
+                           }
+                       }
+                   }
+               }
+           );
+       }
+
+       return $[
+           "registered_system" : registered_system,
+           "timestamp"         : timestamp,
+           "registered"        : registered,
+           "provisional"       : provisional,
+           "rma"               : rma,
+           "expired"           : expired,
+           "no_subscription"   : no_subscription,
+           "failed"            : failed
+       ];
+
+    }
+
+    /*
+    * Read registration status from 
/var/lib/suseRegister/registration-status.xml and sort products according their 
status
+    * @return map<string,any> result: $[
+    *
+           "registered_system" : (boolean) - true registration was run, false 
registration has never run or there is no product to register (e.g. openSUSE 
installation) or the registration completely failed
+           "timestamp"         : (integer) - time when the status was saved 
(unix time), -1 in an unregistered system
+           "registered"        : (list<string>) - registered products
+           "provisional"       : (list<string>) - products with provisional 
subscription (registered, but no updates available)
+           "rma"               : (list<string>) - refunded subscriptions, not 
active anymore
+           "expired"           : (list<string>) - expired subscriptions
+           "no_subscription"   : (list<string>) - products which do not need a 
subscription (e.g. SLES-SDK)
+           "failed"            : (list<string>) - registration failed (e.g. 
invalid registration code)
+    * ]
+    */
+    global define map<string,any> RegistrationStatus()
+    {
+       return RegistrationStatusFromFile(RegistrationStatus::RegFile());
+    }
 /* EOF */
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/testsuite/tests/FindMountPoint.out 
new/yast2-wagon-2.21.2/testsuite/tests/FindMountPoint.out
--- old/yast2-wagon-2.20.3/testsuite/tests/FindMountPoint.out   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/testsuite/tests/FindMountPoint.out   2011-06-20 
14:56:54.000000000 +0200
@@ -0,0 +1,14 @@
+Dump   Test nil
+Return /
+Return /
+Return /
+Dump   Test empty string
+Return /
+Return /
+Return /
+Dump   Test valid values
+Return /
+Return /usr
+Return /usr
+Return /usr
+Return /usr/share
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/yast2-wagon-2.20.3/testsuite/tests/FindMountPoint.ycp 
new/yast2-wagon-2.21.2/testsuite/tests/FindMountPoint.ycp
--- old/yast2-wagon-2.20.3/testsuite/tests/FindMountPoint.ycp   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-wagon-2.21.2/testsuite/tests/FindMountPoint.ycp   2011-06-20 
14:56:54.000000000 +0200
@@ -0,0 +1,24 @@
+{
+
+include "testsuite.ycp";
+
+include "wagon/wagon_helpers.ycp";
+
+//import "Wagon";
+DUMP("Test nil");
+TEST(``(FindMountPoint(nil, nil)), [], nil);
+TEST(``(FindMountPoint(nil, [])), [], nil);
+TEST(``(FindMountPoint(nil, ["/boot", "/"])), [], nil);
+
+DUMP("Test empty string");
+TEST(``(FindMountPoint("", nil)), [], nil);
+TEST(``(FindMountPoint("", [])), [], nil);
+TEST(``(FindMountPoint("", ["/boot", "/"])), [], nil);
+
+DUMP("Test valid values");
+TEST(``(FindMountPoint("/", ["/boot", "/", "/usr"])), [], nil);
+TEST(``(FindMountPoint("/usr", ["/boot", "/", "/usr"])), [], nil);
+TEST(``(FindMountPoint("/usr/", ["/boot", "/", "/usr"])), [], nil);
+TEST(``(FindMountPoint("/usr/share/locale", ["/boot", "/", "/usr"])), [], nil);
+TEST(``(FindMountPoint("/usr/share/locale", ["/boot", "/", "/usr", 
"/usr/share"])), [], nil);
+}


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to