diff mbox series

[7/8] automation/console.exp: do not assume expect is always at /usr/bin/

Message ID 20250317121616.40687-8-roger.pau@citrix.com (mailing list archive)
State New
Headers show
Series automation/cirrus-ci: add smoke tests of the FreeBSD builds | expand

Commit Message

Roger Pau Monne March 17, 2025, 12:16 p.m. UTC
Instead use env to find the location of expect.

Additionally do not use the -f flag, as it's only meaningful when passing
arguments on the command line, which we never do for console.exp.  From the
expect 5.45.4 man page:

> The -f flag prefaces a file from which to read commands from.  The flag
> itself is optional as it is only useful when using the #! notation (see
> above), so  that other arguments may be supplied on the command line.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 automation/scripts/console.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Stabellini March 17, 2025, 11:48 p.m. UTC | #1
On Mon, 17 Mar 2025, Roger Pau Monne wrote:
> Instead use env to find the location of expect.
> 
> Additionally do not use the -f flag, as it's only meaningful when passing
> arguments on the command line, which we never do for console.exp.  From the
> expect 5.45.4 man page:
> 
> > The -f flag prefaces a file from which to read commands from.  The flag
> > itself is optional as it is only useful when using the #! notation (see
> > above), so  that other arguments may be supplied on the command line.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Do you have a link to a successful Gitlab and Cirrus CI?

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  automation/scripts/console.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
> index 310543c33e5e..31ce97b91b63 100755
> --- a/automation/scripts/console.exp
> +++ b/automation/scripts/console.exp
> @@ -1,4 +1,4 @@
> -#!/usr/bin/expect -f
> +#!/usr/bin/env expect
>  
>  if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
>      set timeout $env(TEST_TIMEOUT_OVERRIDE)
> -- 
> 2.48.1
>
Roger Pau Monne March 18, 2025, 9:45 a.m. UTC | #2
On Mon, Mar 17, 2025 at 04:48:05PM -0700, Stefano Stabellini wrote:
> On Mon, 17 Mar 2025, Roger Pau Monne wrote:
> > Instead use env to find the location of expect.
> > 
> > Additionally do not use the -f flag, as it's only meaningful when passing
> > arguments on the command line, which we never do for console.exp.  From the
> > expect 5.45.4 man page:
> > 
> > > The -f flag prefaces a file from which to read commands from.  The flag
> > > itself is optional as it is only useful when using the #! notation (see
> > > above), so  that other arguments may be supplied on the command line.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Do you have a link to a successful Gitlab and Cirrus CI?

Yes.  They are here:

https://cirrus-ci.com/build/4981406134173696
https://gitlab.com/xen-project/people/royger/xen/-/pipelines/1719913362

> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Thanks, Roger.
diff mbox series

Patch

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 310543c33e5e..31ce97b91b63 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,4 @@ 
-#!/usr/bin/expect -f
+#!/usr/bin/env expect
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)