<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/1849e0fdca5a5101f65626e8320cb272cb4a3b84">https://github.com/macports/macports-ports/commit/1849e0fdca5a5101f65626e8320cb272cb4a3b84</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 1849e0fdca5a5101f65626e8320cb272cb4a3b84
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Sun Nov 4 18:34:42 2018 +0000
<span style='display:block; white-space:pre;color:#404040;'> java PortGroup: Add fallback JDK dependency to be installed if requested JDK is not found
</span>---
_resources/port1.0/group/java-1.0.tcl | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/java-1.0.tcl b/_resources/port1.0/group/java-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index a7b144d..d8fdbd0 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/java-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/java-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,10 +18,11 @@
</span> #
# If the required Java cannot be found, an error will be thrown at pre-fetch.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-options java.version java.home
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options java.version java.home java.fallback
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-default java.version {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-default java.home {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default java.version {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default java.home {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default java.fallback {}
</span>
# allow PortGroup to be used inside a variant (e.g. octave)
global java_version_not_found
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -47,7 +48,7 @@ proc find_java_home {} {
</span> global java_version_not_found
set java_version_not_found no
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global java.version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global java.version java.fallback
</span> if { ${java.version} ne "" } {
if { [catch {set val [exec "/usr/libexec/java_home" "-f" "-v" ${java.version}]}] } {
# Don't return an error because that would prevent the port from
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -92,6 +93,12 @@ proc find_java_home {} {
</span> ui_warn "No value for java JAVA_HOME was automatically discovered"
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Add dependency if required
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${java_version_not_found} && ${java.fallback} ne "" } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "Adding dependency on JDK fallback ${java.fallback}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:openjdk${java.version}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> return $home_value
}
</pre><pre style='margin:0'>
</pre>