Browse Source

fix for task kill grep problem

master
Julian Noble 1 month ago
parent
commit
effd392018
  1. 2
      src/bootsupport/modules/punk/mix/commandset/scriptwrap-0.1.0.tm
  2. 21
      src/make.tcl
  3. 2
      src/modules/punk/mix/commandset/scriptwrap-999999.0a1.0.tm
  4. 21
      src/project_layouts/custom/_project/punk.basic/src/make.tcl
  5. 2
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/scriptwrap-0.1.0.tm
  6. 21
      src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl
  7. 2
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/mix/commandset/scriptwrap-0.1.0.tm
  8. 21
      src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl
  9. 2
      src/vfs/_vfscommon.vfs/modules/punk/mix/commandset/scriptwrap-0.1.0.tm

2
src/bootsupport/modules/punk/mix/commandset/scriptwrap-0.1.0.tm

@ -1250,7 +1250,7 @@ namespace eval punk::mix::commandset::scriptwrap {
puts stdout "overwriting $output_file because -force = $opt_force" puts stdout "overwriting $output_file because -force = $opt_force"
} }
} }
set fdt [open $wrapper_template r] set fdt [open $wrapper_template r]
fconfigure $fdt -translation binary fconfigure $fdt -translation binary

21
src/make.tcl

@ -2926,16 +2926,27 @@ foreach vfstail $vfs_tails {
#killing process doesn't apply to .kit build #killing process doesn't apply to .kit build
if {$rtname ne "-"} { if {$rtname ne "-"} {
#exec $pscmd | grep $targetkit ;#wrong - fails on at least some OSes because grep itself is in the list
#exec ps | grep $targetkit | grep -v grep ;#exclude grep process
if {![catch { if {![catch {
exec $pscmd | grep $targetkit exec $pscmd
} still_running]} { } ps_lines]} {
set still_running_lines [split [string trim $still_running] \n] #we will process without grep for for now - may not be avail on windows?
set still_running_lines [list]
foreach ln [split [string trim $ps_lines] \n] {
if {[string match "* grep *" $ln]} {continue}
if {[string match "*$targetkit*" $ln]} {
lappend still_running_lines $ln
}
}
#set still_running_lines [split [string trim $still_running] \n]
puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n" puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n"
set count_killed 0 set count_killed 0
set num_to_kill [llength $still_running_lines] set num_to_kill [llength $still_running_lines]
foreach ln [split $still_running \n] { foreach ln $still_running_lines {
puts stdout " $ln" puts stdout " $ln"
if {$::tcl_platform(platform) eq "windows"} { if {$::tcl_platform(platform) eq "windows"} {
set pid [lindex $ln 1] set pid [lindex $ln 1]
if {$forcekill} { if {$forcekill} {

2
src/modules/punk/mix/commandset/scriptwrap-999999.0a1.0.tm

@ -1250,7 +1250,7 @@ namespace eval punk::mix::commandset::scriptwrap {
puts stdout "overwriting $output_file because -force = $opt_force" puts stdout "overwriting $output_file because -force = $opt_force"
} }
} }
set fdt [open $wrapper_template r] set fdt [open $wrapper_template r]
fconfigure $fdt -translation binary fconfigure $fdt -translation binary

21
src/project_layouts/custom/_project/punk.basic/src/make.tcl

@ -2926,16 +2926,27 @@ foreach vfstail $vfs_tails {
#killing process doesn't apply to .kit build #killing process doesn't apply to .kit build
if {$rtname ne "-"} { if {$rtname ne "-"} {
#exec $pscmd | grep $targetkit ;#wrong - fails on at least some OSes because grep itself is in the list
#exec ps | grep $targetkit | grep -v grep ;#exclude grep process
if {![catch { if {![catch {
exec $pscmd | grep $targetkit exec $pscmd
} still_running]} { } ps_lines]} {
set still_running_lines [split [string trim $still_running] \n] #we will process without grep for for now - may not be avail on windows?
set still_running_lines [list]
foreach ln [split [string trim $ps_lines] \n] {
if {[string match "* grep *" $ln]} {continue}
if {[string match "*$targetkit*" $ln]} {
lappend still_running_lines $ln
}
}
#set still_running_lines [split [string trim $still_running] \n]
puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n" puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n"
set count_killed 0 set count_killed 0
set num_to_kill [llength $still_running_lines] set num_to_kill [llength $still_running_lines]
foreach ln [split $still_running \n] { foreach ln $still_running_lines {
puts stdout " $ln" puts stdout " $ln"
if {$::tcl_platform(platform) eq "windows"} { if {$::tcl_platform(platform) eq "windows"} {
set pid [lindex $ln 1] set pid [lindex $ln 1]
if {$forcekill} { if {$forcekill} {

2
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/scriptwrap-0.1.0.tm

@ -1250,7 +1250,7 @@ namespace eval punk::mix::commandset::scriptwrap {
puts stdout "overwriting $output_file because -force = $opt_force" puts stdout "overwriting $output_file because -force = $opt_force"
} }
} }
set fdt [open $wrapper_template r] set fdt [open $wrapper_template r]
fconfigure $fdt -translation binary fconfigure $fdt -translation binary

21
src/project_layouts/custom/_project/punk.project-0.1/src/make.tcl

@ -2926,16 +2926,27 @@ foreach vfstail $vfs_tails {
#killing process doesn't apply to .kit build #killing process doesn't apply to .kit build
if {$rtname ne "-"} { if {$rtname ne "-"} {
#exec $pscmd | grep $targetkit ;#wrong - fails on at least some OSes because grep itself is in the list
#exec ps | grep $targetkit | grep -v grep ;#exclude grep process
if {![catch { if {![catch {
exec $pscmd | grep $targetkit exec $pscmd
} still_running]} { } ps_lines]} {
set still_running_lines [split [string trim $still_running] \n] #we will process without grep for for now - may not be avail on windows?
set still_running_lines [list]
foreach ln [split [string trim $ps_lines] \n] {
if {[string match "* grep *" $ln]} {continue}
if {[string match "*$targetkit*" $ln]} {
lappend still_running_lines $ln
}
}
#set still_running_lines [split [string trim $still_running] \n]
puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n" puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n"
set count_killed 0 set count_killed 0
set num_to_kill [llength $still_running_lines] set num_to_kill [llength $still_running_lines]
foreach ln [split $still_running \n] { foreach ln $still_running_lines {
puts stdout " $ln" puts stdout " $ln"
if {$::tcl_platform(platform) eq "windows"} { if {$::tcl_platform(platform) eq "windows"} {
set pid [lindex $ln 1] set pid [lindex $ln 1]
if {$forcekill} { if {$forcekill} {

2
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/mix/commandset/scriptwrap-0.1.0.tm

@ -1250,7 +1250,7 @@ namespace eval punk::mix::commandset::scriptwrap {
puts stdout "overwriting $output_file because -force = $opt_force" puts stdout "overwriting $output_file because -force = $opt_force"
} }
} }
set fdt [open $wrapper_template r] set fdt [open $wrapper_template r]
fconfigure $fdt -translation binary fconfigure $fdt -translation binary

21
src/project_layouts/custom/_project/punk.shell-0.1/src/make.tcl

@ -2926,16 +2926,27 @@ foreach vfstail $vfs_tails {
#killing process doesn't apply to .kit build #killing process doesn't apply to .kit build
if {$rtname ne "-"} { if {$rtname ne "-"} {
#exec $pscmd | grep $targetkit ;#wrong - fails on at least some OSes because grep itself is in the list
#exec ps | grep $targetkit | grep -v grep ;#exclude grep process
if {![catch { if {![catch {
exec $pscmd | grep $targetkit exec $pscmd
} still_running]} { } ps_lines]} {
set still_running_lines [split [string trim $still_running] \n] #we will process without grep for for now - may not be avail on windows?
set still_running_lines [list]
foreach ln [split [string trim $ps_lines] \n] {
if {[string match "* grep *" $ln]} {continue}
if {[string match "*$targetkit*" $ln]} {
lappend still_running_lines $ln
}
}
#set still_running_lines [split [string trim $still_running] \n]
puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n" puts stdout "found ([llength $still_running_lines]) $targetkit instances still running\n"
set count_killed 0 set count_killed 0
set num_to_kill [llength $still_running_lines] set num_to_kill [llength $still_running_lines]
foreach ln [split $still_running \n] { foreach ln $still_running_lines {
puts stdout " $ln" puts stdout " $ln"
if {$::tcl_platform(platform) eq "windows"} { if {$::tcl_platform(platform) eq "windows"} {
set pid [lindex $ln 1] set pid [lindex $ln 1]
if {$forcekill} { if {$forcekill} {

2
src/vfs/_vfscommon.vfs/modules/punk/mix/commandset/scriptwrap-0.1.0.tm

@ -1250,7 +1250,7 @@ namespace eval punk::mix::commandset::scriptwrap {
puts stdout "overwriting $output_file because -force = $opt_force" puts stdout "overwriting $output_file because -force = $opt_force"
} }
} }
set fdt [open $wrapper_template r] set fdt [open $wrapper_template r]
fconfigure $fdt -translation binary fconfigure $fdt -translation binary

Loading…
Cancel
Save