There is a function called do_sed_fix (called by ht_fix_all) in fixheadtails.eclass that attempts to replace any head (or tail) instance of "head -num_of_lines" with "head -n num_of_lines" Unfortunately the way the regex match is specified if the file already has the argument of the form "head -n num_lines" it will change it to "head -n n num_lines" which is not valid. (Technically it will break any argument since it matches on -.*) --- do_sed_fix() { sed -i \ -e 's/head -\(.*\)/head -n \1/' \ -e 's/tail \([-+]\)\(.*\)/tail -n \1\2/' ${1} || \ die "sed ${1} failed" } -- I'm not a regular expression master but i believe the regexes should be restricted to only matching -[:digit:]* Maybe something like: s/\(head .*\)-\([0-9]*\)/\1-n \2/ s/\(tail .*[-+]\)\([0-9]*\)/\1-n \2\3/ Reproducible: Always Steps to Reproduce: 1. have file with head -n 11 2. run ht_fix_file on file Actual Results: Changed head arguments to head -n n 11 Expected Results: left already correct arguments alone I realize if the upstream fixes their files to have the "new" argument format then ht_fix_file should no longer be run on them.....
sending to our regex master
Seems fixed, closing a stale bug.