Revision 9c0ed88c

View differences:

Makefile
17 17

  
18 18
codecheck: $(PYSRC)
19 19
	-echo "Running code check"
20
	util/versioncheck.py
20 21
	pyflakes $(PYSRC)
21 22
	pylint --rcfile=.pylint $(PYSRC)
22 23
	pep8 --repeat --ignore=$(P8IGN) $(PYSRC)
util/versioncheck.py
1
#!/usr/bin/python
2

  
3
from subprocess import check_output as co
4
from sys import exit
5

  
6
# Actually run bin/mn rather than importing via python path
7
version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )
8
version = version.strip()
9

  
10
# Find all Mininet path references
11
lines = co( "grep -or 'Mininet \w\.\w\.\w\w*' *", shell=True )
12

  
13
error = False
14

  
15
for line in lines.split( '\n' ):
16
    if line and 'Binary' not in line:
17
        fname, fversion = line.split( ':' )
18
        if version != fversion:
19
            print "%s: incorrect version '%s' (should be '%s')" % (
20
                fname, fversion, version )
21
            error = True
22

  
23
if error:
24
    exit( 1 )

Also available in: Unified diff