[Sugar-devel] Sugar-jhbuild function get_distribtuion

dhananjay mb.dhananjay at gmail.com
Thu Dec 9 03:58:19 EST 2010


Hi,

Sugar-jhbuild depends on lsb-release to decide the distribtuion. But there
are some distros which are not lsb-release compatable, for eg Archlinux. Can
anyone sugest any another general procedure by which we can decide the
distribution?



file: sjhbuild/sysdeps.py
...
def get_distribution():
    global _cached_dname, _cached_dversion

    if _cached_dname:
        return _cached_dname, _cached_dversion

    if 'SJH_DISTRIBUTION' in os.environ:
        _cached_dname, _cached_dversion = \
            os.environ['SJH_DISTRIBUTION'].split('-')
        return _cached_dname, _cached_dversion

    try:
        _cached_dname = _pipe_lower(['lsb_release', '-is'])
        _cached_dversion = _pipe_lower(['lsb_release', '-rs'])

    except OSError:
        sys.stderr.write('ERROR: Could not run lsb_release. Is it
installed?\n')

    return _cached_dname, _cached_dversion


-- 
Regards,

Dhananjay.

----------------------------------------------
Use Free Software...
Defend Your Freedom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20101209/da6fcb1e/attachment.html>


More information about the Sugar-devel mailing list