Fedora Linux Support Community & Resources Center
  #1  
Old 17th December 2010, 11:35 AM
marcindulak Offline
Registered User
 
Join Date: Dec 2010
Posts: 2
linuxfirefox
about ordering of rpmbuild snippets again

Hi,

i have problems with the ordering of snippets in rpm -
namely that the postun part of the old RPM package is run after post of the new package
(see http://fedoraproject.org/wiki/Packag...iptletSnippets).
I need to provide an RPM that stream edits files which are not a part of any RPM.
When RPM uninstalled completely the initial state of the system must be restored
(and of course when updating the RPM package the files must be modified correctly).
This is clarified by the following example:
run postun_problem.sh as root - the final line of postun_problem.out is incorrectly "Release0".

The postun_problem.out looks currently like:
Code:
Preparing...                ##################################################
postun_problem              ##################################################
Applying Release 1
Release1
Preparing...                ##################################################
postun_problem              ##################################################
Applying Release 2
Package uninstalled: Going back to Release 0
Release0
How to modify postun_problem.spec to achieve the output of "Release2" when the package
is updated and "Release0" if the package is uninstalled?

Best regards,

Marcin
Attached Files
File Type: spec postun_problem.spec (509 Bytes, 57 views)
File Type: sh postun_problem.sh (720 Bytes, 54 views)
Reply With Quote
  #2  
Old 17th December 2010, 04:11 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 800
windows_xp_2003chrome
Re: about ordering of rpmbuild snippets again

I may be wrong, but can't you use a conditional check to see if it should execute?
Like, if [ $1 -lt 1 ]; then ... fi ? There are plenty of examples of this in existing rpms.
I don't recall the exact method they use offhand, I think the current nvidia ones may server.
Download the source rpm and check the spec.
Reply With Quote
  #3  
Old 20th December 2010, 10:19 AM
marcindulak Offline
Registered User
 
Join Date: Dec 2010
Posts: 2
linuxfirefox
Re: about ordering of rpmbuild snippets again

Thanks! Following your hint the solution to the problem is to use the postun section:

Code:
# Last removal
if [ $1 -eq 0 ]; then
    sed -i 's<Release.*<Release0<' /root/postun_problem.txt
    echo "Package uninstalled: Going back to Release 0"
fi
Reply With Quote
Reply

Tags
ordering, rpmbuild, snippets

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
f13 anaconda md device ordering Marcuccio Installation and Live Media 0 8th August 2010 03:46 PM


Current GMT-time: 13:18 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat