Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 225821 (abssymlink)

Summary: file: pym/protage/__init__.py function: abssymlink
Product: Portage Development Reporter: zy <goodmenzy>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: High    
Version: 2.2   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 459934    

Description zy 2008-06-11 01:37:22 UTC
in file pym/portage/__init__py,
line 184, the function abssymlink seem not confront it's description 
the return value is not a absolute path when the symlink param is in corrent dir

I think it should use os.path.abspath() to get the result

Here is my suggestion version:
# ====================================================================
def abssymlink(symlink):
	"This reads symlinks, resolving the relative symlinks, and returning the absolute."
	mylink=os.readlink(symlink)
	if mylink[0] != '/':
            # mydir=os.path.dirname(symlink)
            mydir = "."
            mylink=mydir+"/"+mylink
        # return os.path.normpath(mylink)
        return os.path.abspath(mylink)
# ====================================================================

any comment ?
Comment 1 zy 2008-06-11 07:03:31 UTC
no reply ?
maybe this info is posted in the wrong place..................
Comment 2 Zac Medico gentoo-dev 2008-06-11 07:59:55 UTC
It's in the right place. The thing is, that function is only used in one place and it's in the merge code which happens to be extremely critical. Please just give us some time to review your patch.
Comment 3 Zac Medico gentoo-dev 2013-02-15 22:35:32 UTC
I'd prefer not to change the behavior, so instead I've updated the docs:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d6dd49ff7fd6308127474064bccec03b3442f9b5
Comment 4 Zac Medico gentoo-dev 2013-03-02 04:30:21 UTC
This is fixed in 2.1.11.53 and 2.2.0_alpha164.