os.path.commonprefix(["/ab","/ac"]) returns '/a',
so, something like the following patch would be applied:
--- gxpbin/xmake 18 Sep 2009 15:44:13 -0000 1.44
+++ gxpbin/xmake 25 Sep 2009 10:38:30 -0000
@@ -1185,7 +1185,7 @@
# say real_from_dir = /a/b/x/y
real_from_dir = os.path.realpath(from_dir)
# common = /a/b/
- common = os.path.commonprefix([real_f, real_from_dir])
+ common = os.path.dirname(os.path.commonprefix([real_f, real_from_dir]))
d = real_f
base = ""
# we then compute path from common -> f (i.e., d/e/f part)