[Yum-devel] pre, post jobs continued
Menno Smits
menno at freshfoo.com
Sun Jul 11 08:35:24 UTC 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I've been talking with Seth Vidal about doing a general class to handle
pre and post processing jobs (as per
https://lists.dulug.duke.edu/pipermail/yum-devel/2004-June/000188.html).
I've been thinking about the XML file to be used to configure instances
of this class and have come up with the following example based on usage
cases and discussions on this list.
- ---< snip >-------------------------------------------------------
<matches>
~ <match>
~ <state>pretrans</state>
~ <conditions>
~ <condition>
~ <type>pkg</type>
~ <arg name="name">glibc</arg>
~ <arg name="state">remove</arg>
~ </condition>
~ </conditions>
~ <actions>
~ <action>
~ <type>confirm</type>
~ <arg name="msg">
~ Are you sure you wish to remove glibc?
~ </arg>
~ </action>
~ </actions>
~ </match>
~ <match>
~ <state>postpkgtrans</state>
~ <conditions>
~ <condition>
~ <type>pkg</type>
~ <arg name="name">bar*</arg>
~ </condition>
~ </conditions>
~ <actions>
~ <action>
~ <type>exec</type>
~ <arg>/etc/init.d/bar start</arg>
~ </action>
~ </actions>
~ </match>
~ <match>
~ <state>postdepresolve</state>
~ <conditions>
~ <condition>
~ <type>numpkgs</type>
~ <arg name="op">gt</arg>
~ <arg name="value">100</arg>
~ </condition>
~ </conditions>
~ <actions>
~ <action>
~ <type>confirm</type>
~ <arg>More than 100 packages are going to
~ be modified. Confirm?
~ </arg>
~ </action>
~ </actions>
~ </match>
</matches>
- ---< snip >-------------------------------------------------------
Each <match> section has a state, one or more conditions and one or more
actions associated with it. The state must match and all conditions must
be true in order for the actions to be run (logical AND). Each condition
type and action type (specified between the <type> tags) corresponds to
a Python function which is called as required. The arguments specified
by the <arg> tags are passed to the conditions/action function.
More to come but I thought I'd get some comments at this stage. Feedback
anyone?
Regards,
Menno
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFA8PvMWH92Dls5JXwRAnegAJwMl7Qjq8FriUyoNZA29KE9rI+ZUACggGIL
mBPQerscq2UT7NYvOpvUTxM=
=Bt6J
-----END PGP SIGNATURE-----
More information about the Yum-devel
mailing list