# Big hammer DNF plugin that uses __init__ to find the pid of dnf, then # backgrounds a script to wait for the DNF pid to exit so it can run # arbitrary stuff following dnf. I have absolutely no idea what most of this # gibberish is, I'm just copying an existing plugin as best I can and # getting the hell out of python and into shell scripts as fast as # possible. Using strace on dnf it appears as though the path I should # install this in is: # # /usr/lib/python2.7/site-packages/dnf-plugins/ # # (certainly the official dnf docs desperately avoid actually # saying anything about the real path, so I had to go with strace :-). from __future__ import absolute_import from __future__ import unicode_literals import dnf import dnfpluginscore import os _ = dnfpluginscore._ class AfterDnf(dnf.Plugin): name = 'afterdnf' def __init__(self, base, cli): super(AfterDnf, self).__init__(base,cli) os.system("/usr/local/bin/after-dnf-start {0}".format(os.getpid()))