Re: [Fink-devel] PostRmScript does it job after upgrading - sequence is wrong

2006-12-07 Thread Murali Vadivelu
Very simple! I should have figured it out myself. Many thanks though.


On 6 Dec 2006, at 16:09, Benjamin Reed wrote:

> Murali Vadivelu wrote:
>
>> The annoying thing about the the functioning of the script is that  
>> it  gets executed after dpkg replaces the old programme by the new  
>> one,  after an 'update ccpnmr-xx-xx' comand or 'update-all'  
>> command. This  leaves the user with no installation of the  
>> programme! The only way  to make it work is to first remove the  
>> old version and the freshly  install the new version.
>> Is this a dpkg bug, and if it is can a shotgun fix be added to  
>> fink  to execute fink remove and fink install, sequentially,  
>> instead of  whatever is happening now in the direct (overwrite?)  
>> upgrade that is  happening now.
>
> dpkg passes an argument to the script telling you what it's doing.   
> If you only want to do something if it's being fully removed, you  
> need to do:
>
> if [ "$1" != "upgrade" ]; then
>   # do stuff
> fi
>
> -- 
> Benjamin Reed a.k.a. Ranger Rick
> Fink, KDE, and Mac OS X development
> http://www.racoonfink.com/


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] PostRmScript does it job after upgrading - sequence is wrong

2006-12-06 Thread Daniel Macks
On Wed, Dec 06, 2006 at 03:55:31PM +, Murali Vadivelu wrote:
> Dear Developers,
> 
> I am a maintainer for a programme, CcpNmr, which installs minor  
> updates, like Webmin, to its point release through the user  
> interface. Hence, when an upgrade is made, from one point release to  
> another, dpkg does not remove the directory. To clear it up, I have a  
> PostRmScript.
> 
> The annoying thing about the the functioning of the script is that it  
> gets executed after dpkg replaces the old programme by the new one,  
> after an 'update ccpnmr-xx-xx' comand or 'update-all' command. This  
> leaves the user with no installation of the programme! The only way  
> to make it work is to first remove the old version and the freshly  
> install the new version.
> 
> Is this a dpkg bug, and if it is can a shotgun fix be added to fink  
> to execute fink remove and fink install, sequentially, instead of  
> whatever is happening now in the direct (overwrite?) upgrade that is  
> happening now.

The "official" word on what dpkg should be doing regarding when and
how each of the {Pre,Post}{Inst,Rm} scripts is explained here:

  http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

Perhaps you want this as a PreRm not PostRm, so that it happens before
the old package gets rm'ed?

dan

-- 
Daniel Macks
[EMAIL PROTECTED]
http://www.netspace.org/~dmacks


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] PostRmScript does it job after upgrading - sequence is wrong

2006-12-06 Thread Benjamin Reed
Murali Vadivelu wrote:

> The annoying thing about the the functioning of the script is that it  
> gets executed after dpkg replaces the old programme by the new one,  
> after an 'update ccpnmr-xx-xx' comand or 'update-all' command. This  
> leaves the user with no installation of the programme! The only way  
> to make it work is to first remove the old version and the freshly  
> install the new version.
> 
> Is this a dpkg bug, and if it is can a shotgun fix be added to fink  
> to execute fink remove and fink install, sequentially, instead of  
> whatever is happening now in the direct (overwrite?) upgrade that is  
> happening now.

dpkg passes an argument to the script telling you what it's doing.  If 
you only want to do something if it's being fully removed, you need to do:

if [ "$1" != "upgrade" ]; then
# do stuff
fi

-- 
Benjamin Reed a.k.a. Ranger Rick
Fink, KDE, and Mac OS X development
http://www.racoonfink.com/

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel