Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46148 - dispatch-conf merge breaks when /tmp and /etc are on separate partitions
Summary: dispatch-conf merge breaks when /tmp and /etc are on separate partitions
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-03-29 11:14 UTC by Max Kalika (RETIRED)
Modified: 2004-08-20 08:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Kalika (RETIRED) gentoo-dev 2004-03-29 11:14:50 UTC
Trying to merge two configs using dispatch-conf.  Went through the whole thing and got a python traceback:

Traceback (most recent call last):
  File "/usr/sbin/dispatch-conf", line 272, in ?
    d.grind (portage.settings ['CONFIG_PROTECT'])
  File "/usr/sbin/dispatch-conf", line 153, in grind
    os.rename (merged, mrgconf)
OSError: [Errno 18] Invalid cross-device link

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.24-lsit-r1)

Here's a simple patch to fix this:

--- /tmp/dispatch-conf  2004-03-29 10:59:59.000000000 -0800
+++ /usr/sbin/dispatch-conf     2004-03-29 11:13:42.000000000 -0800
@@ -14,7 +14,7 @@
 #

 from stat import *
-import os, sys, string, re, commands
+import os, shutil, sys, string, re, commands
 sys.path = ["/usr/lib/portage/pym"]+sys.path

 import portage, dispatch_conf
@@ -150,7 +150,8 @@
                     merged = '/tmp/dispatch-conf.merged.%i' % (os.getpid (),)
                     print
                     os.system (MERGE % (merged, conf ['current'], newconf))
-                    os.rename (merged, mrgconf)
+                    shutil.copyfile (merged, mrgconf)
+                    os.unlink (merged)
                     mystat = os.lstat(conf['new'])
                     os.chmod(mrgconf, mystat[ST_MODE])
                     os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
Comment 1 Paul de Vrieze (RETIRED) gentoo-dev 2004-08-07 05:25:47 UTC
Could this be fixed, I think it is a rather silly requirement to require the /tmp partition to be the same one as the /etc partition
Comment 2 Brian Harring (RETIRED) gentoo-dev 2004-08-07 06:02:23 UTC
I'll correct it for the next .51_pre* release.
Got overlooked; it's not a req, it's an annoying gotcha w/ os.rename :)
Comment 3 Brian Harring (RETIRED) gentoo-dev 2004-08-07 06:13:18 UTC
In cvs now.  Will go out w/ the next .51 release.
Comment 4 Brian Harring (RETIRED) gentoo-dev 2004-08-16 11:18:23 UTC
Released in pre18.
Comment 5 Christer Ekholm 2004-08-20 08:52:21 UTC
I just got bitten by this, not fun at all. Especially since this has been known for quite some time now.

I think it's very unfortunate that this bug has been known for so long time, and a fix has still not been released.  I understand that there is a lot of changes pending for the next release, and therefore a quite long release-cycle is normal. But I think there should be made bugfix-releases to the current version. ( eg a 2.0.50-r10 )