Permalink
Browse files
portindex: Do not exit non-zero on failed ports
The change in 217d852 broke existing use cases, including the portindex
run in mportsync. Restore the previous behavior by default and only exit
with a non-zero exit code if requested with the new flag 'portindex -e'.
See: #64
Loading branch information
Showing
1 changed file
with
6 additions
and
2 deletions .
+6
−2
src/port/portindex.tcl
@@ -8,6 +8,7 @@ package require Pextlib
# Globals
set full_reindex 0
set permit_error 0
set stats(total) 0
set stats(failed) 0
set stats(skipped) 0
@@ -22,9 +23,10 @@ mportinit ui_options global_options global_variations
# Standard procedures
proc print_usage args {
global argv0
puts " Usage: $argv0 \[ -df \] \[ -o output directory\] \[ -p plat_ver_arch\] \[ directory\] "
puts " Usage: $argv0 \[ -dfe \] \[ -o output directory\] \[ -p plat_ver_arch\] \[ directory\] "
puts " -d:\t Output debugging information"
puts " -f:\t Do a full re-index instead of updating"
puts " -e:\t Exit code indicates if ports failed to parse"
puts " -o:\t Output all files to specified directory"
puts " -p:\t Pretend to be on another platform"
}
@@ -205,6 +207,8 @@ for {set i 0} {$i < $argc} {incr i} {
lappend port_options os.platform $os_platform os.major $os_major os.arch $os_arch
} elseif {$arg eq " -f" } { # Completely rebuild index
set full_reindex 1
} elseif {$arg eq " -e" } { # Non-zero exit code on errors
set permit_error 1
} else {
puts stderr " Unknown option: $arg "
print_usage
@@ -301,6 +305,6 @@ puts "\nTotal number of ports parsed:\t$stats(total)\
\n Ports failed:\t\t\t $stats(failed) \
\n Up-to-date ports skipped:\t $stats(skipped) \n "
if {$stats(failed) > 0} {
if {${permit_error} && $ stats(failed) > 0} {
exit 1
}
Toggle all file notes