[arch-dev-public] [core] packages and install scripts
Hi, I thought this might be interesting for everyone, so I send a mail here instead of filing a bug report. If you are using install scripts in your packages, make sure the commands you are calling are actually installed before by adjusting your dependencies. Alternatively it might be needed to test if a certain command is available and silently abort if it is not. I found this issue in the iputils install script which fails on a new install as the vercmp command is not found: if [ "$(vercmp $2 20101006-3)" -le 0 ]; then echo " >> Traceroute is now provided by core/traceroute" fi This might be new for some of us, but yes: vercmp is part of the pacman package, but before this is available in a new install 94 other packages get installed, among these is iputils. In general these issues can be solved by adding the needed dependencies to the package. But you need to be really careful to avoid circular or other insane dependencies. In this case adding pacman as a dependency is a bad idea. I would suggest to either remove this statement completely as it just adds useless noise or at least check if vercmp is available; if not we can assume no previous version of iputils was installed. These issues usually affect only packages in [core], especially those in the base group. A new Arch install is created by extracting those packages into an almost empty directory. That's why their install scripts cannot assume anything that is not listed in their dependencies is available yet. Greetings, Pierre -- Pierre Schmitz, https://pierre-schmitz.com
On 04/10/12 16:03, Pierre Schmitz wrote:
In this case adding pacman as a dependency is a bad idea. I would suggest to either remove this statement completely as it just adds useless noise or at least check if vercmp is available; if not we can assume no previous version of iputils was installed.
Umm... the vercmp check is actually completely useless as it does "vercmp $2 <ver>" and there is no $2 in post_install... it should be in post_upgrade only. Allan
Am 04.10.2012 08:12, schrieb Allan McRae:
On 04/10/12 16:03, Pierre Schmitz wrote:
In this case adding pacman as a dependency is a bad idea. I would suggest to either remove this statement completely as it just adds useless noise or at least check if vercmp is available; if not we can assume no previous version of iputils was installed.
Umm... the vercmp check is actually completely useless as it does "vercmp $2 <ver>" and there is no $2 in post_install... it should be in post_upgrade only.
Yes, totally missed that. Of course a vercmp call can only be useful in post_upgrade and *_remove. -- Pierre Schmitz, https://pierre-schmitz.com
Le 2012-10-04 02:20, Pierre Schmitz a écrit :
In this case adding pacman as a dependency is a bad idea. I would suggest to either remove this statement completely as it just adds useless noise or at least check if vercmp is available; if not we can assume no previous version of iputils was installed. Umm... the vercmp check is actually completely useless as it does "vercmp $2 <ver>" and there is no $2 in post_install... it should be in
On 04/10/12 16:03, Pierre Schmitz wrote: post_upgrade only. Yes, totally missed that. Of course a vercmp call can only be useful in
Am 04.10.2012 08:12, schrieb Allan McRae: post_upgrade and *_remove.
Thank you Pierre and Allan for pointing this. Since the separation of traceroute was done several months ago, I will just remove the message and will keep these informations in mind for the future. Regards, Stéphane
On do, 2012-10-04 at 08:10 -0400, Stéphane Gaudreault wrote:
Thank you Pierre and Allan for pointing this. Since the separation of traceroute was done several months ago, I will just remove the message and will keep these informations in mind for the future.
Besides that, suggesting packages could also be done with optdepends.
participants (4)
-
Allan McRae
-
Jan de Groot
-
Pierre Schmitz
-
Stéphane Gaudreault