linuxMint working and cleaner

This commit is contained in:
Tully Foote 2010-01-18 17:53:29 +00:00
parent b86f7ec00e
commit 367979b91e
2 changed files with 25 additions and 15 deletions

View File

@ -134,23 +134,17 @@ class Ubuntu(Debian):
###### END UBUNTU SPECIALIZATION ########################
###### Mint SPECIALIZATION #########################
class Mint(Debian):
class Mint(OSBase):
"""
Detect Mint variants of Debian.
"""
def check_presence(self):
try:
filename = "/etc/issue"
if os.path.exists(filename):
with open(filename, 'r') as fh:
os_list = fh.read().split()
if os_list and os_list[0] == "Linux" and os_list[1] == "Mint":
return True
except:
print "Mint failed to detect OS"
if "LinuxMint" == lsb_get_os():
return True
return False
#get_version inherited from debian
def get_version(self):
return lsb_get_version()
def get_name(self):
return "mint"

View File

@ -106,11 +106,27 @@ class Ubuntu(roslib.os_detect.Ubuntu, AptGetInstall):
###### END UBUNTU SPECIALIZATION ########################
###### Mint SPECIALIZATION #########################
class Mint(roslib.os_detect.Mint, AptGetInstall):
class Mint(AptGetInstall):
""" This is an implementation of a standard interface for
interacting with rosdep. This defines all Mint sepecific
methods, including detecting the OS/Version number. As well as
how to check for and install packages."""
interacting with rosdep. Mint is closely coupled to Ubuntu, it
will masquerade as ubuntu for the purposes of rosdep. """
def __init__(self):
self.mint_detector = roslib.os_detect.Mint()
self.version_map = {'8':'9.10',
'7':'9.04',
'6':'8.10',
'5':'8.04'}
def get_version(self):
return self.version_map[self.mint_detector.get_version()]
def get_name(self):
return 'ubuntu'
def check_presence(self):
return self.mint_detector.check_presence()
pass
###### END Mint SPECIALIZATION ########################