[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Transactions and specfiles...
- From: James Olin Oden <joden malachi lee k12 nc us>
- To: rpm-list redhat com
- Subject: Re: Transactions and specfiles...
- Date: Fri, 22 Aug 2003 20:59:35 -0400 (EDT)
On Fri, 22 Aug 2003, James Olin Oden wrote:
> Hi Jeff or whoever knows,
>
> I was poking around in build.c and I found that in order to parse
> a spec file you pass an rpmts to parseSpec(), and it then
> sets the name of the specfile in the transaction with
> rpmtsSpec(). My question is why do you need a transaction to parse
> a specfile?
>
I looked further, and found some of my answer. Your using the
transaction to check build dependencies using the same routine you
use to check install dependencies (rpmtsCheck()). That said, there
is a little jig you do that goes like this:
1) Parse the spec file with parseSpec() passing it the
transaction.
2) parseSpec will put a pointer to the newly created spec
structure in the rpmts via rpmtsSetSpec.
3) In the routine that parseSpec returns to, you then
call rpmtsSetSpec again setting it to null, but as
a side affect rpmtsSetSpec returns the pointer to
the spec structure (created in parseSpec).
You then use that pointer to the spec structure to do other things
(build a SRPM header in core, and so on). What I don't get is
why not just return the pointer to the spec structure, or have
parseSpec take a pointer to a spec pointer, and then just set that
directly? The way your doing it seems convoluted, or am I missing
something (which I have no doubt I am (-;)?
On a seperate note, further down in buildForTarget(), you call
buildSpec() with an rpmts as the first argument, but in this case
buildSpec() does not use the rpmts at all? Did you use to use the rpmts,
decided not to continue doing so, but by then someone was calling
buildSpec directly, and removing the rpmts arg would have broken
their code?
Again just curious...james
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[]