Currently update-alternatives will create absolute symlinks to the
target files.
This leads to confusion when looking at the resulting rootfs directory
from the host machine and makes it impossible to do a diff between two
rootfs directories staged on the host.

Add a way to let it install relative symlinks only by adding
'alternatives-symlinks-relative' to DISTRO_FEATURES.

Signed-off-by: Robin Lintermann <[email protected]>
---
 meta/classes-recipe/update-alternatives.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes-recipe/update-alternatives.bbclass 
b/meta/classes-recipe/update-alternatives.bbclass
index b153e1b297..6cfb190c31 100644
--- a/meta/classes-recipe/update-alternatives.bbclass
+++ b/meta/classes-recipe/update-alternatives.bbclass
@@ -261,6 +261,8 @@ def update_alternatives_alt_targets(d, pkg):
             continue
 
         alt_target = os.path.normpath(alt_target)
+        if 
bb.utils.contains('DISTRO_FEATURES','alternatives-symlinks-relative',True,False,d):
+            alt_target = os.path.relpath(alt_target, os.path.dirname(alt_link))
         updates.append( (alt_name, alt_link, alt_target, alt_priority) )
 
     return updates
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#238055): 
https://lists.openembedded.org/g/openembedded-core/message/238055
Mute This Topic: https://lists.openembedded.org/mt/119612064/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to