[patch] cygport-0.2.7 tool for generating relative symlinks

Charles Wilson cygwin@cwilson.fastmail.fm
Sat Jan 6 05:04:00 GMT 2007


Split out from my relocatable patch, because I think this is a useful 
tool for other (non-relocatable) cygports.  Because the patch creates a 
new script, after applying the patch, don't forget to:
   (1) chmod +x bin/dorelsym
   (2) cvs add bin/dorelsym

What it does:

dorelsym creates symlink to install path but attempts to make the paths 
relative. For example:
    dorelsym ${D}/usr/share/terminfo ${D}/usr/lib/terminfo
will do
    (cd ${D}/usr/lib && ln -fs ../share/terminfo terminfo)

This is important when variables appear in both the target and symlink 
names, and you don't know the true relative path a priori.

 From the script's own comments:
#   dosym ../share/terminfo ${D}/usr/lib/terminfo
# will work when you know the relative paths a priori, but
# not in the following case:
#   dosym ${D}${DATADIR}/mytarget ${D}${PREFIX}/bin/mysymlink
# because you don't know the relative path from ${PREFIX}/bin
# to ${DATADIR}.  That's what dorelsym is for -- it compares
# the actual values of target and symlink, computes the common
# prefix, and derives the relative path from (dir_of_symlink)
# to (target).


2007-01-05 Charles Wilson <...>

	* bin/dorelsym: new file.
	* bin/Makefile.am: add new file dorelsym

--
Chuck
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygport-dorelsym.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070106/f8fdc06f/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list