Paul Jarc wrote:
Brendan Byrd/SineSwiper <[EMAIL PROTECTED]> wrote:

[EMAIL PROTECTED]:~/tmp/a> mv -s b/f .
mv: `b/f': can make relative symbolic links only in current directory

Does "mv -s b/f b/.." work?

[EMAIL PROTECTED]:~/tmp/a> mv -s b/f b/.. mv: `b/f': can make relative symbolic links only in current directory [EMAIL PROTECTED]:~/tmp/a> mv b/f . [EMAIL PROTECTED]:~/tmp/a> cp -s f b cp: `b/f': can make relative symbolic links only in current directory [EMAIL PROTECTED]:~/tmp/a> mv f b [EMAIL PROTECTED]:~/tmp/a> cp -s b/f b/e cp: `b/e': can make relative symbolic links only in current directory [EMAIL PROTECTED]:~/tmp/a>

No, it doesn't work, but it doesn't work with "cp -s" either.

> If not, I'd think that case (where the
destination starts with all the same path components as the source
file, up to the source's basename) could be made to work without too
much extra effort.  It would be equivalent to:
cd "$(dirname "$1")" && mv -s "$(basename "$1")" "${$2/$(dirname "$1")/}"

Maybe, but I'm not sure how to code this in the subroutine. (Sorry, this was mostly a copy&paste job, and C isn't exactly my forte.)


I think my main point is that this is not a serious limitation, or at least one that was never brought up until now. It's apparently been in the copy.c code for eons. There must be some reason for this limitation to be put in place since somebody spend some amount of time writing a somewhat complex routine JUST to check for a non-current directory condition.

If we are to remove this check, we need to figure out the reason for the check, see if it applies now, or see if there's a fix for it. I understand the need for the fix, though I'm hesistant to apply it until we can check to see if the author of the original copy.c code (for the "-s" patch) found some odd case that we don't know about. (Any notes in the CVS history during this patch?)

I think it might be better to keep the check in place for now, and use a second patch to fix the other problem, since it also exists in copy.c. I'll create another ML thread for this.

BTW, were there any other problems with the patch?

--
Brendan Byrd/SineSwiper <[EMAIL PROTECTED]>
Computer techie, Perl hacker, and all-purpose Internet guru
Resonator Software (http://www.ResonatorSoft.org/)


_______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to