Commit fae833d5 authored by Martín Ferrari's avatar Martín Ferrari

Fix the linux version extractor, to cope with two-component version numbers (e.g. 3.10).

parent 282625fc
...@@ -6,7 +6,7 @@ from distutils.core import setup, Extension, Command ...@@ -6,7 +6,7 @@ from distutils.core import setup, Extension, Command
setup( setup(
name = 'nemu', name = 'nemu',
version = '0.1', version = '0.2',
description = 'A lightweight network emulator embedded in a small ' description = 'A lightweight network emulator embedded in a small '
'python library.', 'python library.',
author = 'Martín Ferrari, Alina Quereilhac', author = 'Martín Ferrari, Alina Quereilhac',
......
...@@ -62,8 +62,10 @@ def get_devs_netns(node): ...@@ -62,8 +62,10 @@ def get_devs_netns(node):
return process_ipcmd(out) return process_ipcmd(out)
def make_linux_ver(string): def make_linux_ver(string):
match = re.match(r'(\d+)\.(\d+)\.(\d+)(.*)', string) match = re.match(r'(\d+)\.(\d+)(?:\.(\d+))?(.*)', string)
version, patchlevel, sublevel, extraversion = match.groups() version, patchlevel, sublevel, extraversion = match.groups()
if not sublevel:
sublevel = 0
return (int(version) << 16) + (int(patchlevel) << 8) + int(sublevel) return (int(version) << 16) + (int(patchlevel) << 8) + int(sublevel)
def get_linux_ver(): def get_linux_ver():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment