]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
update-alternatives: Fix absolute symlink handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 May 2012 11:53:39 +0000 (12:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 May 2012 16:24:26 +0000 (17:24 +0100)
After the class changes, absolute symlinks are not being handled correctly
by the class file. This adds handling for absolute symlinks to account for the
pkgdest directory, removing dangling symlink messages from recipes like bzip2.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/update-alternatives.bbclass

index fce1e848f567b3bf86f919e1f13b8ebb18fa7ab2..9f2e59f5846ba604da9f1e076f849202f436361f 100644 (file)
@@ -247,7 +247,11 @@ python perform_packagecopy_append () {
                for alt_target in link_rename:
                        src = '%s/%s' % (pkgdest, alt_target)
                        dest = '%s/%s' % (pkgdest, link_rename[alt_target])
-                       link_target = os.path.join(os.path.dirname(src), os.readlink(src))
+                       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)
 
                        if os.path.lexists(link_target):
                                # Ok, the link_target exists, we can rename