<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.15"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>libzypp: System plugin</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(initResizable); /* @license-end */</script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">libzypp  <span id="projectnumber">17.9.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.15 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('plugin-system.html','');}); /* @license-end */ </script> <div id="doc-content"> <div class="PageDoc"><div class="header"> <div class="headertitle"> <div class="title">System plugin </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><dl class="section author"><dt>Author</dt><dd>Michael Andres <a href="#" onclick="location.href='mai'+'lto:'+'ma@'+'su'+'se.'+'de'; return false;">ma@su<span style="display: none;">.nosp@m.</span>se.d<span style="display: none;">.nosp@m.</span>e</a></dd></dl> <hr/> <h1><a class="anchor" id="intro"></a> Introduction</h1> <p>This is a statefull plugin executed at the end of <a class="el" href="classzypp_1_1ZYpp.html#a27e3f9aa4c5c257acf2ad3720f5784d1">zypp::ZYpp::commit</a>, if the system content has change, i.e. if packages have actually been installed or deleted.</p> <p>All plugins found in <code>/usr/lib/zypp/plugins/system</code> are launched. Unless otherwise specified, messages received need to be confirmed by sending an <code>ACC</code> message. Sending back an unexpected or <code>ERROR</code> message, the execution of the plugin will be canceled.</p> <p>If you have e.g. <code>zypp-plugin-python</code> installed a basic system plugin could look like this:</p> <pre class="fragment">#!/usr/bin/env python # # zypp system plugin # import os import sys from zypp_plugin import Plugin class MyPlugin(Plugin): def PACKAGESETCHANGED(self, headers, body): // Installation has ended. The set of installed packages has changed. // .... self.ack() def plugin = MyPlugin() plugin.main() </pre><dl class="section see"><dt>See also</dt><dd><a class="el" href="zypp-plugins.html#plugin-writing">Writing plugins</a></dd></dl> <hr/> <h1><a class="anchor" id="pluginbegin"></a> PLUGINBEGIN</h1> <pre class="fragment">PLUGINBEGIN userdata:TIDfoo42 ^@ </pre><p> Sent as 1st message after the plugin was launched. Prepare your plugin and send an <code>ACC</code> message when you are done.</p> <ul> <li><code>userdata:stringval</code> Optional header sent if the application has provided a user data string. <dl class="section see"><dt>See also</dt><dd><a class="el" href="zypp-userdata.html">User data as transaction id</a></dd></dl> <hr/> </li> </ul> <h1><a class="anchor" id="packagesetchanged"></a> PACKAGESETCHANGED</h1> <pre class="fragment">PACKAGESETCHANGED ^@ </pre><p> Installation has ended. The set of installed packages has changed.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classzypp_1_1sat_1_1Transaction_1_1Step.html">zypp::sat::Transaction::Step</a></dd></dl> <hr/> <h1><a class="anchor" id="pluginend"></a> PLUGINEND</h1> <pre class="fragment">PLUGINEND ^@ </pre><p> This message is sent at the end before the plugin is closed. You should receive this message even if the action was aborted by some unexpected exception. </p> </div></div><!-- PageDoc --> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="zypp-plugins.html">Extending ZYpp: Plugins and Hooks</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li> </ul> </div> </body> </html>