public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH cygport] pkg_info.cygpart: Do not detect dependencies on itself in ruby package
@ 2024-02-16 12:51 Daisuke Fujimura
  2024-03-10 13:34 ` Jon Turney
  0 siblings, 1 reply; 5+ messages in thread
From: Daisuke Fujimura @ 2024-02-16 12:51 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

Attempting to create a package for ruby-3.3, but it fails when trying
to detect a dependency on itself.

To avoid this, skip them if the target is `ruby`.

[-- Attachment #2: pkg_info-for-ruby.diff --]
[-- Type: application/octet-stream, Size: 1706 bytes --]

diff --git a/lib/pkg_info.cygpart b/lib/pkg_info.cygpart
index 37cfa676..9cd7d06b 100644
--- a/lib/pkg_info.cygpart
+++ b/lib/pkg_info.cygpart
@@ -557,7 +557,7 @@ for suffix, mode, type in imp.get_suffixes(): print(suffix)')
 		done
 	done
 
-	if check_prog ruby
+	if [ "${PN}" != "ruby" ] && check_prog ruby
 	then
 		rbdirs=($(ruby -e 'print($:.join(" "))'))
 		rbdirs+=" ${DEPS_PATH//:/ }"
@@ -597,19 +597,19 @@ for suffix, mode, type in imp.get_suffixes(): print(suffix)')
 				done
 			done
 		done
-	fi
 
-	rbver=( $(find "${@//^_^/ }" -path "usr/*/ruby/vendor_ruby/[0-9].[0-9]/*" \
-	        | sed -E 's!usr/.*/ruby/vendor_ruby/([0-9]).([0-9])/.*!ruby_\1\2!' \
-	        | sort -ru) )
-	if [ "${#rbver[@]}" -gt 1 ]
-	then
-		warning "More than one targeted Ruby version: ${rbver[*]},"
-		warning "using only the latest as dependency: ${rbver[0]}."
-	fi
-	if [ "${#rbver[@]}" -gt 0 ] && [ "${PN}" != "ruby" ]
-	then
-		echo "${rbver[0]}"
+		rbver=( $(find "${@//^_^/ }" -path "usr/*/ruby/vendor_ruby/[0-9].[0-9]/*" \
+				| sed -E 's!usr/.*/ruby/vendor_ruby/([0-9]).([0-9])/.*!ruby_\1\2!' \
+				| sort -ru) )
+		if [ "${#rbver[@]}" -gt 1 ]
+		then
+			warning "More than one targeted Ruby version: ${rbver[*]},"
+			warning "using only the latest as dependency: ${rbver[0]}."
+		fi
+		if [ "${#rbver[@]}" -gt 0 ]
+		then
+			echo "${rbver[0]}"
+		fi
 	fi
 
 	if [ $(find "${@//^_^/ }" -path 'usr/share/doc/*' -prune \
@@ -661,7 +661,7 @@ for suffix, mode, type in imp.get_suffixes(): print(suffix)')
 		cygruby[0-9][0-9]0.dll)
 		    rbver="${dll##*cygruby}"
 		    rbver="${rbver%%0.dll}"
-		    echo "ruby_${rbver}"
+		    [ "${PN}" != "ruby" ] && echo "ruby_${rbver}"
 		    ;;
 	    esac
 	done

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-24 13:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 12:51 [PATCH cygport] pkg_info.cygpart: Do not detect dependencies on itself in ruby package Daisuke Fujimura
2024-03-10 13:34 ` Jon Turney
2024-04-03 14:18   ` Daisuke Fujimura
2024-05-06 14:12     ` Jon Turney
2024-05-24 13:35       ` Daisuke Fujimura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).