Parameter passing between %pre and %post section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Thanks for your mail.
 
Yes you are right. I am checking for the existence of a file in the %pre section and setting a counter which will be used in further processing in the %post section. This file contains some sql statements which will be executed/skipped depending on the counter value in the %post section after additional files have been copied by the %install section.
 
So, what I am trying to achieve is that :
Check for existence of a file in %pre section,
do not execute the %install and break out if the file is not there,
set a counter in the %pre section if the file exists.
 
In %post
use this counter and do subsequent processing.
 
Hope I have been able to explain my problem.
 
Currently I am writing this counter to a temporary file in %pre and reading it in %post and then deleting the temporary file containing the counter.
 
Once again, thanks for your reply.
 
Regards,
 
Lis Thomas

 
On 8/9/07, Lis Maria <lismariain@xxxxxxxxx > wrote:


---------- Forwarded message ----------
From: Bob Proulx <bob@xxxxxxxxxx>
Date: Aug 9, 2007 9:18 AM
Subject: Re: Parameter passing between %pre and %post section
To: rpm-list@xxxxxxxxxx

Hmm...  That is a very vague description.  It would help if you were
more specific.

What would be available to be known in the %pre section that would not
also be available to be known in the %post section in exactly the same
way?  The only thing I can think of is that in the %pre section it is
possible to determine if files that are going to be installed by the
package are already existing on the filesystem.  In which case they
could be moved out of the way and into a save location if there was a
desire to do that.  (I would probably avoid that though.  It makes a
cleanup problem.)  Other than this I can't guess and any information
that would be available in %pre but not be readily in %post.

> Currently I have writtent the entry to a temporary file and am reading that
> file in the %post section. This, I understand is not an elegant one.

I would be concerned about ordering of events in all cases and picking
up possibly stale data in other cases and odd corner case problems.
In the simple case it should work but the devil is in the details and
there are a lot of use case possibilities.

> is there someway through which we cans etup a macro in the pre
> section and access it elsewhere/

None of which I am aware.

Bob

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux