Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to find out if the user is unmerging or updating a pkg?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Hrk
Tux's lil' helper
Tux's lil' helper


Joined: 24 May 2003
Posts: 88
Location: Rome, Italy

PostPosted: Tue Feb 10, 2004 8:45 pm    Post subject: How to find out if the user is unmerging or updating a pkg? Reply with quote

Hi,

I'm writing an ebuild for Jakarta Tomcat 5(.0.18). Although I based myself on the existing ebuild for the 4.1.24, I don't like it very much and I would like to improve it.

My question does not relate strictly to Tomcat, though, as it can relate to any other package which benefits from having a custom user (e.g.: httpd, ftp, ...).

From what I have understood, when I unmerge a package, the pkg_postrm() of its ebuild is executed. In the ebuild for Tomcat 4.1.24 this is the place where tomcat user and group are deleted, as example.

When I update a package, it seems to me that the pck_postrm() of the previous version is issued after the src_install() of the new one. This is what happens when I update Tomcat from 4.1.24 to 5.0.18: tomcat user and group are not created during the pkg_setup() of the new (5.0.18) because they already exist, but then they are deleted at the end of pkg_postrm() of the old (4.1.24)!
This leaves me with an incorrect installation, since tomcat user and group no longer exist. I have to manually create them.

I wanted to know: is there a way for me (as in "ebuild writer") to know if pkg_postrm() has been called during an unmerge (so I remove everything) or during an update (so I don't touch what would be needed at the end of the install)?

Thank you :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum