Port insists on installing gcc40 during upgrade

Ryan Schmidt ryandesign at macports.org
Wed Jun 20 03:31:46 PDT 2007


On Jun 19, 2007, at 18:55, Denis Bueno wrote:

> Of the gcc packages, I only have gcc42 installed:
>
>     $ sudo port installed | grep gcc
>     gcc42 @4.2.0_0+darwin_8 (active)
>
> According to port, gcc40 has no dependents (I just selfupdate'd and  
> sync'd):
>
>     $ sudo port dependents gcc40
>     gcc40 has no dependents!
>
> Imagine my surprise, then, when I find that:
>
>     $ sudo port -v upgrade installed
>     --->  Fetching gcc40
>     --->  gcc-core-4.0.4.tar.bz2 doesn't seem to exist in
> /opt/local/var/db/dports/distfiles/gcc40
>     --->  Attempting to fetch gcc-core-4.0.4.tar.bz2 from
> ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.0.4/
>
> And it proceeds to compile gcc40.
>
> Clearly I am misunderstanding dependents (or misunderstanding just  
> how ports
> decides when to install a package).  The gcc40 compile fails, too, but
> that's less of a problem (though still obviously a problem).

gcc40 is old and I'm trying to get all ports that still depend on it  
to switch to gcc42. For example, here's the ticket I filed for octave:

http://trac.macosforge.org/projects/macports/ticket/12144

Out of curiosity: are you on Intel or PowerPC? I know gcc < 4.2 will  
not build on Intel...

> After rooting around the Trac bug list, the ticket at
> http://trac.macports.org/projects/macports/ticket/12000 seems to be my
> problem.  (I have octave 2.9.9 installed.)  The root cause appears  
> to have
> been judged as upgrading not taking variants into account.  There  
> is a patch
> which purports to fix this behavior; is this likely to be  
> incorporated soon?

I assigned bug 12000 to the person who submitted the patch, who has  
recently gained commit access. Hopefully he can take care of it.

In the mean time, upgrade ports selectively. First of all, you  
probably don't ever want "port upgrade installed"; you probably only  
ever might want "port upgrade outdated" and I personally shy away  
from even that. I just look at the output of "port outdated" to see  
what's outdated, then I upgrade each port individually, in the  
correct dependency order, by using "port -ncuf upgrade foo". The -n  
is probably the operative switch: it says not to follow dependencies,  
which would mean in your case that it wouldn't follow the incorrectly- 
interpreted gcc40 dependency.

Then again, using -n would prevent any newly-added dependencies from  
being installed, which would be bad. So only use -n if you need to.






More information about the macports-users mailing list