[PATCH] cygport install infinite loop when symlink in path

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Sat Jul 11 04:14:10 GMT 2020


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



More information about the Cygwin-patches mailing list