mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Remove tabs. Add a safe way to default to a distro.
This commit is contained in:
parent
2feb624768
commit
c3ab00c2a4
@ -67,21 +67,24 @@ def load():
|
||||
'__tar': ('exe', 'required', '/bin/tar')
|
||||
}
|
||||
variations = {
|
||||
'Ubuntu' : {'__bzip2': ('exe', 'required', '/bin/bzip2'),
|
||||
'__chgrp': ('exe', 'required', '/bin/chgrp'),
|
||||
'__chown': ('exe', 'required', '/bin/chown'),
|
||||
'__grep': ('exe', 'required', '/bin/grep'),
|
||||
'__sed': ('exe', 'required', '/bin/sed') },
|
||||
'Fedora' : { '__install_info': ('exe', 'required', '/sbin/install-info') },
|
||||
'Arch' : { '__gzip': ('exe', 'required', '/usr/bin/gzip'),
|
||||
'__chown': ('exe', 'required', '/usr/bin/chown') }
|
||||
'Ubuntu' : {'__bzip2': ('exe', 'required', '/bin/bzip2'),
|
||||
'__chgrp': ('exe', 'required', '/bin/chgrp'),
|
||||
'__chown': ('exe', 'required', '/bin/chown'),
|
||||
'__grep': ('exe', 'required', '/bin/grep'),
|
||||
'__sed': ('exe', 'required', '/bin/sed') },
|
||||
'Fedora' : { '__install_info': ('exe', 'required', '/sbin/install-info') },
|
||||
'Arch' : { '__gzip': ('exe', 'required', '/usr/bin/gzip'),
|
||||
'__chown': ('exe', 'required', '/usr/bin/chown') }
|
||||
}
|
||||
# Works for LSB distros
|
||||
distro = platform.dist()[0]
|
||||
# Non LSB - fail over to issue
|
||||
if distro == '':
|
||||
issue = open('/etc/issue').read()
|
||||
distro = issue.split(' ')[0]
|
||||
try:
|
||||
issue = open('/etc/issue').read()
|
||||
distro = issue.split(' ')[0]
|
||||
except:
|
||||
distro = 'Ubuntu'
|
||||
|
||||
if variations.has_key(distro):
|
||||
for v in variations[distro]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user