} // namespace zypp
///////////////////////////////////////////////////////////////////
+#define DOLOG(C) USR << #C << ": " << endl; C;
+
+namespace zypp {
+ namespace target {
+ void testCommitPlugins( const Pathname & path_r );
+ }
+}
+
/******************************************************************
**
** FUNCTION NAME : main
INT << "===[START]==========================================" << endl;
//////////////////////////////////////////////////////////////////
+ zypp::target::testCommitPlugins( "/tmp/pltest" );
+
+ if ( 0 )
+ {
+ Pathname script( "PluginTest.py" );
+ PluginScript plugin( script );
+ USR << plugin << endl;
+
+ DOLOG( plugin.open() );
+
+ DOLOG( plugin.send( PluginFrame( "PLUGINBEGIN" ) ) );
+
+ PluginFrame ret;
+ DOLOG( ret = plugin.receive() );
+ MIL << ret << endl;
+
+ DOLOG( plugin.send( PluginFrame( "PLUGINEND" ) ) );
+ DOLOG( ret = plugin.receive() );
+ MIL << ret << endl;
+
+ DOLOG( plugin.close() );
+ }
+
if ( 0 ) {
Pathname script( ZConfig::instance().pluginsPath()/"system/spacewalkx" );
if ( PathInfo( script ).isX() )
--- /dev/null
+#!/usr/bin/env python
+#
+# ZYpp plugin
+#
+import os
+import sys
+import traceback
+import time
+
+from zypp_plugin import Plugin
+
+class MyPlugin(Plugin):
+
+ def PLUGINBEGIN(self, headers, body):
+ # commit is going to start.
+ #self.error( {}, 'oops' )
+ self.ack()
+
+ def PLUGINEND(self, headers, body):
+ # commit ended
+ self.ack()
+
+plugin = MyPlugin()
+plugin.main()