When merging a package on FreeBSD, Portage runs into trouble if it tries to merge a symlink before the file it points to. The problem lies in the use of os.chown() instead of os.lchown, so the call to lchown() in movefile (portage.py, ~line 2475 as of 2.0.51_rc1) fails if the target file isn't present, as os.chown tries to follow the broken link. Suggested fix: modify portage_data.py to use os.lchown() instead of os.chown() on freebsd.
This was done explicitly for Mac and BSD... Is this section of code in portage_data wrong? (2.0.51) BSD people need to comment here. If python has lchown, is there a reason to not use it? if ostype=="Linux": userland="GNU" if "lchown" in dir(os): # Included in python-2.3 lchown=os.lchown else: import missingos lchown=missingos.lchown os.environ["XARGS"]="xargs -r" elif ostype in ["Darwin","FreeBSD","OpenBSD"]: userland="BSD" lchown=os.chown os.environ["XARGS"]="xargs" else: writemsg(red("Operating system")+" \""+ostype+"\" "+red("currently unsupported sys.exit(1)
IIRC, Stephen's latest portage/python snapshot includes python-2.3.4, so it should be safe to use os.lchown. If you don't, then you get errors like these: !!! failed to properly create symlink: !!! /lib/libhistory.so -> libhistory.so.4.3 i !!! [Errno 2] No such file or directory: '/lib/libhistory.so' !!! Failed to move file. !!! /lib/libhistory.so -> libhistory.so.4.3 This particular one is from sys-apps/readline-4.3-r5. I have run into several others that fail because of this as well, so I think it should definitely be changed.
Does missingos compile on freebsd?
carpaski, missingos builds fine and is installed.
This is taken care of for _rc7
Bug has been fixed and released in stable portages on or before 2.0.51-r2