message-element =
element message {
- attribute type { "info" | "warning" | "error" }, # considering yet another type "result", maybe a separate <result> element
+ attribute type { "info" | "warning" | "error" }, # considering yet another type "result", maybe a separate <result> element
text
}
update-commons =
attribute name { xsd:string },
attribute edition { xsd:string },
+ attribute arch { xsd:string },
element summary { text },
element description { text },
element license { text },
element update {
update-commons,
attribute kind { "patch" },
+ attribute status { "needed" | "unwanted" | "applied" | "not-needed" | "undetermined" }?, #
attribute category { xsd:string }?, # patch category (security, recommended, ...)
attribute pkgmanager { xsd:boolean }, # affect package management?
attribute restart { xsd:boolean }, # needs restart of the machine?
common-selectable-info &
(
package-selectable-info |
- patch-selectable-info
+ patch-selectable-info
#pattern-selectable-info |
#product-selectable-info
)
}
// ----------------------------------------------------------------------------
+inline const char *const patchStatusAsString( const PoolItem & pi_r )
+{
+ switch ( pi_r.status().validate() )
+ {
+ case zypp::ResStatus::UNDETERMINED: return "undetermined"; break;
+ case zypp::ResStatus::BROKEN: return pi_r.isUnwanted() ? "unwanted"
+ : "needed"; break;
+ case zypp::ResStatus::SATISFIED: return "applied"; break;
+ case zypp::ResStatus::NONRELEVANT: return "not-needed"; break;
+ }
+}
// returns true if restartSuggested() patches are availble
-static bool xml_list_patches ()
+static bool xml_list_patches (Zypper & zypper)
{
const zypp::ResPool& pool = God->pool();
it = pool.byKindBegin(ResKind::patch);
for (; it != e; ++it, ++patchcount)
{
- if (it->isRelevant() && !it->isSatisfied())
+ if (zypper.cOpts().count("all") || it->isBroken())
{
ResObject::constPtr res = it->resolvable();
Patch::constPtr patch = asKind<Patch>(res);
cout << " <update ";
cout << "name=\"" << res->name () << "\" ";
cout << "edition=\"" << res->edition ().asString() << "\" ";
+ cout << "arch=\"" << res->arch().asString() << "\" ";
+ cout << "status=\"" << patchStatusAsString( *it ) << "\" ";
cout << "category=\"" << patch->category() << "\" ";
cout << "pkgmanager=\"" << (patch->restartSuggested() ? "true" : "false") << "\" ";
cout << "restart=\"" << (patch->rebootSuggested() ? "true" : "false") << "\" ";
cout << " <update ";
cout << "name=\"" << res->name () << "\" " ;
cout << "edition=\"" << res->edition ().asString() << "\" ";
+ cout << "arch=\"" << res->arch().asString() << "\" ";
cout << "kind=\"" << res->kind() << "\" ";
cout << ">" << endl;
cout << " <summary>" << xml_encode(res->summary()) << " </summary>" << endl;
if(it != localkinds.end())
{
if (zypper.out().type() == Out::TYPE_XML)
- affects_pkgmgr = xml_list_patches();
+ affects_pkgmgr = xml_list_patches(zypper);
else
{
if (kinds.size() > 1)