Author: jkupec Date: Mon Apr 21 10:26:35 2008 New Revision: 9743 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9743&view=rev Log: - show upgrades/downgrades with changed arch in the install summary (bnc #381772) Modified: trunk/zypper/src/output/xmlout.rnc trunk/zypper/src/zypper-misc.cc Modified: trunk/zypper/src/output/xmlout.rnc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/xmlout.rnc?rev=... ============================================================================== --- trunk/zypper/src/output/xmlout.rnc (original) +++ trunk/zypper/src/output/xmlout.rnc Mon Apr 21 10:26:35 2008 @@ -128,6 +128,8 @@ element to-remove { solvable-element+ } | element to-upgrade { solvable-element+ } | element to-downgrade { solvable-element+ } | + element to-upgrade-change-arch { solvable-element+ } | + element to-downgrade-change-arch { solvable-element+ } | element to-reinstall { solvable-element+ } | element to-change-arch { solvable-element+ } )* Modified: trunk/zypper/src/zypper-misc.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=974... ============================================================================== --- trunk/zypper/src/zypper-misc.cc (original) +++ trunk/zypper/src/zypper-misc.cc Mon Apr 21 10:26:35 2008 @@ -842,7 +842,9 @@ typedef enum { TO_UPGRADE, + TO_UPGRADE_CHANGE_ARCH, TO_DOWNGRADE, + TO_DOWNGRADE_CHANGE_ARCH, TO_INSTALL, TO_REINSTALL, TO_REMOVE, @@ -859,6 +861,12 @@ case TO_DOWNGRADE: cout << "<" << (end ? "/" : "") << "to-downgrade>" << endl; break; + case TO_UPGRADE_CHANGE_ARCH: + cout << "<" << (end ? "/" : "") << "to-upgrade-change-arch>" << endl; + break; + case TO_DOWNGRADE_CHANGE_ARCH: + cout << "<" << (end ? "/" : "") << "to-downgrade-change-arch>" << endl; + break; case TO_INSTALL: cout << "<" << (end ? "/" : "") << "to-install>" << endl; break; @@ -945,6 +953,28 @@ "The following products are going to be upgraded:", it->second.size()); break; + case TO_UPGRADE_CHANGE_ARCH: + if (it->first == ResKind::package) + title = _PL( + "The following package is going to be upgraded and change architecture:", + "The following packages are going to be upgraded and change architecture:", + it->second.size()); + else if (it->first == ResKind::patch) + title = _PL( + "The following patch is going to be upgraded and change architecture:", + "The following patches are going to be upgraded and change architecture:", + it->second.size()); + else if (it->first == ResKind::pattern) + title = _PL( + "The following pattern is going to be upgraded and change architecture:", + "The following patterns are going to be upgraded and change architecture:", + it->second.size()); + else if (it->first == ResKind::product) + title = _PL( + "The following product is going to be upgraded and change architecture:", + "The following products are going to be upgraded and change architecture:", + it->second.size()); + break; case TO_DOWNGRADE: if (it->first == ResKind::package) title = _PL( @@ -967,6 +997,28 @@ "The following products are going to be downgraded:", it->second.size()); break; + case TO_DOWNGRADE_CHANGE_ARCH: + if (it->first == ResKind::package) + title = _PL( + "The following package is going to be downgraded and change architecture:", + "The following packages are going to be downgraded and change architecture:", + it->second.size()); + else if (it->first == ResKind::patch) + title = _PL( + "The following patch is going to be downgraded and change architecture:", + "The following patches are going to be downgraded and change architecture:", + it->second.size()); + else if (it->first == ResKind::pattern) + title = _PL( + "The following pattern is going to be downgraded and change architecture:", + "The following patterns are going to be downgraded and change architecture:", + it->second.size()); + else if (it->first == ResKind::product) + title = _PL( + "The following product is going to be downgraded and change architecture:", + "The following products are going to be downgraded and change architecture:", + it->second.size()); + break; case TO_INSTALL: if (it->first == ResKind::package) title = _PL( @@ -1131,6 +1183,8 @@ KindToResObjectSet toinstall; KindToResObjectSet toupgrade; KindToResObjectSet todowngrade; + KindToResObjectSet toupgrade_charch; + KindToResObjectSet todowngrade_charch; KindToResObjectSet toreinstall; KindToResObjectSet toremove; KindToResObjectSet tochangearch; @@ -1154,7 +1208,12 @@ if (res->name() == (*rmit)->name()) { if (res->edition() > (*rmit)->edition()) - toupgrade[res->kind()].insert(res); + { + if (res->arch() == (*rmit)->arch()) + toupgrade[res->kind()].insert(res); + else + toupgrade_charch[res->kind()].insert(res); + } else if (res->edition() == (*rmit)->edition()) { if (res->arch() == (*rmit)->arch()) @@ -1163,7 +1222,12 @@ tochangearch[res->kind()].insert(res); } else - todowngrade[res->kind()].insert(res); + { + if (res->arch() == (*rmit)->arch()) + todowngrade[res->kind()].insert(res); + else + todowngrade_charch[res->kind()].insert(res); + } new_installed_size += res->installsize() - (*rmit)->installsize(); @@ -1208,6 +1272,8 @@ // show summary show_summary_of_type(zypper, TO_UPGRADE, toupgrade); show_summary_of_type(zypper, TO_DOWNGRADE, todowngrade); + show_summary_of_type(zypper, TO_UPGRADE_CHANGE_ARCH, toupgrade_charch); + show_summary_of_type(zypper, TO_DOWNGRADE_CHANGE_ARCH, todowngrade_charch); show_summary_of_type(zypper, TO_INSTALL, toinstall); show_summary_of_type(zypper, TO_REINSTALL, toreinstall); show_summary_of_type(zypper, TO_REMOVE, toremove); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org