Skip to content

Commit

Permalink
selfupdate: check for missing Xcode license acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
jmroot committed Sep 23, 2023
1 parent a774938 commit 2f19695
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/macports1.0/selfupdate.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ proc selfupdate::main {{optionslist {}} {updatestatusvar {}}} {
set sdk_arg {}
set jobs [macports:get_parallel_jobs yes]
if {$::macports::os_platform eq "darwin"} {
catch {exec /usr/bin/cc 2>@1} output
set output [join [lrange [split $output "\n"] 0 end-1] "\n"]
if {[string match -nocase *license* $output]} {
ui_error "It seems you have not accepted the Xcode license; unable to build."
ui_error "Agree to the license by opening Xcode or running `sudo xcodebuild -license'."
return -code error "Xcode license acceptance required"
}

set cc_arg "CC=/usr/bin/cc "
if {$::macports::os_major >= 18 || ![file exists /usr/include/sys/cdefs.h]} {
set cltpath /Library/Developer/CommandLineTools
Expand Down

0 comments on commit 2f19695

Please sign in to comment.