mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Add distro aliases to group similar types.
This commit is contained in:
@@ -50,6 +50,7 @@ def load():
|
|||||||
cpu = 'arm'
|
cpu = 'arm'
|
||||||
else:
|
else:
|
||||||
cpu = uname[4]
|
cpu = uname[4]
|
||||||
|
|
||||||
defines = {
|
defines = {
|
||||||
'_os': ('none', 'none', 'linux'),
|
'_os': ('none', 'none', 'linux'),
|
||||||
'_host': ('triplet', 'required', cpu + '-linux-gnu'),
|
'_host': ('triplet', 'required', cpu + '-linux-gnu'),
|
||||||
@@ -66,25 +67,41 @@ def load():
|
|||||||
'__gzip': ('exe', 'required', '/bin/gzip'),
|
'__gzip': ('exe', 'required', '/bin/gzip'),
|
||||||
'__tar': ('exe', 'required', '/bin/tar')
|
'__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') }
|
|
||||||
}
|
|
||||||
# Works for LSB distros
|
# Works for LSB distros
|
||||||
distro = platform.dist()[0]
|
distro = platform.dist()[0]
|
||||||
|
|
||||||
# Non LSB - fail over to issue
|
# Non LSB - fail over to issue
|
||||||
if distro == '':
|
if distro == '':
|
||||||
try:
|
try:
|
||||||
issue = open('/etc/issue').read()
|
issue = open('/etc/issue').read()
|
||||||
distro = issue.split(' ')[0]
|
distro = issue.split(' ')[0]
|
||||||
except:
|
except:
|
||||||
distro = 'Ubuntu'
|
pass
|
||||||
|
|
||||||
|
# Manage distro aliases
|
||||||
|
if distro in ['centos', 'fedora']:
|
||||||
|
distro = 'redhat'
|
||||||
|
if distro in ['Ubuntu', 'ubuntu']:
|
||||||
|
distro = 'debian'
|
||||||
|
if distro in ['Arch']:
|
||||||
|
distro = 'arch'
|
||||||
|
|
||||||
|
variations = {
|
||||||
|
'debian' : { '__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') },
|
||||||
|
'redhat' : { '__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'),
|
||||||
|
'__install_info': ('exe', 'required', '/sbin/install-info') },
|
||||||
|
'arch' : { '__gzip': ('exe', 'required', '/usr/bin/gzip'),
|
||||||
|
'__chown': ('exe', 'required', '/usr/bin/chown') },
|
||||||
|
}
|
||||||
|
|
||||||
if variations.has_key(distro):
|
if variations.has_key(distro):
|
||||||
for v in variations[distro]:
|
for v in variations[distro]:
|
||||||
|
Reference in New Issue
Block a user