[Yum-devel] Looking in yum 3.1.2 for the function/method that calls rpm scriptlets.

John Rouillard rouilj at renesys.com
Thu Feb 22 03:24:49 UTC 2007


Hi all:

I am still looking for the function/method in yum that executes the
%pre scriptlet.

I have crawled over the 3.1.2 code looking for 'spawn' calls,
'install', 'pre', 'scriptlet', 'open' and a few other keywords that I
was hoping would point to the right locations. Obviously I am just not
hitting the right grep or search strings to find the code that
executes the scriptlet for each item in the list.

My goal is to allow the scriptlet to determine if it is being executed
as part of the install or upgrade path.  Sadly the use of the count
passed to the pre scriptlet is the same for these cases when you have
multiple versions of a package installed.

My guess is the code is somewhere down the call chain from
cli.py:doTransaction. My guess is that the magic happens in the call to
self.runTransaction, but my reading of that seems to deal only with
calling pretransaction and posttransaction plugins, not the
scriptlets.

If I can find the function that runs the shell on the scriptlet, my
plan is to check the 'ts_state' flag to see if it is set to 'i' or 'u'
and set an environment variable to "install" or "update".

So can somebody toss me a bone here? Am I missing a design document
somewhere that I should be reading? I assume somebody must know the
answer, or is this one of those UTSL situations and I will have to
fire up the debugger and walk through the code?

Thanks for any suggestions.

-- 
				-- rouilj

John Rouillard
System Administrator
Renesys Corporation
603-643-9300 x 111



More information about the Yum-devel mailing list