All of lore.kernel.org
 help / color / mirror / Atom feed
* [opkg-utils PATCH] update-alternatives: Fix link relocation support
@ 2018-11-11 14:19 Niko Mauno
  2018-11-12 16:08 ` [opkg-devel] " Alejandro Del Castillo
  0 siblings, 1 reply; 2+ messages in thread
From: Niko Mauno @ 2018-11-11 14:19 UTC (permalink / raw)
  To: opkg-devel, yocto

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>
---
 update-alternatives | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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"
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [opkg-devel] [opkg-utils PATCH] update-alternatives: Fix link relocation support
  2018-11-11 14:19 [opkg-utils PATCH] update-alternatives: Fix link relocation support Niko Mauno
@ 2018-11-12 16:08 ` Alejandro Del Castillo
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Del Castillo @ 2018-11-12 16:08 UTC (permalink / raw)
  To: opkg-devel, Niko Mauno, yocto

good catch, thanks for the fix!

merged

On 11/11/18 8:19 AM, Niko Mauno wrote:
> 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>
> ---
>   update-alternatives | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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"
> 

-- 
Cheers,

Alejandro

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-12 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-11 14:19 [opkg-utils PATCH] update-alternatives: Fix link relocation support Niko Mauno
2018-11-12 16:08 ` [opkg-devel] " Alejandro Del Castillo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.