Skip to content

Commit

Permalink
misc src/: fixup eb0a577.
Browse files Browse the repository at this point in the history
"string is entier" is only available in TCL 8.6+. Use "string is
wideinteger" as a workaround for now.
  • Loading branch information
Ionic committed Feb 4, 2017
1 parent eb0a577 commit 0846afb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/macports1.0/macports_util.tcl
Expand Up @@ -108,15 +108,15 @@ proc ldindex {varName args} {
set idx [lindex $args 0]
set size [llength $var]
set badrange? 0
if {[string is entier -strict $idx]} {
if {[string is wideinteger -strict $idx]} {
if {$idx < 0 || $idx >= $size} {
set badrange? 1
}
} elseif {$idx eq "end"} {
if {$size == 0} {
set badrange? 1
}
} elseif {[string match "end-*" $idx] && [string is entier -strict [string range $idx 4 end]]} {
} elseif {[string match "end-*" $idx] && [string is wideinteger -strict [string range $idx 4 end]]} {
set i [expr {$size - 1 - [string range $idx 4 end]}]
if {$i < 0 || $i >= $size} {
set badrange? 1
Expand Down
2 changes: 1 addition & 1 deletion src/macports1.0/reclaim.tcl
Expand Up @@ -354,7 +354,7 @@ namespace eval reclaim {

set time [read_last_run_file]

if {![string is entier -strict $time]} {
if {![string is wideinteger -strict $time]} {
return
}

Expand Down
4 changes: 2 additions & 2 deletions src/port/port.tcl
Expand Up @@ -5480,7 +5480,7 @@ namespace eval portclient::questions {
throw
}
signal -restart error {TERM INT}
if {($input <= [llength $ports] && [string is entier -strict $input])} {
if {($input <= [llength $ports] && [string is wideinteger -strict $input])} {
return [expr {$input - 1}]
} else {
puts "Please enter an index from the above list."
Expand Down Expand Up @@ -5545,7 +5545,7 @@ namespace eval portclient::questions {

set err_flag 1
foreach num $input {
if {[string is entier -strict $num] && $num <= [llength $ports] && $num > 0} {
if {[string is wideinteger -strict $num] && $num <= [llength $ports] && $num > 0} {
lappend selected_opt [expr {$num -1}]
} elseif {[regexp {(\d+)-(\d+)} $input _ start end]
&& $start <= [llength $ports]
Expand Down
4 changes: 2 additions & 2 deletions src/port1.0/portbuild.tcl
Expand Up @@ -148,7 +148,7 @@ proc portbuild::build_getjobs {args} {
}
} catch {*} {}
}
if {![string is entier -strict $jobs] || $jobs <= 1} {
if {![string is wideinteger -strict $jobs] || $jobs <= 1} {
set jobs 1
}
return $jobs
Expand Down Expand Up @@ -177,7 +177,7 @@ proc portbuild::build_getjobsarg {args} {
return ""
}
set jobs [option build.jobs]
if {![string is entier -strict $jobs] || $jobs <= 1} {
if {![string is wideinteger -strict $jobs] || $jobs <= 1} {
return ""
}
return " -j$jobs"
Expand Down
6 changes: 3 additions & 3 deletions src/port1.0/portlint.tcl
Expand Up @@ -426,11 +426,11 @@ proc portlint::lint_main {args} {
}
}

if {![string is entier -strict $epoch]} {
if {![string is wideinteger -strict $epoch]} {
ui_error "Port epoch is not numeric: $epoch"
incr errors
}
if {![string is entier -strict $revision]} {
if {![string is wideinteger -strict $revision]} {
ui_error "Port revision is not numeric: $revision"
incr errors
}
Expand Down Expand Up @@ -635,7 +635,7 @@ proc portlint::lint_main {args} {
# if the last character of license name is a number or plus sign
# then a hyphen is missing
set license_end [string index $subtest end]
if {"+" eq $license_end || [string is entier -strict $license_end]} {
if {"+" eq $license_end || [string is wideinteger -strict $license_end]} {
ui_error "invalid license '${test}': missing hyphen before version"
incr errors
}
Expand Down

0 comments on commit 0846afb

Please sign in to comment.