]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: accommodate varying filefrag -v "flags" output
authorJim Meyering <meyering@redhat.com>
Fri, 11 Jun 2010 12:34:03 +0000 (14:34 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 11 Jun 2010 12:34:17 +0000 (14:34 +0200)
* tests/cp/sparse-fiemap: Accommodate values other than "eof"
in the "flags" column of filefrag -v output

tests/cp/sparse-fiemap

index dc0cf60595e51e27fad63666f12a84c5d6f2cb3c..b6b11039091ff20be9b5f188806af878a90da073 100755 (executable)
@@ -68,10 +68,11 @@ $PERL -e 1 || skip_test_ 'skipping part of this test; you lack perl'
 
 # Extract logical block number and length pairs from filefrag -v output.
 # The initial sed is to remove the "eof" from the normally-empty "flags" field.
+# Similarly, remove flags values like "unknown,delalloc,eof".
 # That is required when that final extent has no number in the "expected" field.
 f()
 {
-  sed 's/ eof$//' $@ \
+  sed 's/ [a-z,][a-z,]*$//' $@ \
     | awk '/^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END {print ""}'
 }