Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-14309 MTR tests require perl-Env which is not always in the defa…
…ult installation * don't use Env module in tests, use $ENV{xxx} instead * collateral changes: ** $file in the error message was unset ** $file in the other error message was unset too :) ** source file arguments are conventionally upper-cased ** abort the test (die) on error, don't just echo/exit
- Loading branch information
Showing
2 changed files
with
4 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
# truncate a giving file, all contents of the file are be cleared | ||
|
||
if (!$file) | ||
if (!$TRUNCATE_FILE) | ||
{ | ||
--echo Please assign a file name to $file!! | ||
exit; | ||
die TRUNCATE_FILE is not set; | ||
} | ||
|
||
let TRUNCATE_FILE= $file; | ||
|
||
perl; | ||
use Env; | ||
Env::import('TRUNCATE_FILE'); | ||
open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file"; | ||
open FILE, '>', $ENV{TRUNCATE_FILE} or die "open(>$ENV{TRUNCATE_FILE}): $!"; | ||
close FILE; | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters