[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Transactions and specfiles...
- From: Jeff Johnson <jbj redhat com>
- To: rpm-list redhat com
- Subject: Re: Transactions and specfiles...
- Date: Mon, 25 Aug 2003 11:24:29 -0400
On Fri, Aug 22, 2003 at 08:59:35PM -0400, James Olin Oden wrote:
> 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 (-;)?
>
Yup, convoluted mainly for hysterical reasons, recent changes drilled
an rpmts object only where necessary, not completely as on the install
ide, through the rpmbuilkd API.
> 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?
Yup, starting to drill an rpmts object everywhere even if not (yet) used.
73 de Jeff
--
Jeff Johnson ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[]