blob: 9dc488b7aa86401a392d0b72a36b6bbb110b5174 [file] [log] [blame]
Brad Bishopa5c52ff2018-11-23 10:55:50 +13001From 18562ccae6996431d37767653b061d4e9e1b9424 Mon Sep 17 00:00:00 2001
2From: Niko Mauno <niko.mauno@iki.fi>
3Date: Sun, 11 Nov 2018 15:50:22 +0200
4Subject: [opkg-utils PATCH] update-alternatives: Fix link relocation support
5
6Commit fcb26339000021eb9bb711aa264247aebcfdd4ae which added Debian-style
7support for link relocation tries to relocate symbolic link on host OS,
8resulting in following-like error when two alternative packages have
9symbolic link source located in different directories (/bin/rev ->
10/bin/busybox.nosuid and /usr/bin/rev -> /usr/bin/rev.util-linux):
11
12 update-alternatives: renaming rev link from /bin/rev to /usr/bin/rev
13 mv: cannot stat '/bin/rev': No such file or directory
14
15Fix the issue by prefixing 'olink' and 'link' variable references with
16path to targeted root filesystem's root directory.
17
18Upstream-Status: Submitted [opkg-utils]
19
20Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
21---
22 update-alternatives | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/update-alternatives b/update-alternatives
26index 89a440b..d4fa7eb 100644
27--- a/update-alternatives
28+++ b/update-alternatives
29@@ -58,7 +58,7 @@ register_alt() {
30 local link_str=`echo $link | protect_slashes`
31 sed -e "1s/.*/$link_str/" $ad/$name > $ad/$name.new
32 mv $ad/$name.new $ad/$name
33- mv $olink $link
34+ mv $OPKG_OFFLINE_ROOT$olink $OPKG_OFFLINE_ROOT$link
35 fi
36 else
37 echo "$link" > "$ad/$name"
38--
392.19.1
40