This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Re: Changing symlinks from

>On Tue, Feb 11, 2003 at 01:05:06PM -0000, Christopher January wrote:
>> How can I automatically convert all symlinks on my Cygwin filesystem
>> the "!<symlink>" format to windows shortcuts? Samba doesn't seem to
>> maintain the correct permissions for the Cygwin DLL to detect the
>> "!<symlink>" files as symlinks, so they are treated as regular files
>> (hence the errors with gcc, etc. I was seeing). Thanks Chris and others
>> for pointing me in the right direction to diagnose this. I now need a
>> of converting all those symlink files to windows shortcuts so I can use
>> Cygwin at college.
>> Chris
>Write a script which reads the content of the symlink, then removes the
>old one and eventually recreates it.  The resulting symlink will have the
>appropriate format according to the CYGWIN env. var.  Sth like this
>  for i in `find / -type l`
>  do
>    TARGET=`ls -l $i | awk '{print $NF;}'`
>    rm $i
>    ln -s $TARGET $i
>  done
For the record, the script I used was:
#!/usr/bin/env bash
echo "here=$PWD"
grep -r -l '^\!<symlink>\(.*\)\x00' / | while read -r file;
	dir="`dirname "$file"`"
	file="`basename "$file"`"
	cd $dir
	dest="`sed 's/\!<symlink>\(.*\)\x00/\1/g' "$file"`"
	rm $file
	ln -s $dest $file
	cd $here

Now I can run gcc hopefully I can patch Cygwin to run at a tolerable speed
on this setup!


Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]