Re: [PATCH] cygport install infinite loop when symlink in path

2020-07-13 Thread Doug Henderson via Cygwin-apps
On Mon, 13 Jul 2020 at 07:13, Brian Inglis <> wrote:

> src_postinstall(_prep_libtool_modules): infinite loop when symlink in path
> added readlink to also resolve symlinks in path to DEST host prefix
> ---
>  lib/src_postinst.cygpart | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Brian,

Please check that this patch works properly when
CYGWIN=winsymlinks:nativestrict

I have encountered problems when running cygport with this setting due to
the different behavior of unix symlinks and windows symlinks vis-a-vis
attempting to create a symlink that points to a non-existent location. [
https://cygwin.com/cygwin-ug-net/using-cygwinenv.html]

My simplistic solution was to force CYGWIN=winsymlinks.native in the
.cygport file.

Thanks,
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com


[PATCH] cygport install infinite loop when symlink in path

2020-07-13 Thread Brian Inglis
src_postinstall(_prep_libtool_modules): infinite loop when symlink in path
added readlink to also resolve symlinks in path to DEST host prefix
---
 lib/src_postinst.cygpart | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 68381a0..091994a 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -1293,8 +1293,10 @@ __prep_libtool_modules() {
mv ${ltlibdir}/${dlname} 
${D}/usr/${CTARGET}/sys-root/$(__target_prefix)/bin/
else
origdlname=${dlname}
+   # do full symlink resolution on both 
paths compared to avoid issues
+   local dest_prefix=$(readlink -f 
${D}$(__host_prefix))
 
-   while [ $(readlink -f 
${ltlibdir}/${dlname%/bin/*}) != ${D}$(__host_prefix) ]
+   while [ $(readlink -f 
${ltlibdir}/${dlname%/bin/*}) != $dest_prefix ]
do
dlname=../${dlname}
done
-- 
2.27.0