diff options
author | Chris Johns <chrisj@rtems.org> | 2013-03-15 16:15:23 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2013-03-15 16:15:23 +1100 |
commit | c3ab00c2a4d844dd8ca35ba13e93c9aaade6a64b (patch) | |
tree | b85fc3ab4e12141eae6dcf0b30514dfc27e395d4 /source-builder/sb/linux.py | |
parent | Arch specific additions (diff) | |
download | rtems-source-builder-c3ab00c2a4d844dd8ca35ba13e93c9aaade6a64b.tar.bz2 |
Remove tabs. Add a safe way to default to a distro.
Diffstat (limited to 'source-builder/sb/linux.py')
-rw-r--r-- | source-builder/sb/linux.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source-builder/sb/linux.py b/source-builder/sb/linux.py index 77d18ca..451ed6b 100644 --- a/source-builder/sb/linux.py +++ b/source-builder/sb/linux.py @@ -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]: |