[Tinyos-commits] CVS: tinyos-1.x/tools/src/motelist motelist-linux, 1.3, 1.4

Cory Sharp cssharp at users.sourceforge.net
Thu Sep 22 17:04:22 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/tools/src/motelist
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10421

Modified Files:
	motelist-linux 
Log Message:
Modify parse_usb_devices_text to be more generic and hopefully better support
older versions of Perl.  The problem was reported by Matt Miller from UIUC to
the tinyos-help mailing list.

The problem stems from the fact that /proc/bus/usb/devices is in a shudder
inducing format that is simultaneously hard to read both by computers and
humans.  So, any code that parses it tends to be kind of weird to match.



Index: motelist-linux
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tools/src/motelist/motelist-linux,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** motelist-linux	28 Jul 2005 05:37:53 -0000	1.3
--- motelist-linux	23 Sep 2005 00:04:20 -0000	1.4
***************
*** 157,161 ****
    my $text = shift;
    $text =~ s/^\S+\s*//gm;
!   return ($text =~ m/([^\s=]+)=\s*(.*?\S)\s*(?=[^\s=]+=|$)/mg);
  }
  
--- 157,162 ----
    my $text = shift;
    $text =~ s/^\S+\s*//gm;
!   $text =~ s/\s*(\S+=)/\001$1/g;
!   return map { m/(.*?)=(.*)/ } split /\001/;
  }
  



More information about the Tinyos-commits mailing list