<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/ad39c3b58c2b8e69d013044b4b243ca9e931b766">https://github.com/macports/macports-base/commit/ad39c3b58c2b8e69d013044b4b243ca9e931b766</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit ad39c3b58c2b8e69d013044b4b243ca9e931b766
</span>Author: Satryaji Aulia <satraul@macports.org>
AuthorDate: Mon Jun 17 17:27:51 2019 +0700
<span style='display:block; white-space:pre;color:#404040;'> Refactor use_xcode default and checks
</span>---
src/port1.0/portfetch.tcl | 9 ---------
src/port1.0/portmain.tcl | 8 +-------
src/port1.0/porttrace.tcl | 6 +++---
src/port1.0/portutil.tcl | 7 +++++--
4 files changed, 9 insertions(+), 21 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portfetch.tcl b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index ac1a0ff..91fc517 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -607,20 +607,11 @@ proc portfetch::fetch_addfilestomap {filemapname} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Utility function to error out if Xcode is needed
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-proc portfetch::checkxcode {} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- global use_xcode developer_dir
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$use_xcode eq "yes" && $xcodeversion eq "none"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "This port requires Xcode, which was not found on your system."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Initialize fetch target and call checkfiles.
proc portfetch::fetch_init {args} {
variable fetch_urls
portfetch::checkfiles fetch_urls
<span style='display:block; white-space:pre;background:#ffe0e0;'>- portfetch::checkxcode
</span> }
proc portfetch::fetch_start {args} {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portmain.tcl b/src/port1.0/portmain.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index a8f3654..e1b5c18 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portmain.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portmain.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -154,13 +154,7 @@ set egid [getegid]
</span> default worksymlink {[file normalize [file join $portpath work]]}
default distpath {[file normalize [file join $portdbpath distfiles ${dist_subdir}]]}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-default use_xcode {[portmain::get_default_use_xcode]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-proc portmain::get_default_use_xcode {} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[option build.type] eq "xcode"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default use_xcode {[expr {[option build.type] eq "xcode"}]}
</span>
proc portmain::main {args} {
return 0
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/porttrace.tcl b/src/port1.0/porttrace.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 1c6cd12..22b39b5 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/porttrace.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/porttrace.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -227,13 +227,13 @@ namespace eval porttrace {
</span> }
lappend xcode_paths [file join {*}$ddsplit]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$use_xcode eq "no"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[tbool use_xcode]} {
</span> foreach xcode_path $xcode_paths {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- deny trace_sandbox $xcode_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ allow trace_sandbox $xcode_path
</span> }
} else {
foreach xcode_path $xcode_paths {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- allow trace_sandbox $xcode_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ deny trace_sandbox $xcode_path
</span> }
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index ae6fb1e..944750d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -513,7 +513,7 @@ proc default_check {optionName index op} {
</span> # Command Line Tools
proc get_default_env {} {
global use_xcode
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$use_xcode eq "yes"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[tbool use_xcode]} {
</span> return ""
}
return "DEVELOPER_DIR=/Library/Developer/CommandLineTools"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3247,7 +3247,7 @@ proc check_supported_archs {} {
</span>
# check if the installed xcode version is new enough
proc _check_xcode_version {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global os.subplatform macosx_version xcodeversion
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global os.subplatform macosx_version xcodeversion use_xcode
</span>
if {${os.subplatform} eq "macosx"} {
switch $macosx_version {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3313,6 +3313,9 @@ proc _check_xcode_version {} {
</span> }
}
if {$xcodeversion eq "none"} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[tbool use_xcode]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "This port requires Xcode, which was not found on your system."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> ui_warn "Xcode does not appear to be installed; most ports will likely fail to build."
if {[file exists "/Applications/Install Xcode.app"]} {
ui_warn "You downloaded Xcode from the Mac App Store but didn't install it. Run \"Install Xcode\" in the /Applications folder."
</pre><pre style='margin:0'>
</pre>