Show support level in package info (bnc #599154)
authorJán Kupec <jkupec@suse.cz>
Mon, 26 Apr 2010 11:44:47 +0000 (13:44 +0200)
committerJán Kupec <jkupec@suse.cz>
Tue, 13 Jul 2010 14:17:24 +0000 (16:17 +0200)
src/info.cc

index 2100bf6..7166bc4 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "zypp/ZYpp.h"
 #include "zypp/base/Algorithm.h"
+#include "zypp/Package.h"
 #include "zypp/Patch.h"
 #include "zypp/Pattern.h"
 #include "zypp/Product.h"
@@ -173,6 +174,7 @@ void printPkgInfo(Zypper & zypper, const ui::Selectable & s)
   PoolItem theone = s.updateCandidateObj();
   if (!theone)
     theone = installed;
+  Package::constPtr pkg = asKind<Package>(theone.resolvable());
 
   cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
        << (zypper.config().show_alias ?
@@ -181,6 +183,11 @@ void printPkgInfo(Zypper & zypper, const ui::Selectable & s)
 
   printNVA(theone.resolvable());
 
+  // if running on SUSE Linux Enterprise, report unsupported packages
+  Product::constPtr platform = God->target()->baseProduct();
+  if (platform && platform->name().find("SUSE_SLE") != string::npos)
+    cout << _("Support Level: ") << asUserString(pkg->vendorSupport()) << endl;
+
   cout << _("Installed: ") << (installed ? _("Yes") : _("No")) << endl;
 
   //! \todo fix this - arch?