Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc-4.7.3 file collision - how should I handle? [SOLVED]
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
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 924
Location: US-FL-EST

PostPosted: Mon May 20, 2013 12:25 am    Post subject: gcc-4.7.3 file collision - how should I handle? [SOLVED] Reply with quote

In attempting to do an 'emerge @world' on my old, decrepit 32-bit {x86} system, the emerge of gcc-4.7.3 fails for a file collision:
Code:
 * Detected file collision(s):
 *
 *      /usr/lib32/security/classpath.security
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
 * sys-devel/gcc-4.6.3:4.6::gentoo
 *      /usr/lib32/security/classpath.security
 *
 * Package 'sys-devel/gcc-4.7.3' NOT merged due to file collisions.

This really annoys as the emerge itself has run to completion after more than a handful of hours and is in the process of installing the new files.

My usual in a case like this would be to 'emerge -C {old offending version}' and immediately 'emerge {new wanted version}'. However, it's not good to mess with the toolchain and deleting 'gcc' will break everything!

So .. how should I handle this?

Note that none of my other systems failed to emerge gcc-4.7.3. Just this 1 {of 7 systems}.
_________________
People whom think M$ is mediocre, don't know the half of it.


Last edited by dufeu on Sun May 26, 2013 1:58 am; edited 1 time in total
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Mon May 20, 2013 3:00 am    Post subject: Reply with quote

First, you might try building the new gcc with -B to build a binary package but not install. You should be able to move the colliding file and install the new binary package with emerge -ku gcc. Instead of removing your old gcc, I would move the file in between emerges so as not to irreparably damage the old gcc, just in case. Since gcc will not be needed to install the new version, it should work.

I should note that I have not tested this, but I believe it should work in theory.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 924
Location: US-FL-EST

PostPosted: Mon May 20, 2013 6:53 am    Post subject: Reply with quote

The Doctor wrote:
.. but I believe it should work in theory.

Now that you pointed it out, I agree with you. It should, in theory, definitely work. I'll try this is a few days when I have access again to this computer. I'll report back the results then.

Thanks for the tip!
_________________
People whom think M$ is mediocre, don't know the half of it.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Mon May 20, 2013 11:48 am    Post subject: Reply with quote

Note that .tbz2 binpkgs can be simply untarred to root as well. ie:
Code:
tar xvf "$PKGDIR/sys-devel/gcc-X.Y.Z.tbz2" -C /
You will see a warning about some extra stuff at the end: that's normal (it's the binpkg metadata.)

The format was designed so that you can do that in emergency situations, including when emerge or gcc is broken (so long as your tar is still functioning: if not use a live disk and -C /mnt/gentoo after mounting all your partitions.) You can also open the tarballs in a file-browser like dolphin or konqueror to see what's in there, and copy files out.

The above makes using FEATURES=buildpkg more attractive, since you are guaranteed to be able to rollback packages (you should bring your system up-to-date immediately after.)
Back to top
View user's profile Send private message
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 924
Location: US-FL-EST

PostPosted: Sun May 26, 2013 1:57 am    Post subject: Reply with quote

I did the following:
Code:
~ # emerge -B =sys-devel/gcc-4.7.3
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) sys-devel/gcc-4.7.3
>>> Jobs: 1 of 1 complete                           Load avg: 1.02, 1.11, 1.12

~ # cd /usr/lib32/security/

security # ls -l
total 4
-rw-r--r-- 1 root root 2489 Jan 26 11:51 classpath.security

security # mv classpath.security classpath.security.gcc-4.6.3

security # emerge -1ku =gcc-4.7.3
Calculating dependencies... done!
>>> Emerging binary (1 of 1) sys-devel/gcc-4.7.3
>>> Installing (1 of 1) sys-devel/gcc-4.7.3
>>> Jobs: 1 of 1 complete                           Load avg: 1.08, 0.62, 0.29

 * Messages for package sys-devel/gcc-4.7.3:

 * If you have issues with packages unable to locate libstdc++.la,
 * then try running 'fix_libtool_files.sh' on the old gcc versions.
 * You might want to review the GCC upgrade guide when moving between
 * major versions (like 4.2 to 4.3):
 * http://www.gentoo.org/doc/en/gcc-upgrading.xml
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

security # gcc-config -l
 [1] i686-pc-linux-gnu-4.6.3 *
 [2] i686-pc-linux-gnu-4.7.3

security # gcc-config 2
 * Switching native-compiler to i686-pc-linux-gnu-4.7.3 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                  [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   . /etc/profile

security # . /etc/profile

security # emerge --depclean gcc

Calculating dependencies... done!
>>> Calculating removal order...

 sys-devel/gcc
    selected: 4.6.3
   protected: none
     omitted: 4.7.3

All selected packages: sys-devel/gcc-4.6.3

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in:  5 4 3 2 1
>>> Unmerging (1 of 1) sys-devel/gcc-4.6.3...
Packages installed:   1308
Packages in world:    85
Packages in system:   42
Required packages:    1308
Number removed:       1

 * Regenerating GNU info directory index...

As you can see, it worked like a charm.

It left me confused and this system seems to be running and emerging further packages correctly. But it still left me confused.

On this system, gcc-4.7.3 did not install a 'classpath.security' file anywhere. Apparently, if such a file doesn't already exist {and re-naming it made it invisible as far as the gcc-4.7.3 installation process is concerned}, then a replacement file isn't created. Just a guess of course. I know nothing!

Thank you for your help!
_________________
People whom think M$ is mediocre, don't know the half of it.
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