[OE-core] package_rpm.bbclass: Replace shell provides/requires script with python version

Mark Hatle mark.hatle at windriver.com
Fri Apr 27 17:37:17 UTC 2012


On 4/27/12 12:09 PM, Richard Purdie wrote:
> On Thu, 2012-04-26 at 15:34 -0500, Mark Hatle wrote:
>> On 4/26/12 2:54 PM, Richard Purdie wrote:
>>> The existing shell script is a fork bomb and forks off hundreds of
>>> grep/cur/wc calls as it reads from its input stream and iterates over
>>> the file data table for each line of input. This patch replaces the
>>> shell code with python code which doesn't exec anything and hence runs
>>> much faster without the exec() overhead. This speeds up rpm packaging
>>> considerably, as can be measured simply by timing it, or watching the
>>> processor utilisation.
>>
>> Just an FYI, the intent was to replace this code completely with a patch to RPM
>> when it got upgraded.  Then RPM could read in the dependencies directly and not
>> have to worry about hacky script solutions.
>>
>> Needless to say we're not yet at that point, so this is fine..  but hopefully
>> we're getting closer.
>
> I agree with the objective. I've had the patch lying around for a while
> and in use in my builds so it was already written and doesn't seem to
> regress anything. It seems to make sense to include it for now until the
> rpm upgrade happens and we fix things properly.
>
> The patch also has a partner in crime:
>
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&id=c0cbf016f59b06f461961df4d6cdfcd0928c96ee
>
> but I suspect you'd dislike that one even if functionally it doesn't
> change much at the moment.

Ya..  this other one sets a bad precedent, even though the functional behavior 
is the same currently.  (There is one odd thing, the lack of the #file stuff in 
the first chunk, I'm surprised anything works since the dependency stuff is 
never translated back to on-disk filename format.)

My longer term intention is to either write out the per-file data directly into 
the spec file so RPM can process it "per-file", or write the data to a data file 
that works along side the .spec file, but again it's only loaded once, instead 
of many times as it currently is.

(The still TODO work of course is do something reasonable in ipkg and deb 
packages that add these missing per-file dependencies.  I suspect we'll be 
limited in many ways because, AFAIK, deb and ipkg can't do dependencies on path 
names.)

--Mark

> Cheers,
>
> Richard
>





More information about the Openembedded-core mailing list