From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 Description of problem: symlinks -c changes absolute links to relative ones. One would expect that the new links would be as short as possible, ie. that a absolute link to a file in the same directory would be changed to a relative symlink directly pointing to the file, not to ../../../../<root>/...../<current dir>/file. But it doesn't work so, so at least the -s (shorten) should resolve that. And it does, but only for already relative links. symlinks -sc does the shortening before the conversition to relative link. Version-Release number of selected component (if applicable): 1.2-18 How reproducible: Always Steps to Reproduce: 1. mkdir -p /tmp/`seq -s/ 1 10` 2. cd !!:2 3. touch a 4. ln -s `pwd`/a b 5. symlinks -sc . 6. symlinks -sc . Actual Results: 5. the symlink b gets changed to '../../../../../../../../../../../tmp/1/2/3/4/5/6/7/8/9/10/a' 6. the previous symlink is changed to 'a' Expected Results: at 5. the symlink should have been changed to 'a', so that the 6. step wouldn't be required Additional info: This is easily fixed calling shorten_path always after fix_abs: diff -ur symlinks-1.2.old/symlinks.c symlinks-1.2/symlinks.c --- symlinks-1.2.old/symlinks.c 2003-04-25 15:59:32.000000000 +0100 +++ symlinks-1.2/symlinks.c 2003-04-25 16:20:15.000000000 +0100 @@ -235,6 +235,7 @@ strcpy (np, tail); (void) tidy_path(new); } + shorten_path(new, path); if (!testing) { if (unlink (path)) { perror(path);
Patch is added in -20 or newer to be soon in rawhide. Thanks for this bug-report, Florian La Roche