From: Jeff Mahoney <jeffm@xxxxxxxx> e2fsprogs versions prior to v1.42.7 had a different format for filefrag -v that is incompatible with the regex in _filefrag_filter. This patch adds support for the older format to test on older releases Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx> --- common/filter | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/common/filter b/common/filter index b4443a34..a8ddf571 100644 --- a/common/filter +++ b/common/filter @@ -528,13 +528,27 @@ _filter_filefrag() { perl -ne ' if (/blocks? of (\d+) bytes/) { + $oldfmt = 0; $blocksize = $1; - next + next; + } elsif (/\d+ blocks, blocksize (\d+)/) { + $oldfmt = 1; + $blocksize = $1; + next; + } + if ($oldfmt) { + chomp; + ($ext, $logical, $physical, $ignore, $length1, $length2, $flags) = + (/^\s*(\d+)\s+(\d+)\s+(\d+)\s+((\d+)|\d+\s+(\d+))\s+([a-z0-9,]*)$/) + or next; + $length = "$length1$length2"; + } else { + ($ext, $logical, $physical, $length) = + (/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/) + or next; + ($flags) = /.*:\s*(\S*)$/; } - ($ext, $logical, $physical, $length) = - (/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/) - or next; - ($flags) = /.*:\s*(\S*)$/; + print $physical * $blocksize, "#", $length * $blocksize, "#", $logical * $blocksize, "#", -- 2.16.4