RPM %post and %preun

In an RPM spec file %post gets run after the install of the
binary package is complete.  %preun gets run before the uninstall
procedes.  I have a package which creates a file with %post and
deletes it with %preun.  Whenever I upgrade the package, the
newer package creates the file first.  Then the older package
deletes it.  I would think that the older package being
uninstalled would delete it first, followed by the new package
creating it.  But, it doesn't work this way.

Help?  Thanks....

-- 
Unless otherwise noted, the statements herein reflect my personal
opinions and not those of any organization with which I may be affiliated.
0
nobody3134 (44)
8/21/2003 7:34:50 PM
comp.os.linux.misc 33612 articles. 22 followers. amosa69 (125) is leader. Post Follow

6 Replies
387 Views

Similar Articles

[PageSpeed] 32
Kevin wrote:

> In an RPM spec file %post gets run after the install of the
> binary package is complete.  %preun gets run before the uninstall
> procedes.  I have a package which creates a file with %post and
> deletes it with %preun.  Whenever I upgrade the package, the
> newer package creates the file first.  Then the older package
> deletes it.  I would think that the older package being
> uninstalled would delete it first, followed by the new package
> creating it.  But, it doesn't work this way.

the install happens first, then the uninstall.

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225

-- 
------------------------------------------------------------------
  Andrew Schultz                    | The views expressed might
  ajschult@eos.ncsu.edu             | not represent those of NCSU.
  http://www4.ncsu.edu/~ajschult/   | They are however, correct.

0
ajschult (13)
8/21/2003 10:08:17 PM
Kevin wrote:
> In an RPM spec file %post gets run after the install of the
> binary package is complete.  %preun gets run before the uninstall
> procedes.  I have a package which creates a file with %post and
> deletes it with %preun.  Whenever I upgrade the package, the
> newer package creates the file first.  Then the older package
> deletes it.  I would think that the older package being
> uninstalled would delete it first, followed by the new package
> creating it.  But, it doesn't work this way.
> 
> Help?  Thanks....
> 

Andrew is right 'install new, deinstall old'

But you can use the variable $1 to see whether it's a
- first install
- update
- full remove

$1 gives you the number of instance already installed
or was it the number of instance installed after having
executed the rpm command?

Anyway, my CVS host is down and I can't checkout any spec file
for an example.

You can try to play around with

%pre

echo "pre: $1"

%post

echo "post: $1"

%preun

echo "preun: $1"

%postun

echo "postun: $1"

and see what happens.

Toni

0
8/22/2003 12:48:01 PM
Andrew Schultz wrote:
> 
> Kevin wrote:
> 
> > In an RPM spec file %post gets run after the install of the
> > binary package is complete.  %preun gets run before the uninstall
> > procedes.  I have a package which creates a file with %post and
> > deletes it with %preun.  Whenever I upgrade the package, the
> > newer package creates the file first.  Then the older package
> > deletes it.  I would think that the older package being
> > uninstalled would delete it first, followed by the new package
> > creating it.  But, it doesn't work this way.
> 
> the install happens first, then the uninstall.
> 
> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225
> 
> --

Does anyone understand the logic behind this paradigm (install then uninstall)? Everyone I talk to thinks it's backward. 

/dan
0
ganek (9)
9/4/2003 2:19:04 PM
In article <3F5749D8.E2148DF9@attbi.com>, Daniel Ganek wrote:
> Andrew Schultz wrote:
>> 
>> Kevin wrote:
>> 
>> > In an RPM spec file %post gets run after the install of the
>> > binary package is complete.  %preun gets run before the uninstall
>> > procedes.  I have a package which creates a file with %post and
>> > deletes it with %preun.  Whenever I upgrade the package, the
>> > newer package creates the file first.  Then the older package
>> > deletes it.  I would think that the older package being
>> > uninstalled would delete it first, followed by the new package
>> > creating it.  But, it doesn't work this way.
>> 
>> the install happens first, then the uninstall.
>> 
>> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225
>> 
> Does anyone understand the logic behind this paradigm (install then 
> uninstall)? Everyone I talk to thinks it's backward. 

Perhaps the idea is that if the install fails, the previous version is still 
available.

-- 
Dave Brown  Austin, TX
0
dhbrown (306)
9/4/2003 4:32:53 PM
On Thu, 04 Sep 2003 16:32:53 GMT,
    Dave Brown <dhbrown@hobbes.dhbrown.net> wrote:


>In article <3F5749D8.E2148DF9@attbi.com>, Daniel Ganek wrote:
>> Andrew Schultz wrote:
>>> 
>>> Kevin wrote:
>>> 
>>> > In an RPM spec file %post gets run after the install of the
>>> > binary package is complete.  %preun gets run before the uninstall
>>> > procedes.  I have a package which creates a file with %post and
>>> > deletes it with %preun.  Whenever I upgrade the package, the
>>> > newer package creates the file first.  Then the older package
>>> > deletes it.  I would think that the older package being
>>> > uninstalled would delete it first, followed by the new package
>>> > creating it.  But, it doesn't work this way.
>>> 
>>> the install happens first, then the uninstall.
>>> 
>>> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225
>>> 
>> Does anyone understand the logic behind this paradigm (install then 
>> uninstall)? Everyone I talk to thinks it's backward. 
>
>Perhaps the idea is that if the install fails, the previous version is still 
>available.
>

That is too late if the old files have already been replaced by the new ones.
And I do expect that the new files from the package are put in place before
running the %post script.  


Villy
0
vek (278)
9/5/2003 7:57:27 AM
In article <slrnblggf7.8cb.vek@station02.ohout.pharmapartners.nl>, 
Villy Kruse wrote:
> On Thu, 04 Sep 2003 16:32:53 GMT,
>     Dave Brown <dhbrown@hobbes.dhbrown.net> wrote:
> 
>>In article <3F5749D8.E2148DF9@attbi.com>, Daniel Ganek wrote:
>>> Andrew Schultz wrote:
>>>> the install happens first, then the uninstall.
>>>> 
>>> Does anyone understand the logic behind this paradigm (install then 
>>> uninstall)? Everyone I talk to thinks it's backward. 
>>
>>Perhaps the idea is that if the install fails, the previous version is still 
>>available.
>>
> 
> That is too late if the old files have already been replaced by the new ones.
> And I do expect that the new files from the package are put in place before
> running the %post script.  

Too late? Well, that would depend on when the install-fail occurred.  But
consider that if files were already replaced, then it would seem like the
uninstall of the previous version would remove the replacement files.

-- 
Dave Brown  Austin, TX
0
dhbrown (306)
9/5/2003 9:29:38 PM
Reply:
Similar Artilces:

Routing Video Tutorials are Posted Again
In response to Gil Alsberg's request for Video Routing Tutorials, last week, I posted 6 of them on my WebSite for four days and evidentally, I didn't keep them there long enough, because many of you missed them, including Gil himself, it seems. Well anyway, I put them back for all who want them, and I will keep them there for one more week. The total size compressed is 44 MB, and you should be able to achieve 200 Kbytes/sec D/L speed with a Cable Connection. There are six alltogether, and two are in the 30 MB range, and all are both Audio/ Video. Here is the link: www.deangelistool...

Snit posting less often
Snit's wife, Anne, has been very helpful. Snit was telling her he was working the whole time he was trolling COLA. She did not know why he was making so little money. Now she knows. Now she is telling him to change his ways or pay a price. Snit is not completely gone but he will never be the troll he was. Anne also tells me I was not the only one to contact her. Thank you for your support in helping to save COLA. Another forum NOT ruined by Michael Glasser Prescott Computer Guy of Prescott, Arizona 86301 http://prescottcomputerguy.com The best website design in Prescott, ...

problems posting
pease ignore: I sent a detailed message a little while ago and it did not seem to post. I'm sending this to test posting is working. ...

Post Office Gets Pressured to Pry
By Ryan Singel WASHINGTON -- Under political pressure to increase profitability and security, the United States Postal Service is introducing new technology that can trace the progress of mail from sender to recipient and record the identity of both parties. Bulk mailers -- such as mail-order services, credit-card companies and online DVD rental services -- already use an "intelligent mail" offering to confirm the check really is in the mail and to speed up outgoing shipments of The Postman Always Rings Twice . Critics, however, say new tracking technology could spe...

Job Post: Richmond VA Analyst and Programmers
Job Post: Analysts and SAS Programmers Location: Richmond VA Company: SunTrust Mortgage The Credit Analytics Dept. of SunTrust Mortgage in Richmond VA is looking for Analysts and SAS programmers. We would prefer those with experience in the mortgage industry but it is not essential. Rates are competitive and we are open to contract, contract to hire, and FTE for the right candidates. Please NO THIRD PARTY SOLICITATIONS. If interested, please email a copy of your resume to: gary.mcquown@suntrust.com with the subject line of "SAS JOB" Or snail mail a hard copy of your resume to:...

Post Your Business Opportunities Here
According to me sales and business increase by marketing.So market place need to be clean and powerful.Take a step for clear business. place ad @ http://www.adplacebd.com > your trustful partner.visit http://www.adplacebd.com ...

RPM for RHEL 4
I would like to add more software to my RHEL 4 Server (learning/testing) ; however, I have a couple of questions... (1) What good respository should I add to my download source (apt and/or yum)? (2) I have RHEL 4 as mentioned - what compatible binary RPM are suitable - (ANY of these --> Mandrake 10.x, Fedora 3, Red Hat 9)? --> AW wrote: > I would like to add more software to my RHEL 4 Server (learning/testing) ; > however, I have a couple of questions... > > > (1) What good respository should I add to my download source (apt and/or > y...

nmh to read/post to newsgroups?
I seem to remember reading somewhere taht you could use nmh to read usenet news articles if you spooled the news and then made symlinks to somewhere in your nmh path from the news spool for each group. But how do you post and reply to what you read? David Csercsics <aarg@shaw.ca> writes: > I seem to remember reading somewhere taht you could use nmh to read > usenet news articles if you spooled the news and then made symlinks > to somewhere in your nmh path from the news spool for each group. But > how do you post and reply to what you read? Trying looking thro...

Python 2.3.2 RPM's for Redhat 8.0 or Python source RPM and upgrade procedure?
Does anynone have these available? I'd like to upgrade (hoping it doesn't break my Redhat install). If I upgrade, all my site-packages have to be reinstalled to the new site-packages directory right? Scott ...

error in creating an rpm
Hello, I'm trying to make an rpm out of courier-imap. I'm doing this as a normal user as explained in the faq. I've got my directory structure set up properly and have made other rpms. My problem now is i'm getting errors from configure that it can't create a temp file for here document, permission denied. Then a little later an error which stops the show in that the c compiler can not create executables. I've got permissions on the entire tree as 770 owner and group is my user. Suggestions welcome. Thanks. Dave. ...

Dynamic checkbox ignored when posting
Hi - when I add (dynamically) a row to a table, which includes a checkbox, I want the value of the checkbox to be posted along with the other controls already on the form when the form is submitted. I can get this to work no problem on IE6, but in NN7, although the checkbox is added to my screen, when posted (submit on form), the checkbox is ignored. The checkbox is added within the form. Any ideas? function addRowaddFact (cb_strval) { var table; table = document.getElementById('tbladdFact'); if (table && table.insertRow) { var row = table.insertRow(table.rows.l...

posted by tifssoft nntp #15
�����G�����UJU��hA+S�g�tL�r�2bX�ilE��6��K�y���Ty62�Th�w�tkJ�EHW�6��k�ddqT+�USx��v�po�0���YN-��M3��Q�s-f��gp����r�QXRdi����NJ�L�O�YL0�����+�t�8NUuW�LHHU6Y���wzTSUeHg7�o��y�5���S���N4�+r��Rk2HZXa��k�BIJrqP��w�DHl�bdk��rI��smNdDyk�iu���v�y��O����M���P�j�Bsand ���S�7H�zpP�aZ2���st��LOqFDOktk0F��D�F��4�v�9���V�VB����+�z�-a�Y1zf��C����reHZ��DhjO�-�9���D�S�p�T��X2Q��H��kc��K��m��Y��A�LOp�h8G��bZ�������G�A��ANz�F�dy���bw����x�kMF-�D��a-4��H�������9bqs�sr-�Q��GzMJ5���KQl��b�r���f6o�j����R�Sx�h��VNJs���Ff��pya�d��a�S� �Q�������VV3�3F�s�o��Km��5ZA�e�mvP���P��Z�����H�g��Q���M�S�IA�i�p����p��JYqk��tZ5�Xq�3...

Re: OT: PC newsreaders and top- vs. bottom-posting
On Tue, 18 Jan 2005 23:07:39 +1100, Scott <usenet739_yahoo_com_au@CRONKITE.CC.UGA.EDU> wrote: >Hi, > >Two quick off-topic questions: > >1. Can you recommend a good PC-based newsreader? I've downloaded most of >the freeware newsreaders, but just haven't had the time to go thru each one. >Your recommendation, esp. if seconded by others, will help focus my testing. >Prefer freeware, but cheap if good will also work. > >2. Is there a consensus between top- vs. bottom-posting in this newsgroup? >I've been top-posting, mainly cuz OE makes it eas...

Forum Posting or Signature Posting Services
The service of Forum Posting, also known as Signature Posting is offered by our company, The Consultant SEO. It is basically a way by which one can get good quality =93one way=94 links in an effective and efficient manner. This very service, along with a back link linked with your website=92s signature is undertaken by our company. It is done to bring more and more traffic to our client=92s website. Alongside, another vital part is that our client=92s customers are not able to read the messages posted by our client. We also create various themes for our customer=92s links by providing inbound ...

Automated Macro Grid to RPM Grid?
All, Does anyone know of an automated way to convert an RPM with macro grid RLOCs to one using RPM grid RLOCs? As far as I can tell, the only way to convert right now is to manually replace the RLOCs in the Floorplanner-generated UCF with the RPM values found with FPGA Editor. My RPM is about 1K LUTS, so this approach is not feasible. Can FPGA Editor create a file that I can then parse with a Perl script? John ...

Weekly Mini-FAQ post for DJGPP #602
This is the Mini-FAQ for djgpp. $Date: 2015/04/12 18:49:25 $ ------------------------------- -- This is posted weekly to the djgpp news group and mailing list. -- What is DJGPP? DJGPP is a 32-bit C/C++/ObjC++/Ada/F95 development suite -------------- for the MS-DOS environment, based on the GNU tools. Full information is found in the complete (200+ page) FAQ -- make sure you get the complete FAQ (see below) How do I get DJGPP? ------------------- FTP: ftp://ftp.delorie.com/pub/djgpp/current/ WWW: http://www.delorie.com/pub/djgpp/current/ ...

Where can I post MoviePlayer extension 2.5.1?
I have an old version of QuickTime MoviePlayer 2.5.1 that I would like to give to the group.This old program allows you to do all of the cut and paste that you have to pay for now.It is only 194K stuffed with dropstuff and 387K for the unstuffed folder. I am running 9.1 on a Beige G3 and the only problem I have had is when upgrading QuickTime it is deleted so I always have it backed up on my Jaz drive to reinstall.Bill. to reply via email remove yourshorts In article <190720031347205070%buddydyourshorts@charter.net>, Bill Duncan <buddydyourshorts@charter.net> wrote: > I have ...

Korea Post switches to GNU/Linux
Korea Post switches to GNU/Linux to avoid virus prone and hacker prone windopes. http://times.hankooki.com/lpage/biz/200508/kt2005083119163911860.htm Save money too. On Wed, 31 Aug 2005 21:07:49 +0000, 7 wrote: > Korea Post switches to GNU/Linux to avoid > virus prone and hacker prone windopes. > > http://times.hankooki.com/lpage/biz/200508/kt2005083119163911860.htm > > Save money too. Big win for Linux no doubt! I'll bet Bill isn't sleeping well these days :) ...

Comp.software-eng FAQ (Part 0): periodic postings and archives #26
Last-Modified: 9 May 2004 Archive-name: software-eng/part0 URL: http://www.cs.queensu.ca/FAQs/SE/ Welcome to comp.software-eng, a newsgroup for discussion of software engineering and related topics. This message is followed by four others, each summarizing a set of "frequently asked questions" (FAQs): Comp.software-eng FAQ (Part 1): questions and answers Comp.software-eng FAQ (Part 2): CASE tools summary Comp.software-eng FAQ (Part 3): readings Comp.software-eng FAQ (Part 4): CASE tool vendors Be warned: the only mechanism we use to compose these lists is to gathe...

How to create my own RPM from RPM source?
Hi all, I want to create an RPM for CentOS 4.5 from the src rpm's located at http://people.redhat.com/atkac/bind/ Does anyone have a walkthrough or a URL they can point me in the direction of so I can understand how to do this? Thanks in advance. Patrick ...

create Bind-9.4.1-p1 rpm
I have bind-9.4.1-p1 tar file installed and running in a tmp directory. I want to create an RPM to move and install on another almost identical server (Same computer hardware OS). I was using the default .spec file that came with the bind tar file, but it didn't work. error: File ~/redhat/SOURCES/idnkit-1.0-rc1-src.tar.gz: No such file or directory I do not find that file anywhere on my system. Is there another spec file that is already created? thanks Dean ...

post xml payload with urllib
Has anyone sent an xml payload via post using urllib? I'd like to do something like this: logon_request = """<LoginRequest> <password>"the_password"</password> <user>"the_user"</user> </LoginRequest>""" logon = urllib.urlopen("https://127.0.0.1/api/version/xml", logon_request) print logon.read() logon.close() 127.0.0.1 expects xml via a https connection post. On Aug 14, 11:57 am, brad <byte8b...@gmail.com> wrote: > Has anyone sent an xml payload via post using urllib? Haven&...

Post hoc syntax
Hi, I'm wondering if anyone could tell me about syntax of post hoc(Sheffe)? I'm running 2-way ANCOVA and I wanted to controll for homosexuality in my data as I've got quite few gay population which is not my main interest. One of my IVs got 3 levels but I don't know the syntax for post hoc. I would really appreciate it if anyone can help me. Thanks. Hanah If you go to Help > Topic, in the "Index Tab", type in "UNIANOVA, command syntax", you should be able to find the syntax options there. Scheffe should be: /POSTHOC = effect...

posting 20050826
"Really," I said. "Doing what?" In the space of less than one week, Joshua has become the most requested dog in Los Angeles film. It was the Mighty Dog commercial that did it: Joshua n ailed it on the first take, no small feat in an industry where 30 seconds of animal action is often stitched out of twelve to fifteen hours of raw foota ge. This so stunned the director that he filmed the commercial twice just to cover his ass. Even with the extra take, the commercial was wrapped in two hours flat, saving the ad company about $200,000 in fees. The ad company tri ed to loc...

smp kernel source rpm
hi everyone, i'm running fedora core-5, 2.6.15-1.2054_FC5smp (i686) and would like to install kernel source tree but i wasn't able to find SMP rpm for that kernel release. there are a lot of source rpms but none with SMP support? what to do? thx. tektonac wrote: > hi everyone, > > i'm running fedora core-5, 2.6.15-1.2054_FC5smp (i686) and would like to > install kernel source tree but i wasn't able to find SMP rpm for that kernel > release. there are a lot of source rpms but none with SMP support? what to > do? > > thx. > > You wa...