Show
Ignore:
Timestamp:
02/11/18 01:43:53 (6 years ago)
Author:
jwoithe
Message:

ffado-diag: correct regex used to find firewire controllers in lspci output.

The previous re.findall() regex expected the PCI bus ID to be within literal
parentheses, while the intent was probably to specify a subexpression (or
"group" as python calls it).

When a subexpression (group) is included in the regex passed to
re.findall(), the values produced re.findall() are the contents of the
subexpression. A call to the group() method is not required.

These changes have been tested on python2.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/tools/ffado-diag.in

    r2753 r2763  
    147147show_pair ("lspci", lspci) 
    148148if lspci: 
    149     for m in re.findall ("^\([^ ]*\).*1394.*", stdout (lspci), re.MULTILINE): 
    150         indent (stdout (lspci, "-vv", "-nn", "-s", m.group (1))) 
     149    for m in re.findall ("^([^ ]*).*1394.*", stdout (lspci), re.MULTILINE): 
     150        indent (stdout (lspci, "-vv", "-nn", "-s", m)) 
    151151 
    152152lscpu = which ("lscpu")