summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiko Mauno <niko.mauno@iki.fi>2018-11-11 16:19:49 +0200
committerAlejandro del Castillo <alejandro.delcastillo@ni.com>2018-11-12 10:06:05 -0600
commit37f2ddb196a8bf33355cf82f182c57f3de6ef0a5 (patch)
treef8cd0609de52cb61c7dab217c5c58ca7a151fb26
parent0cd38bb1bdcdbfc091014a1f39d015a1586a33e6 (diff)
downloadopkg-utils-37f2ddb196a8bf33355cf82f182c57f3de6ef0a5.tar.gz
opkg-utils-37f2ddb196a8bf33355cf82f182c57f3de6ef0a5.tar.bz2
opkg-utils-37f2ddb196a8bf33355cf82f182c57f3de6ef0a5.zip
update-alternatives: Fix link relocation support
Commit fcb26339000021eb9bb711aa264247aebcfdd4ae which added Debian-style support for link relocation tries to relocate symbolic link on host OS, resulting in following-like error when two alternative packages have symbolic link source located in different directories (/bin/rev -> /bin/busybox.nosuid and /usr/bin/rev -> /usr/bin/rev.util-linux): update-alternatives: renaming rev link from /bin/rev to /usr/bin/rev mv: cannot stat '/bin/rev': No such file or directory Fix the issue by prefixing 'olink' and 'link' variable references with path to targeted root filesystem's root directory. Signed-off-by: Niko Mauno <niko.mauno@iki.fi> Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
-rw-r--r--update-alternatives2
1 files changed, 1 insertions, 1 deletions
diff --git a/update-alternatives b/update-alternatives
index 89a440b..d4fa7eb 100644
--- a/update-alternatives
+++ b/update-alternatives
@@ -58,7 +58,7 @@ register_alt() {
local link_str=`echo $link | protect_slashes`
sed -e "1s/.*/$link_str/" $ad/$name > $ad/$name.new
mv $ad/$name.new $ad/$name
- mv $olink $link
+ mv $OPKG_OFFLINE_ROOT$olink $OPKG_OFFLINE_ROOT$link
fi
else
echo "$link" > "$ad/$name"