Show patch severity (bnc#881373,FATE#312633)
authorMichael Andres <ma@suse.de>
Wed, 11 Jun 2014 05:34:43 +0000 (07:34 +0200)
committerMichael Andres <ma@suse.de>
Wed, 11 Jun 2014 05:34:43 +0000 (07:34 +0200)
src/SolverRequester.cc
src/info.cc
src/search.cc
src/update.cc
src/utils/misc.cc

index cec7c7f..79c5c9f 100644 (file)
@@ -419,7 +419,7 @@ bool SolverRequester::installPatch(
         addFeedback(Feedback::PATCH_UNWANTED, patchspec, selected, selected);
       }
 
-      else if (!_opts.category.empty() && _opts.category != patch->category())
+      else if ( ! ( _opts.category.empty() || patch->isCategory( _opts.category ) ) )
       {
        DBG << "candidate patch " << patch << " is not in the specified category" << endl;
        addFeedback(Feedback::PATCH_WRONG_CAT, patchspec, selected, selected);
index ebb9cd9..62153ea 100644 (file)
@@ -264,6 +264,7 @@ void printPatchInfo(Zypper & zypper, const ui::Selectable & s )
 
   Patch::constPtr patch = asKind<Patch>(pool_item.resolvable());
   cout << _("Category: ") << patch->category() << endl;
+  cout << _("Severity: ") << patch->severity() << endl;
   cout << _("Created On: ") << patch->timestamp().asString() << endl;
   cout << _("Reboot Required: ") << (patch->rebootSuggested() ? _("Yes") : _("No")) << endl;
 
index a020065..6c3a846 100644 (file)
@@ -341,13 +341,10 @@ FillPatchesTable::FillPatchesTable( Table & table, zypp::TriBool inst_notinst )
   TableHeader header;
 
   header
-    // translators: catalog (rug's word for repository) (header)
-    << _("Catalog")
+    << (_gopts.is_rug_compatible ? _("Catalog") : _("Repository"))
     << _("Name")
-    << table::EditionStyleSetter( *_table, ("Version") )
-    // translators: patch category (recommended, security)
     << _("Category")
-    // translators: patch status (installed, uninstalled, needed)
+    << _("Severity")
     << _("Status");
 
   *_table << header;
@@ -369,8 +366,8 @@ bool FillPatchesTable::operator()(const zypp::PoolItem & pi) const
   row
     << pi->repository().asUserString()
     << pi->name()
-    << pi->edition().asString()
     << patch->category()
+    << patch->severity()
     << string_patch_status(pi);
 
   *_table << row;
index 4c76e04..f89ec3f 100755 (executable)
@@ -136,6 +136,7 @@ static bool xml_list_patches (Zypper & zypper)
        cout << "arch=\""  << res->arch().asString() << "\" ";
        cout << "status=\""  << patchStatusAsString( *it ) << "\" ";
         cout << "category=\"" <<  patch->category() << "\" ";
+        cout << "severity=\"" <<  patch->severity() << "\" ";
         cout << "pkgmanager=\"" << (patch->restartSuggested() ? "true" : "false") << "\" ";
         cout << "restart=\"" << (patch->rebootSuggested() ? "true" : "false") << "\" ";
 
@@ -258,7 +259,7 @@ static bool list_patch_updates(Zypper & zypper)
   unsigned cols;
 
   th << (zypper.globalOpts().is_rug_compatible ? _("Catalog") : _("Repository"))
-     << _("Name") << table::EditionStyleSetter( tbl, _("Version") ) << _("Category") << _("Status") << _("Summary");
+     << _("Name") << _("Category") << _("Severity") << _("Status") << _("Summary");
   cols = 6;
   tbl << th;
   pm_tbl << th;
@@ -279,7 +280,7 @@ static bool list_patch_updates(Zypper & zypper)
           continue;
       }
 
-      if (!category.empty() && category != patch->category())
+      if ( ! ( category.empty() || patch->isCategory( category ) ) )
       {
         DBG << "candidate patch " << patch << " is not in the specified category" << endl;
         continue;
@@ -289,8 +290,9 @@ static bool list_patch_updates(Zypper & zypper)
       {
         TableRow tr (cols);
         tr << patch->repoInfo().asUserString();
-        tr << res->name () << res->edition ().asString();
+        tr << res->name ();
         tr << patch->category();
+        tr << patch->severity();
         tr << (it->isBroken() ? _("needed") : _("not needed"));
         tr << patch->summary();
 
@@ -579,7 +581,7 @@ void list_patches_by_issue(Zypper & zypper)
 
   Table t;
   TableHeader th;
-  th << _("Issue") << _("No.") << _("Patch") << _("Category") << _("Status");
+  th << _("Issue") << _("No.") << _("Patch") << _("Category") << _("Severity") << _("Status");
   t << th;
 
 #define FILL_ISSUES(TYPE, ID) \
@@ -671,8 +673,9 @@ void list_patches_by_issue(Zypper & zypper)
         TableRow tr;
         tr << itype;
         tr << d->subFind(sat::SolvAttr::updateReferenceId).asString();
-        tr << (patch->name() + "-" + patch->edition().asString());
+        tr << patch->name();
         tr << patch->category();
+        tr << patch->severity();
         tr << (pi.isBroken() ? _("needed") : _("not needed"));
         t << tr;
       }
@@ -682,7 +685,7 @@ void list_patches_by_issue(Zypper & zypper)
   // look for matches in patch descriptions
   Table t1;
   TableHeader th1;
-  th1 << _("Name") << table::EditionStyleSetter( t1, _("Version") ) << _("Category") << _("Summary");
+  th1 << _("Name") << _("Category") << _("Severity") << _("Summary");
   t1 << th1;
   if (!issuesstr.empty())
   {
@@ -701,7 +704,7 @@ void list_patches_by_issue(Zypper & zypper)
       Patch::constPtr patch = asKind<Patch>(pi.resolvable());
 
       TableRow tr;
-      tr << patch->name() << patch->edition().asString() << patch->category();
+      tr << patch->name() << patch->category() << patch->severity();
       //! \todo could show a highlighted match with a portion of surrounding
       //! text. Needs case-insensitive find.
       tr << patch->summary();
index a91c75d..6b218c2 100644 (file)
@@ -129,7 +129,7 @@ string string_patch_status(const PoolItem & pi)
     return "";
   }
 
-  return _("Not Applicable"); //! \todo make this "Not Needed" after 11.0
+  return _("Not Needed");
 }
 
 // ----------------------------------------------------------------------------