Example #1
0
def get_release_arch(rel):
    "Return architecture for given CMSSW release"
    args = {'release': rel}
    releases = get_data(tc_url('py_getReleaseArchitectures'), args)
    output = []
    for item in releases:
        rel_arch = item[0]
        status = item[1]
        if check_os(rel_arch):
            output.append((rel_arch, status))
    return output
Example #2
0
def get_release_arch(rel):
    "Return architecture for given CMSSW release"
    args = {'release': rel}
    releases = get_data(tc_url('py_getReleaseArchitectures'), args)
    output = []
    for item in releases:
        rel_arch = item[0]
        status   = item[1]
        if  check_os(rel_arch):
            output.append((rel_arch, status))
    return output
Example #3
0
def cms_arch(arg=None):
    """
    Show or set CMSSW architecture. Optional parameters either <all> or <list>
    Examples:
        cmssh> arch      # show current and installed architecture(s)
        cmssh> arch all  # show all known CMSSW architectures
        cmssh> arch list # show all CMSSW architectures for given platform
    """
    if not arg:
        print "Current architecture: %s" % os.environ['SCRAM_ARCH']
        archs = []
        for name in os.listdir(os.environ['VO_CMS_SW_DIR']):
            if check_os(name) and name.find('.') == -1:
                archs.append(name)
        if archs:
            print '\nInstalled architectures:'
            for item in archs:
                print item
    elif arg == 'all' or arg == 'list':
        if arg == 'all':
            print 'CMSSW architectures:'
        else:
            print 'CMSSW architectures for %s:' \
                % os.uname()[0].replace('Darwin', 'OSX')
        for name in cms_architectures('all'):
            if arg == 'all':
                print name
            else:
                if check_os(name):
                    print name
    else:
        cms_archs = cms_architectures('all')
        if arg not in cms_archs:
            msg = 'Wrong architecture, please choose from the following list\n'
            msg += ', '.join(cms_archs)
            raise Exception(msg)
        print "Switch to SCRAM_ARCH=%s" % arg
        os.environ['SCRAM_ARCH'] = arg
Example #4
0
def cms_arch(arg=None):
    """
    Show or set CMSSW architecture. Optional parameters either <all> or <list>
    Examples:
        cmssh> arch      # show current and installed architecture(s)
        cmssh> arch all  # show all known CMSSW architectures
        cmssh> arch list # show all CMSSW architectures for given platform
    """
    if  not arg:
        print "Current architecture: %s" % os.environ['SCRAM_ARCH']
        archs = []
        for name in os.listdir(os.environ['VO_CMS_SW_DIR']):
            if  check_os(name) and name.find('.') == -1:
                archs.append(name)
        if  archs:
            print '\nInstalled architectures:'
            for item in archs:
                print item
    elif arg == 'all' or arg == 'list':
        if  arg == 'all':
            print 'CMSSW architectures:'
        else:
            print 'CMSSW architectures for %s:' \
                % os.uname()[0].replace('Darwin', 'OSX')
        for name in cms_architectures('all'):
            if  arg == 'all':
                print name
            else:
                if  check_os(name):
                    print name
    else:
        cms_archs = cms_architectures('all')
        if  arg not in cms_archs:
            msg  = 'Wrong architecture, please choose from the following list\n'
            msg += ', '.join(cms_archs)
            raise Exception(msg)
        print "Switch to SCRAM_ARCH=%s" % arg
        os.environ['SCRAM_ARCH'] = arg