Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Mark Hatle <mark.hatle@windriver.com>,
	openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] update-alternatives: Fix absolute symlink handling
Date: Wed, 30 May 2012 12:53:39 +0100	[thread overview]
Message-ID: <1338378819.20169.125.camel@ted> (raw)

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>
---
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index fce1e84..9f2e59f 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -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





                 reply	other threads:[~2012-05-30 12:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338378819.20169.125.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox