Skip to content
8 changes: 7 additions & 1 deletion scripts/zypp-plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ def match_solvables(self, names):
if found and important:
return True, True
return found, important

def zypper_arguments(self):
if basename(readlink("/proc/%d/exe" % getppid())) == "zypper":
return " ".join(open("/proc/%s/cmdline" % getppid()).read().split('\x00')[1:])
else:
return ""


def PLUGINBEGIN(self, headers, body):
Expand All @@ -153,7 +159,7 @@ def PLUGINBEGIN(self, headers, body):

logging.debug("headers: %s" % headers)

self.description = "zypp(%s)" % basename(readlink("/proc/%d/exe" % getppid()))
self.description = "zypp(%s) %s" % (basename(readlink("/proc/%d/exe" % getppid())), self.zypper_arguments())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFIAS the description has a trailing whitespace if it's not from zypper. That's not nice.

self.userdata = self.get_userdata(headers)

self.ack()
Expand Down