Skip to content

Commit cba75d2

Browse files
mandreetytso
authored andcommitted
Pass down autoconf's EGREP to the tests.
Care was taken to make sure where to quote and where not to; variable assignments with EGREP=@egrep@ need quoting in order not to split the variable into tokens; expansions in places where we used to invoke egrep need not because they actually need to split $EGREP contents in case it's "grep -E". This fixes "egrep is obsolescent" warnings on newer coreutils. Signed-off-by: Matthias Andree <matthias.andree@gmx.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 51efd43 commit cba75d2

File tree

18 files changed

+57
-55
lines changed

18 files changed

+57
-55
lines changed

tests/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ top_builddir = ..
99
my_dir = tests
1010
INSTALL = @INSTALL@
1111
MKDIR_P = @MKDIR_P@
12+
EGREP = "@EGREP@"
1213

1314
@MCONFIG@
1415

@@ -24,6 +25,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf test_data.tmp
2425
@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
2526
@echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
2627
@echo "DD=@DD@" >>test_one
28+
@echo 'EGREP="@EGREP@"' >>test_one
2729
@cat $(srcdir)/test_one.in >> test_one
2830
@chmod +x-w test_one
2931

tests/f_pre_1970_date_encoding/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ create_file_with_xtime_and_extra() {
2424
get_file_xtime_and_extra() {
2525
name=$1
2626
echo "times for $name =" >> $TIMESTAMPS
27-
$DEBUGFS -R "stat $name" $TMPFILE 2>&1 | egrep '^( a| c| m|cr)time:' |
27+
$DEBUGFS -R "stat $name" $TMPFILE 2>&1 | $EGREP '^( a| c| m|cr)time:' |
2828
sed 's/ --.*//' >> $TIMESTAMPS
2929
}
3030

tests/m_minrootdir/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ stat /emptydir
3636
stat /dir
3737
stat /dir/file
3838
ENDL
39-
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep "(stat|Size:|Type:)" >> $OUT
39+
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | $EGREP "(stat|Size:|Type:)" >> $OUT
4040

4141
cat > $TMPFILE.cmd << ENDL
4242
ex /emptyfile

tests/m_rootdir/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ stat /emptydir
3737
stat /dir
3838
stat /dir/file
3939
ENDL
40-
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep "(stat|Size:|Type:)" >> $OUT
40+
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | $EGREP "(stat|Size:|Type:)" >> $OUT
4141

4242
cat > $TMPFILE.cmd << ENDL
4343
ex /emptyfile

tests/m_rootdir_acl/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ stat /dir/file
8181
stat /acl_dir
8282
stat /acl_dir/file
8383
ENDL
84-
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep "(stat|Size:|Type:)" >> $OUT
84+
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | $EGREP "(stat|Size:|Type:)" >> $OUT
8585

8686
cat > $TMPFILE.cmd << ENDL
8787
ea_list dir/file

tests/m_rootpaxtar/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cat > $TMPFILE.cmd << ENDL
2121
stat /file
2222
ea_list /file
2323
ENDL
24-
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep -v '^(crtime|Inode checksum):' >> $OUT
24+
$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | $EGREP -v '^(crtime|Inode checksum):' >> $OUT
2525

2626
$FSCK -f -n $TMPFILE >> $OUT 2>&1
2727

tests/t_change_uuid/script

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ rm -f $OUT
99
# Test command line option
1010
echo "create fs without metadata_csum" >> $OUT
1111
$MKE2FS -O ^metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
12-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
12+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1313

1414
echo "change UUID" >> $OUT
1515
$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
16-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
16+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1717

1818
echo "check filesystem" >> $OUT
1919
$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
2020
echo "fsck returns $?" >> $OUT
21-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
21+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
2222

2323
cmp -s $OUT $EXP
2424
status=$?

tests/t_change_uuid_mcsum/script

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ rm -f $OUT
99
# Test command line option
1010
echo "create fs with metadata_csum" >> $OUT
1111
$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
12-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
12+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1313

1414
echo "change UUID" >> $OUT
1515
$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
16-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
16+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1717

1818
echo "check filesystem" >> $OUT
1919
$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
2020
echo "fsck returns $?" >> $OUT
21-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
21+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
2222

2323
cmp -s $OUT $EXP
2424
status=$?

tests/t_change_uuid_mcsum_mounted/script

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ rm -f $OUT
99
# Test command line option
1010
echo "create fs with metadata_csum" >> $OUT
1111
$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
12-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
12+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1313

1414
echo "change UUID" >> $OUT
1515
EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
16-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
16+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1717

1818
echo "check filesystem" >> $OUT
1919
$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
2020
echo "fsck returns $?" >> $OUT
21-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
21+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
2222

2323
cmp -s $OUT $EXP
2424
status=$?

tests/t_change_uuid_mcsum_seed_mounted/script

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@ rm -f $OUT
99
# Test command line option
1010
echo "create fs with metadata_csum" >> $OUT
1111
$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1
12-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
12+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1313

1414
echo "change UUID" >> $OUT
1515
EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
16-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
16+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
1717

1818
echo "check filesystem" >> $OUT
1919
$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
2020
echo "fsck returns $?" >> $OUT
21-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
21+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
2222

2323
echo "turn on csum seed" >> $OUT
2424
EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -O metadata_csuM_seed $TMPFILE > /dev/null 2>&1
25-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
25+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
2626

2727
echo "check filesystem" >> $OUT
2828
$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
2929
echo "fsck returns $?" >> $OUT
30-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
30+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
3131

3232
echo "change UUID" >> $OUT
3333
EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
34-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
34+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
3535

3636
echo "check filesystem" >> $OUT
3737
$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
3838
echo "fsck returns $?" >> $OUT
39-
$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
39+
$DUMPE2FS $TMPFILE 2>&1 | $EGREP '(Checksum seed:|UUID)' >> $OUT
4040

4141
cmp -s $OUT $EXP
4242
status=$?

0 commit comments

Comments
 (0)