Patchwork [3/3] update-alternatives.bblcass: use oe.path.realpath()

login
register
mail settings
Submitter Enrico Scholz
Date Feb. 10, 2013, 12:41 p.m.
Message ID <ae22af091a391b9b763a849515b3770fbe90dfcf.1360499939.git.enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/44421/
State Accepted
Commit 2fa5cc0d08e855e24a4497601d7cc73b9f2aa550
Headers show

Comments

Enrico Scholz - Feb. 10, 2013, 12:41 p.m.
oe.path.realpath() provides are common and more correct implementation
for resolving symlinks within sysroot. Use it.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 meta/classes/update-alternatives.bbclass | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch

diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index 8f4d097..0cefc51 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -261,10 +261,7 @@  python perform_packagecopy_append () {
             src = '%s/%s' % (pkgdest, alt_target)
             dest = '%s/%s' % (pkgdest, link_rename[alt_target])
             link = os.readlink(src)
-            if os.path.isabs(link):
-                link_target = pkgdest + os.readlink(src)
-            else:
-                link_target = os.path.join(os.path.dirname(src), link)
+            link_target = oe.path.realpath(src, pkgdest, True)
 
             if os.path.lexists(link_target):
                 # Ok, the link_target exists, we can rename