From cd40a5be96045daa5ad442d58d33a371287b4be5 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Wed, 26 Feb 2025 13:44:46 +0100 Subject: [PATCH] tool: have_cmd_arg -> have_cmd_switch (run, autopilot, dts) Issue #5432 --- repos/base-nova/run/nova.run | 2 +- repos/base/run/smp.run | 2 +- repos/base/run/timer_accuracy.run | 2 +- repos/libports/run/extract.run | 2 +- repos/libports/run/fetchurl.inc | 2 +- repos/libports/run/libc_integration.run | 2 +- repos/libports/run/libc_vfs_fs_fat.run | 2 +- repos/libports/run/lwip.run | 2 +- repos/libports/run/memcpy.run | 2 +- repos/libports/run/nic_bridge.run | 2 +- repos/libports/run/nic_router.inc | 2 +- repos/libports/run/sntp_client.run | 2 +- repos/os/run/assert_nic.inc | 2 +- repos/os/run/cpu_bench.run | 2 +- repos/os/run/demo.run | 4 +-- repos/os/run/fb_bench.run | 2 +- repos/os/run/init_smp.run | 4 +-- repos/os/run/internet_checksum.run | 2 +- repos/os/run/log_core.run | 6 ++--- repos/os/run/lx_fs_import.run | 2 +- repos/os/run/sd_card_bench.run | 2 +- repos/os/run/test.run | 2 +- repos/os/run/usb_block.run | 2 +- repos/os/run/vmm_x86.run | 2 +- repos/pc/run/intel_fb.run | 4 +-- repos/ports/run/microcode.run | 4 +-- repos/ports/run/netperf_lwip_wifi.run | 2 +- repos/ports/run/netperf_lxip_wifi.run | 2 +- repos/ports/run/tool_chain_auto.run | 2 +- repos/ports/run/vbox5_ubuntu_16_04_32.run | 2 +- repos/ports/run/vbox5_ubuntu_16_04_64.run | 2 +- repos/ports/run/vbox5_win10_64.run | 2 +- repos/ports/run/vbox5_win7_32.run | 2 +- repos/ports/run/vbox5_win7_64.run | 2 +- repos/ports/run/vbox5_win7_64_multiple.run | 2 +- repos/ports/run/vbox5_win7_64_raw.run | 2 +- repos/ports/run/vbox5_win7_64_share.run | 2 +- repos/ports/run/vbox6_genode_usb_hid_raw.run | 4 +-- repos/ports/run/verify.run | 2 +- repos/ports/run/virtualbox_auto.inc | 2 +- repos/ports/run/vmm_vm_stress.inc | 2 +- tool/autopilot | 26 ++++++++++---------- tool/dts/extract | 10 ++++---- tool/run/depot.inc | 4 +-- tool/run/image/uboot | 6 ++--- tool/run/load/ipxe | 2 +- tool/run/load/tftp | 4 +-- tool/run/log/amt | 4 +-- tool/run/log/serial | 2 +- tool/run/run | 11 +++++---- 50 files changed, 83 insertions(+), 82 deletions(-) diff --git a/repos/base-nova/run/nova.run b/repos/base-nova/run/nova.run index 12517ca582..fcbb925de5 100644 --- a/repos/base-nova/run/nova.run +++ b/repos/base-nova/run/nova.run @@ -5,7 +5,7 @@ if {[have_include power_on/qemu]} { set check_pat 0 } -if {[have_cmd_arg --autopilot] && [have_spec x86_32]} { +if {[have_cmd_switch --autopilot] && [have_spec x86_32]} { # Disable test for our outdated nighly test machine for 32bit set check_pat 0 } diff --git a/repos/base/run/smp.run b/repos/base/run/smp.run index 9073619555..6aa914e3e3 100644 --- a/repos/base/run/smp.run +++ b/repos/base/run/smp.run @@ -5,7 +5,7 @@ # \author Alexander Boettcher # -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/base/run/timer_accuracy.run b/repos/base/run/timer_accuracy.run index 51096e3fd7..ed7821e8f2 100644 --- a/repos/base/run/timer_accuracy.run +++ b/repos/base/run/timer_accuracy.run @@ -30,7 +30,7 @@ build_boot_image [build_artifacts] append qemu_args " -nographic" -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_spec nova] && ![have_include power_on/qemu]} { NOVA requires a CPU with invariant TSC support, which is by default not supported. KVM has support by explicitly enabling this feature, but by diff --git a/repos/libports/run/extract.run b/repos/libports/run/extract.run index 254150196d..4971332ae1 100644 --- a/repos/libports/run/extract.run +++ b/repos/libports/run/extract.run @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/fetchurl.inc b/repos/libports/run/fetchurl.inc index 476fe27df2..ad3e0b8bac 100644 --- a/repos/libports/run/fetchurl.inc +++ b/repos/libports/run/fetchurl.inc @@ -11,7 +11,7 @@ assert {![have_board rpi]} assert {[have_recipe pkg/[drivers_nic_pkg]]} \ "Recipe for 'pkg/[drivers_nic_pkg]' not available." -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board linux] && ![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/libc_integration.run b/repos/libports/run/libc_integration.run index 2f15504ca3..42594694b1 100644 --- a/repos/libports/run/libc_integration.run +++ b/repos/libports/run/libc_integration.run @@ -10,7 +10,7 @@ set config_ds 1024 set run_script_timeout 500000 -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { set current_date [clock format [clock seconds] -format %a] assert {$current_date == "Sat" || $current_date == "Sun"} \ "Autopilot mode is not supported on this platform today." diff --git a/repos/libports/run/libc_vfs_fs_fat.run b/repos/libports/run/libc_vfs_fs_fat.run index 17dfc3a5f0..45d9f9b473 100644 --- a/repos/libports/run/libc_vfs_fs_fat.run +++ b/repos/libports/run/libc_vfs_fs_fat.run @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/lwip.run b/repos/libports/run/lwip.run index 45a0b1e15b..2322701463 100644 --- a/repos/libports/run/lwip.run +++ b/repos/libports/run/lwip.run @@ -25,7 +25,7 @@ assert {![have_board rpi]} assert {[have_recipe pkg/[drivers_nic_pkg]]} \ "Recipe for 'pkg/[drivers_nic_pkg]' not available." -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/memcpy.run b/repos/libports/run/memcpy.run index 2a96f689c7..c166aab747 100644 --- a/repos/libports/run/memcpy.run +++ b/repos/libports/run/memcpy.run @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/nic_bridge.run b/repos/libports/run/nic_bridge.run index a754cdef7d..def9c67e4c 100644 --- a/repos/libports/run/nic_bridge.run +++ b/repos/libports/run/nic_bridge.run @@ -1,7 +1,7 @@ assert {[have_include power_on/qemu]} assert {![have_board rpi3]} -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/nic_router.inc b/repos/libports/run/nic_router.inc index def6b3097e..42de6277d2 100644 --- a/repos/libports/run/nic_router.inc +++ b/repos/libports/run/nic_router.inc @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/libports/run/sntp_client.run b/repos/libports/run/sntp_client.run index 46275f3d2a..4c2729c9b4 100644 --- a/repos/libports/run/sntp_client.run +++ b/repos/libports/run/sntp_client.run @@ -1,6 +1,6 @@ assert {![have_spec linux]} -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {[have_spec x86]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/os/run/assert_nic.inc b/repos/os/run/assert_nic.inc index b26b766579..4910cb2310 100644 --- a/repos/os/run/assert_nic.inc +++ b/repos/os/run/assert_nic.inc @@ -7,7 +7,7 @@ assert {![have_board imx53_qsb_tz]} # # these targets would require extra setup on the autopilot which is not desired # -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board linux] && ![have_board zynq_qemu] && ![have_board virt_qemu_riscv]} \ diff --git a/repos/os/run/cpu_bench.run b/repos/os/run/cpu_bench.run index 52ee0720f7..40c11140c6 100644 --- a/repos/os/run/cpu_bench.run +++ b/repos/os/run/cpu_bench.run @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/os/run/demo.run b/repos/os/run/demo.run index 05be1a3f21..bd477c6541 100644 --- a/repos/os/run/demo.run +++ b/repos/os/run/demo.run @@ -1,7 +1,7 @@ assert {[have_recipe pkg/[drivers_interactive_pkg]]} \ "Recipe for 'pkg/[drivers_interactive_pkg]' not available." -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board linux] && ![have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." } @@ -205,7 +205,7 @@ close $launchpad_config_fd build_boot_image [list {*}[build_artifacts] launchpad.config] -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { run_genode_until {\[init -> scout\] png is.*\n} 40 grep_output {(requests resources: )|(Error)} diff --git a/repos/os/run/fb_bench.run b/repos/os/run/fb_bench.run index e305795aa5..c06d4c6286 100644 --- a/repos/os/run/fb_bench.run +++ b/repos/os/run/fb_bench.run @@ -1,7 +1,7 @@ assert {[have_recipe pkg/[drivers_interactive_pkg]]} \ "Recipe for 'pkg/[drivers_interactive_pkg]' not available." -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_spec linux] && ![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/os/run/init_smp.run b/repos/os/run/init_smp.run index d48078ebb9..0114e6caf4 100644 --- a/repos/os/run/init_smp.run +++ b/repos/os/run/init_smp.run @@ -10,7 +10,7 @@ set demand [expr 1*1024*1024] set cpus 4 set init_ram 256 -if { [have_cmd_arg --autopilot] } { +if { [have_cmd_switch --autopilot] } { assert {![have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." @@ -102,7 +102,7 @@ build_boot_image [build_artifacts] append qemu_args " -m [expr 128 + $init_ram*$cpus]M -nographic -smp $cpus" -if { [have_cmd_arg --autopilot] } { +if { [have_cmd_switch --autopilot] } { run_genode_until {bomb started} 20 diff --git a/repos/os/run/internet_checksum.run b/repos/os/run/internet_checksum.run index 598280a3eb..38c15bb198 100644 --- a/repos/os/run/internet_checksum.run +++ b/repos/os/run/internet_checksum.run @@ -11,7 +11,7 @@ rename exit run_tool_exit proc exit {{code 0}} { global lx_fs_dir global input_file - if {[have_cmd_arg --autopilot]} { exec rm -rf $input_file $lx_fs_dir } + if {[have_cmd_switch --autopilot]} { exec rm -rf $input_file $lx_fs_dir } run_tool_exit $code } build { core init lib/ld lib/vfs test/internet_checksum server/lx_fs } diff --git a/repos/os/run/log_core.run b/repos/os/run/log_core.run index c432fc9c48..467dccf14f 100644 --- a/repos/os/run/log_core.run +++ b/repos/os/run/log_core.run @@ -1,12 +1,12 @@ assert {![have_spec linux]} -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {[have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." } proc log_service { } { - if { [have_cmd_arg --autopilot] } { return log } + if { [have_cmd_switch --autopilot] } { return log } return ram } @@ -105,7 +105,7 @@ build_boot_image [build_artifacts] append qemu_args " -nographic " -if { [have_cmd_arg --autopilot] } { +if { [have_cmd_switch --autopilot] } { run_genode_until {.*\[log_core -> log] \[.*\n} 20 } else { run_genode_until forever diff --git a/repos/os/run/lx_fs_import.run b/repos/os/run/lx_fs_import.run index 5ccc888f0d..4be4715c52 100644 --- a/repos/os/run/lx_fs_import.run +++ b/repos/os/run/lx_fs_import.run @@ -7,7 +7,7 @@ lappend depot_archives [depot_user]/src/vfs_import set build_components { } -if { [have_cmd_arg --autopilot] } { +if { [have_cmd_switch --autopilot] } { lappend depot_archives [depot_user]/src/lx_fs } else { lappend build_components server/lx_fs diff --git a/repos/os/run/sd_card_bench.run b/repos/os/run/sd_card_bench.run index aad551b2ac..7b763c9981 100644 --- a/repos/os/run/sd_card_bench.run +++ b/repos/os/run/sd_card_bench.run @@ -1,7 +1,7 @@ # # Check for platform support # -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv] && ![have_board rpi]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/os/run/test.run b/repos/os/run/test.run index 28536ec715..776a4b9297 100644 --- a/repos/os/run/test.run +++ b/repos/os/run/test.run @@ -39,7 +39,7 @@ # make run/test KERNEL=linux PKG=test-fs_report # -assert {![have_cmd_arg --autopilot]} +assert {![have_cmd_switch --autopilot]} ## # Obtain name of the test pkg from the 'PKG' environment variable diff --git a/repos/os/run/usb_block.run b/repos/os/run/usb_block.run index 35d0cd3d7f..46ee6fd3ab 100644 --- a/repos/os/run/usb_block.run +++ b/repos/os/run/usb_block.run @@ -1,6 +1,6 @@ assert {[have_board pc]} -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {[have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/os/run/vmm_x86.run b/repos/os/run/vmm_x86.run index c54187373f..d2c36447d2 100644 --- a/repos/os/run/vmm_x86.run +++ b/repos/os/run/vmm_x86.run @@ -6,7 +6,7 @@ assert {[have_spec x86]} -if { [have_cmd_arg --autopilot] } { +if { [have_cmd_switch --autopilot] } { assert {!([have_spec x86_32] && ![have_include power_on/qemu])} \ "Nightly x86 32-bit test machine has no vmx support." diff --git a/repos/pc/run/intel_fb.run b/repos/pc/run/intel_fb.run index 971d133c9a..3acbd4dbc2 100644 --- a/repos/pc/run/intel_fb.run +++ b/repos/pc/run/intel_fb.run @@ -1,6 +1,6 @@ assert {[have_spec x86_64]} -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_include power_on/qemu] && ![have_board linux]} \ "Autopilot mode is not supported on this platform." @@ -368,7 +368,7 @@ install_config $config build_boot_image [build_artifacts] -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { run_genode_until {\[init -\> init_dynamic -\> intel_fb\].*connector connected="true" name="HDMI-A-3"} 30 run_genode_until {\} 20 [output_spawn_id] run_genode_until {green} 30 [output_spawn_id] diff --git a/repos/ports/run/microcode.run b/repos/ports/run/microcode.run index b5b69b26ab..c90d2184c8 100644 --- a/repos/ports/run/microcode.run +++ b/repos/ports/run/microcode.run @@ -3,7 +3,7 @@ assert {[have_spec x86]} set path_microcode "[exec [genode_dir]/tool/ports/current --no-print-directory microcode_intel]/src/app/intel/intel-ucode" set microcode_files [glob -nocomplain -dir $path_microcode *-*-*] -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_include power_on/qemu]} \ "Autopilot mode is not supported on this platform." @@ -61,7 +61,7 @@ append qemu_args "-smp 4 " run_genode_until "microcode check done" 30 # cleanup -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { file delete -force bin/micro.code foreach file $microcode_files { file delete bin/$file diff --git a/repos/ports/run/netperf_lwip_wifi.run b/repos/ports/run/netperf_lwip_wifi.run index d236dc4580..2bf6026c9b 100644 --- a/repos/ports/run/netperf_lwip_wifi.run +++ b/repos/ports/run/netperf_lwip_wifi.run @@ -9,7 +9,7 @@ assert {[have_spec x86]} assert {![have_include power_on/qemu]} assert {![have_include power_on/linux]} -if {[have_cmd_arg --autopilot] && [have_spec x86_32]} { +if {[have_cmd_switch --autopilot] && [have_spec x86_32]} { assert {[have_spec foc] || [have_spec nova]} { Autopilot mode is not supported on this platform. diff --git a/repos/ports/run/netperf_lxip_wifi.run b/repos/ports/run/netperf_lxip_wifi.run index 9114826ed7..ed47ed93e0 100644 --- a/repos/ports/run/netperf_lxip_wifi.run +++ b/repos/ports/run/netperf_lxip_wifi.run @@ -9,7 +9,7 @@ assert {[have_spec x86]} assert {![have_include power_on/qemu]} assert {![have_include power_on/linux]} -if {[have_cmd_arg --autopilot] && [have_spec x86_32]} { +if {[have_cmd_switch --autopilot] && [have_spec x86_32]} { assert {[have_spec foc] || [have_spec nova]} { Autopilot mode is not supported on this platform. diff --git a/repos/ports/run/tool_chain_auto.run b/repos/ports/run/tool_chain_auto.run index 499e2603c7..91e4383c8e 100644 --- a/repos/ports/run/tool_chain_auto.run +++ b/repos/ports/run/tool_chain_auto.run @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_include power_on/qemu]} \ "Running tool-chain auto test in autopilot on Qemu is not recommended." } diff --git a/repos/ports/run/vbox5_ubuntu_16_04_32.run b/repos/ports/run/vbox5_ubuntu_16_04_32.run index 18821d5592..5635d7867b 100644 --- a/repos/ports/run/vbox5_ubuntu_16_04_32.run +++ b/repos/ports/run/vbox5_ubuntu_16_04_32.run @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 1 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_ubuntu_16_04_64.run b/repos/ports/run/vbox5_ubuntu_16_04_64.run index 93e070b434..25bfeda3eb 100644 --- a/repos/ports/run/vbox5_ubuntu_16_04_64.run +++ b/repos/ports/run/vbox5_ubuntu_16_04_64.run @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 1 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win10_64.run b/repos/ports/run/vbox5_win10_64.run index 7a5602ff0a..2b0203598f 100644 --- a/repos/ports/run/vbox5_win10_64.run +++ b/repos/ports/run/vbox5_win10_64.run @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_32.run b/repos/ports/run/vbox5_win7_32.run index 6708051924..2742ee85aa 100644 --- a/repos/ports/run/vbox5_win7_32.run +++ b/repos/ports/run/vbox5_win7_32.run @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_64.run b/repos/ports/run/vbox5_win7_64.run index 4c33604b66..b5311d5653 100644 --- a/repos/ports/run/vbox5_win7_64.run +++ b/repos/ports/run/vbox5_win7_64.run @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_64_multiple.run b/repos/ports/run/vbox5_win7_64_multiple.run index 69b16aa263..623da51029 100644 --- a/repos/ports/run/vbox5_win7_64_multiple.run +++ b/repos/ports/run/vbox5_win7_64_multiple.run @@ -30,7 +30,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 6 diff --git a/repos/ports/run/vbox5_win7_64_raw.run b/repos/ports/run/vbox5_win7_64_raw.run index bae52ce5ef..d545dd277c 100644 --- a/repos/ports/run/vbox5_win7_64_raw.run +++ b/repos/ports/run/vbox5_win7_64_raw.run @@ -18,7 +18,7 @@ set use_overlay_from_disk 0 set use_serial 0 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_64_share.run b/repos/ports/run/vbox5_win7_64_share.run index 3e0725bef8..d5640a560c 100644 --- a/repos/ports/run/vbox5_win7_64_share.run +++ b/repos/ports/run/vbox5_win7_64_share.run @@ -16,7 +16,7 @@ set use_rumpfs 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![have_cmd_arg --autopilot]] +set use_usb [expr ![have_cmd_switch --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox6_genode_usb_hid_raw.run b/repos/ports/run/vbox6_genode_usb_hid_raw.run index c5186b5855..cf70eff1d6 100644 --- a/repos/ports/run/vbox6_genode_usb_hid_raw.run +++ b/repos/ports/run/vbox6_genode_usb_hid_raw.run @@ -183,7 +183,7 @@ global specs global repositories set depot_auto_update "" -if {[have_cmd_arg --depot-auto-update]} { +if {[have_cmd_switch --depot-auto-update]} { set depot_auto_update "--depot-auto-update" } @@ -211,7 +211,7 @@ append boot_components { usb_hid_raw.iso vbox6_genode_usb_hid_raw.vbox } build_boot_image $boot_components -if { ![have_cmd_arg --autopilot] } { run_genode_until forever } +if { ![have_cmd_switch --autopilot] } { run_genode_until forever } # autopilot test diff --git a/repos/ports/run/verify.run b/repos/ports/run/verify.run index 93f565c839..93a476226f 100644 --- a/repos/ports/run/verify.run +++ b/repos/ports/run/verify.run @@ -1,4 +1,4 @@ -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_board virt_qemu_riscv]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/ports/run/virtualbox_auto.inc b/repos/ports/run/virtualbox_auto.inc index 25abfa63f8..3045322c5f 100644 --- a/repos/ports/run/virtualbox_auto.inc +++ b/repos/ports/run/virtualbox_auto.inc @@ -3,7 +3,7 @@ assert {[have_spec nova] || [have_spec foc]} assert {![have_include power_on/qemu]} -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { assert {![have_spec x86_32]} \ "Autopilot mode is not supported on this platform." } diff --git a/repos/ports/run/vmm_vm_stress.inc b/repos/ports/run/vmm_vm_stress.inc index 0b39f7d454..feeabcaf80 100644 --- a/repos/ports/run/vmm_vm_stress.inc +++ b/repos/ports/run/vmm_vm_stress.inc @@ -1,6 +1,6 @@ #!/usr/bin/expect -if {[have_cmd_arg --autopilot]} { +if {[have_cmd_switch --autopilot]} { set current_date [clock format [clock seconds] -format %a] assert {$current_date == "Sat" || $current_date == "Sun"} \ "Autopilot mode is not supported on this platform today." diff --git a/tool/autopilot b/tool/autopilot index e3af758f3b..2ddb7e2b66 100755 --- a/tool/autopilot +++ b/tool/autopilot @@ -91,7 +91,7 @@ proc help { } { ## # Return true if command-line switch was specified # -proc have_cmd_arg { arg_name } { +proc have_cmd_switch { arg_name } { global argv return [expr [lsearch $argv $arg_name] >= 0] } @@ -110,7 +110,7 @@ proc wipe_test_dir { } { # Remove build artifacts if commanded via the '--cleanup' argument # proc cleanup { } { - if {[have_cmd_arg --cleanup]} { + if {[have_cmd_switch --cleanup]} { puts "cleaning up $test_dir" wipe_test_dir } @@ -165,7 +165,7 @@ proc log_file { arch board kernel run_script } { proc log_fd { arch board kernel run_script } { # if '--stdout' was specified, don't write log output to files - if {[have_cmd_arg --stdout]} { return stdout } + if {[have_cmd_switch --stdout]} { return stdout } # create file descriptor of log file on demand global _log_fds @@ -200,7 +200,7 @@ proc execute_run_script { arch board kernel run_script } { set fd [log_fd $arch $board $kernel $run_script] if {[catch { - if {[have_cmd_arg --time-stamp]} { + if {[have_cmd_switch --time-stamp]} { exec make -C [build_dir $arch] [file join run $run_script] BOARD=$board KERNEL=$kernel \ |& ts "\[%F %H:%M:%S\]" >&@ $fd } else { @@ -257,7 +257,7 @@ proc build_dir_remainings { arch } { proc build_failed_because_of_missing_run_script { arch board kernel run_script } { # we cannot inspect any logfile when --stdout was used - if {[have_cmd_arg --stdout]} { return 0 } + if {[have_cmd_switch --stdout]} { return 0 } # grep log output for the respective error message of the build system if {[catch { @@ -270,7 +270,7 @@ proc build_failed_because_of_missing_run_script { arch board kernel run_script } proc build_failed_because_of_unsatisfied_requirement { arch board kernel run_script } { # we cannot inspect any logfile when --stdout was used - if {[have_cmd_arg --stdout]} { return 0 } + if {[have_cmd_switch --stdout]} { return 0 } # grep log output for the respective error message if {[catch { @@ -297,7 +297,7 @@ set make_jobs 2 foreach_cmdline_arg j { global make_jobs; set make_jobs $j } # present help if explicitly requested -if {[have_cmd_arg --help]} { help; exit 0 } +if {[have_cmd_switch --help]} { help; exit 0 } # # Handle platform-kernel combinations by adding to targets @@ -357,14 +357,14 @@ puts "make -j : $make_jobs" # command-line arguments. # -if {[file exists $test_dir] && ![have_cmd_arg --force] && - ![have_cmd_arg --keep]} { +if {[file exists $test_dir] && ![have_cmd_switch --force] && + ![have_cmd_switch --keep]} { puts stderr "Error: test directory $test_dir already exists" exit -3 } -if {[have_cmd_arg --force]} { wipe_test_dir } +if {[have_cmd_switch --force]} { wipe_test_dir } proc append_run_opt { build_conf } { @@ -391,7 +391,7 @@ foreach arch $architectures { set build_dir [build_dir $arch] set build_conf [file join $build_dir etc build.conf] - if {[have_cmd_arg --keep] && [file exists $build_dir]} { + if {[have_cmd_switch --keep] && [file exists $build_dir]} { append_run_opt $build_conf continue } @@ -416,7 +416,7 @@ foreach arch $architectures { exec echo "MAKE += -j$make_jobs" >> $build_conf # optionally enable ccache - if {[have_cmd_arg --enable-ccache]} { + if {[have_cmd_switch --enable-ccache]} { set tools_conf [file join $build_dir etc tools.conf] exec echo "CUSTOM_CC = ccache \$(CROSS_DEV_PREFIX)gcc" >> $tools_conf exec echo "CUSTOM_CXX = ccache \$(CROSS_DEV_PREFIX)g++" >> $tools_conf @@ -507,7 +507,7 @@ foreach arch $architectures { } } - if {[have_cmd_arg --skip-clean-rules]} continue + if {[have_cmd_switch --skip-clean-rules]} continue # execute and validate cleanall rule foreach target $targets { diff --git a/tool/dts/extract b/tool/dts/extract index 473f1a734d..b51b103a53 100755 --- a/tool/dts/extract +++ b/tool/dts/extract @@ -9,7 +9,7 @@ ## # Return true if command-line switch was specified # -proc have_cmd_arg { arg_name } { +proc have_cmd_switch { arg_name } { global argv return [expr [lsearch $argv $arg_name] >= 0] } @@ -405,22 +405,22 @@ foreach path [array names selected] { } -if {[have_cmd_arg --labels]} { +if {[have_cmd_switch --labels]} { foreach n [lsort [array names labels]] { puts "$n\t$labels($n)" } } -if {[have_cmd_arg --nodes]} { +if {[have_cmd_switch --nodes]} { foreach n [lsort [array names selected]] { puts "$n" } } -if {[have_cmd_arg --references]} { +if {[have_cmd_switch --references]} { foreach n [lsort [array names references]] { puts "$n\t$references($n)" } } -if {[have_cmd_arg --dot-graph]} { +if {[have_cmd_switch --dot-graph]} { puts "digraph {" puts { rankdir=LR; nodesep=0.01;} puts { node[shape=polygon, height=0, color=gray, fontsize=12, margin="0.1,0.01"];} diff --git a/tool/run/depot.inc b/tool/run/depot.inc index f10c5ab967..286bf053f5 100644 --- a/tool/run/depot.inc +++ b/tool/run/depot.inc @@ -224,7 +224,7 @@ proc _depot_auto_update { archives } { append cmd "DEPOT_DIR=[depot_dir] " append cmd "UPDATE_VERSIONS=1 FORCE=1 REBUILD= " - if {[have_cmd_arg --ccache]} { + if {[have_cmd_switch --ccache]} { append cmd "CCACHE=1 " } set make_j_arg "" @@ -252,7 +252,7 @@ proc _collect_from_depot { archives } { incr _collect_from_depot_nesting_level # fill depot with up-to-date content if --depot-auto-update is enabled - if {[have_cmd_arg --depot-auto-update]} { + if {[have_cmd_switch --depot-auto-update]} { if {$_collect_from_depot_nesting_level == 1} { _depot_auto_update $archives } } diff --git a/tool/run/image/uboot b/tool/run/image/uboot index 7819652098..063a19c0be 100644 --- a/tool/run/image/uboot +++ b/tool/run/image/uboot @@ -9,9 +9,9 @@ ## # Check if the uImage should be gzipped # -proc image_uboot_use_no_gzip { } { return [have_cmd_arg --image-uboot-no-gzip] } +proc image_uboot_use_no_gzip { } { return [have_cmd_switch --image-uboot-no-gzip] } -proc image_uboot_use_fit { } { return [have_cmd_arg --image-uboot-fit] } +proc image_uboot_use_fit { } { return [have_cmd_switch --image-uboot-fit] } ## @@ -24,7 +24,7 @@ proc image_uboot_use_fit { } { return [have_cmd_arg --image-uboot-fit] } # it disabled. # proc image_uboot_gzip_opt { } { - if {[have_cmd_arg --image-uboot-gzip-best]} { + if {[have_cmd_switch --image-uboot-gzip-best]} { return "--best" } else { return "--fast" diff --git a/tool/run/load/ipxe b/tool/run/load/ipxe index e89658e699..e6b04b06d3 100644 --- a/tool/run/load/ipxe +++ b/tool/run/load/ipxe @@ -27,7 +27,7 @@ proc load_ipxe_base_dir { } { return [cmd_arg --load-ipxe-base-dir ""] } proc load_ipxe_boot_dir { } { return [cmd_arg --load-ipxe-boot-dir ""] } -proc load_ipxe_lighttpd { } { return [have_cmd_arg --load-ipxe-lighttpd] } +proc load_ipxe_lighttpd { } { return [have_cmd_switch --load-ipxe-lighttpd] } proc load_ipxe_lighttpd_port { } { return [cmd_arg --load-ipxe-lighttpd-port 8080] } diff --git a/tool/run/load/tftp b/tool/run/load/tftp index b5a90c4c5b..bf3082d585 100644 --- a/tool/run/load/tftp +++ b/tool/run/load/tftp @@ -29,10 +29,10 @@ proc load_tftp_base_dir { } { return [cmd_arg --load-tftp-base-dir ""] } proc load_tftp_offset_dir { } { return [cmd_arg --load-tftp-offset-dir ""] } -proc load_tftp_use_absolute { } { return [have_cmd_arg --load-tftp-absolute] } +proc load_tftp_use_absolute { } { return [have_cmd_switch --load-tftp-absolute] } -proc load_tftp_copy_files { } { return [have_cmd_arg --load-tftp-copy-files] } +proc load_tftp_copy_files { } { return [have_cmd_switch --load-tftp-copy-files] } ## diff --git a/tool/run/log/amt b/tool/run/log/amt index cc9ef4d750..9fb7c63a58 100644 --- a/tool/run/log/amt +++ b/tool/run/log/amt @@ -29,7 +29,7 @@ proc log_amt_timeout { } { } proc log_amt_skip_test { } { - return [have_cmd_arg --log-amt-skip-test] + return [have_cmd_switch --log-amt-skip-test] } @@ -87,7 +87,7 @@ proc run_log { wait_for_re timeout_value } { set amt_log ".*session authentication" } - if {[have_cmd_arg --log-amt-filter]} { + if {[have_cmd_switch --log-amt-filter]} { set amt_cmd "$amt_cmd | [log_amt_filter]" } diff --git a/tool/run/log/serial b/tool/run/log/serial index b9341dd3a9..56940e080c 100644 --- a/tool/run/log/serial +++ b/tool/run/log/serial @@ -43,7 +43,7 @@ proc run_log { wait_for_re timeout_value } { # i.e., lets only ASCII characters through. # set serial_cmd_chain [log_serial_cmd] - if {[have_cmd_arg --log-serial-filter]} { + if {[have_cmd_switch --log-serial-filter]} { set serial_cmd_chain "$serial_cmd_chain | [log_serial_filter]" } diff --git a/tool/run/run b/tool/run/run index a330bd1329..5fac7920a2 100755 --- a/tool/run/run +++ b/tool/run/run @@ -71,7 +71,7 @@ proc build {targets} { if {[llength $targets] == 0} return - if {[have_cmd_arg --skip-build]} return + if {[have_cmd_switch --skip-build]} return regsub -all {\s\s+} $targets " " targets puts "building targets: $targets" @@ -384,7 +384,7 @@ match_max -d 40000 proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { if {$wait_for_re == "forever"} { - assert {![have_cmd_arg --autopilot]} + assert {![have_cmd_switch --autopilot]} } # @@ -593,16 +593,17 @@ proc compare_output_to { good } { ## # Return true if command-line switch was specified # -proc have_cmd_arg { arg_name } { +proc have_cmd_switch { arg_name } { global argv return [expr [lsearch $argv $arg_name] >= 0] } +## # Return true if command-line switch was specified # proc get_cmd_switch { arg_name } { - return [have_cmd_arg $arg_name] + return [have_cmd_switch $arg_name] } @@ -890,7 +891,7 @@ proc wait_for_output { wait_for_re timeout_value running_spawn_id } { proc remove_genode_dir { } { global env - if {![have_cmd_arg --preserve-genode-dir]} { + if {![have_cmd_switch --preserve-genode-dir]} { exec rm -rf [run_dir]/genode } }