mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Linux Distro specific path names
This commit is contained in:
parent
3643c48bfb
commit
2c2c6bc824
@ -25,6 +25,7 @@
|
|||||||
import pprint
|
import pprint
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import platform
|
||||||
import execute
|
import execute
|
||||||
import path
|
import path
|
||||||
|
|
||||||
@ -66,16 +67,25 @@ def load():
|
|||||||
'__tar': ('exe', 'required', '/bin/tar')
|
'__tar': ('exe', 'required', '/bin/tar')
|
||||||
}
|
}
|
||||||
variations = {
|
variations = {
|
||||||
'__bzip2': ('exe', 'required', '/bin/bzip2'), # Ubuntu
|
'Ubuntu' : {'__bzip2': ('exe', 'required', '/bin/bzip2'),
|
||||||
'__chgrp': ('exe', 'required', '/bin/chgrp'), # Ubuntu
|
'__chgrp': ('exe', 'required', '/bin/chgrp'),
|
||||||
'__chown': ('exe', 'required', '/bin/chown'), # Ubuntu
|
'__chown': ('exe', 'required', '/bin/chown'),
|
||||||
'__grep': ('exe', 'required', '/bin/grep'), # Ubuntu
|
'__grep': ('exe', 'required', '/bin/grep'),
|
||||||
'__sed': ('exe', 'required', '/bin/sed'), # Ubuntu
|
'__sed': ('exe', 'required', '/bin/sed') },
|
||||||
'__install_info': ('exe', 'required', '/sbin/install-info') # Fedora
|
'Fedora' : { '__install_info': ('exe', 'required', '/sbin/install-info') },
|
||||||
|
'Arch' : { '__gzip': ('exe', 'required', '/usr/bin/gzip') }
|
||||||
}
|
}
|
||||||
for v in variations:
|
# Works for LSB distros
|
||||||
if path.exists(variations[v][2]):
|
distro = platform.dist()[0]
|
||||||
defines[v] = variations[v]
|
# Non LSB - fail over to issue
|
||||||
|
if distro == '':
|
||||||
|
issue = open('/etc/issue').read()
|
||||||
|
distro = issue.split(' ')[0]
|
||||||
|
|
||||||
|
if variations.has_key(distro):
|
||||||
|
for v in variations[distro]:
|
||||||
|
if path.exists(variations[distro][v][2]):
|
||||||
|
defines[v] = variations[distro][v]
|
||||||
return defines
|
return defines
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user