Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: andyj on October 28, 2017, 11:58:38 AM

Title: Busybox 1.27 mv broken
Post by: andyj on October 28, 2017, 11:58:38 AM
Busybox 1.25 (TC 8.0) mv would move all files in a wildcard source including links good or broken. Busybox 1.27 (TC 8.1+) mv will not move a link if it is broken. This is a bit of a challenge when building extensions because sometimes the link in the extension won't be good until the extension is installed. GNU mv on a distro like Slackware moves all links good and broken. Seems like mv changed for some reason?
Title: Re: Busybox 1.27 mv broken
Post by: Juanito on October 29, 2017, 01:31:15 AM
Could you give an example - I just tried a quick test and was able to move a broken link?
Title: Re: Busybox 1.27 mv broken
Post by: andyj on October 29, 2017, 08:55:33 AM
Try:

Code: [Select]
mkdir -p /tmp/mvtest/TCZ/usr/local/lib /tmp/mvtest/TCZ-dev/usr/local/lib
cd /tmp/mvtest/TCZ-dev/usr/local/lib
touch libmy.so.1.0.1
ln -s libmy.so.1.0.1 libmy.so.1
ln -s libmynolink.so libmy.so
cd /tmp/mvtest
mv TCZ-dev/usr/local/lib/*.so* TCZ/usr/local/lib
find

If it matters this is 64 bit.
Title: Re: Busybox 1.27 mv broken
Post by: curaga on October 29, 2017, 02:26:04 PM
Confirmed, but this is actually an ash bug. Running your script under bash succeeds.
Title: Re: Busybox 1.27 mv broken
Post by: andyj on October 29, 2017, 04:55:05 PM
But this used to work in Busybox/ash 1.25 (TC 8.0) and before. "type mv is /bin/mv" which is still Busybox. The behavior changed. It didn't used to be a bug, or it would have been a problem before I upgraded past 8.0.
Title: Re: Busybox 1.27 mv broken
Post by: Juanito on October 30, 2017, 02:53:00 AM
There have been few recent changes to mv in busybox git (5 this year), whereas there have been a bunch of changes to ash..

Could you submit a bug report to busybox?
Title: Re: Busybox 1.27 mv broken
Post by: curaga on October 30, 2017, 05:08:34 AM
I sent an email. This is also something we can fix with a config change, by disabling the "ash: use glob from libc" option.

And yeah, the bug was introduced after 1.25. Ash is part of busybox.
Title: Re: Busybox 1.27 mv broken
Post by: Juanito on October 30, 2017, 06:54:50 AM
Meaning "CONFIG_ASH_INTERNAL_GLOB=y"?
Title: Re: Busybox 1.27 mv broken
Post by: curaga on October 30, 2017, 03:05:26 PM
Yeah, that one.