~ubuntu-branches/ubuntu/saucy/media-player-info/saucy

« back to all changes in this revision

Viewing changes to tools/udev-syntax-check.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-07-23 09:27:06 UTC
  • mfrom: (1.2.16)
  • Revision ID: package-import@ubuntu.com-20130723092706-h4nq0tmy29a2fhic
Tags: 19-1
* New upstream release
  - Add Motorola Droid 4 (LP: #1008812)
  - Support udev hwdb when building with udev >= 196.
* Add python3 build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
 
1
#!/usr/bin/env python3
2
2
# Simple udev rules syntax checker
3
3
#
4
4
# (C) 2010 Canonical Ltd.
22
22
import sys
23
23
 
24
24
if len(sys.argv) < 2:
25
 
    print >> sys.stderr, 'Usage: %s <rules file> [...]' % sys.argv[0]
 
25
    sys.stderr.write('Usage: %s <rules file> [...]\n' % sys.argv[0])
26
26
    sys.exit(2)
27
27
 
28
28
no_args_tests = re.compile('(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|PROGRAM|RESULT)\s*(?:=|!)=\s*"([^"]*)"$')
47
47
            if not (no_args_tests.match(clause) or args_tests.match(clause) or
48
48
                    no_args_assign.match(clause) or args_assign.match(clause)):
49
49
 
50
 
                print 'Invalid line %s:%i: "%s"' % (path, lineno, line)
 
50
                sys.stderr.write('Invalid line %s:%i: "%s"\n' % (path, lineno, line))
51
51
                sys.exit(1)
52
52
                result = 1
53
53
                break