Exemplo n.º 1
0
def installed_releases():
    "Print a list of releases installed on a system"
    _osname, osarch = osparameters()
    releases = []
    for idir in os.listdir(os.environ['VO_CMS_SW_DIR']):
        if idir.find(osarch) != -1:
            rdir = os.path.join(\
                os.environ['VO_CMS_SW_DIR'], '%s/cms/cmssw' % idir)
            if os.path.isdir(rdir):
                for rel in os.listdir(rdir):
                    releases.append('%s/%s' % (rel, idir))
    if releases:
        releases.sort()
        print "\nInstalled releases:"
        for rel in releases:
            print rel
    else:
        msg = "\nYou don't have yet CMSSW release installed on your system."
        msg += "\nPlease use " + msg_green('install CMSSW_X_Y_Z') \
                + ' command to install one'
        print msg
Exemplo n.º 2
0
def installed_releases():
    "Print a list of releases installed on a system"
    _osname, osarch = osparameters()
    releases = []
    for idir in os.listdir(os.environ['VO_CMS_SW_DIR']):
        if  idir.find(osarch) != -1:
            rdir = os.path.join(\
                os.environ['VO_CMS_SW_DIR'], '%s/cms/cmssw' % idir)
            if  os.path.isdir(rdir):
                for rel in os.listdir(rdir):
                    releases.append('%s/%s' % (rel, idir))
    if  releases:
        releases.sort()
        print "\nInstalled releases:"
        for rel in releases:
            print rel
    else:
        msg  = "\nYou don't have yet CMSSW release installed on your system."
        msg += "\nPlease use " + msg_green('install CMSSW_X_Y_Z') \
                + ' command to install one'
        print msg
Exemplo n.º 3
0
def check_release_arch(rel):
    "Check release/architecture"
    # check if given release name is installed on user system
    rel_dir = '%s/cms/cmssw/%s' % (os.environ['SCRAM_ARCH'], rel)
    if os.path.isdir(os.path.join(os.environ['VO_CMS_SW_DIR'], rel_dir)):
        return 'ok'

    output = []
    for arch, status in get_release_arch(rel):
        if not status:
            msg = '%s release is not officially supported under %s' \
                % (rel, arch)
            print_warning(msg)
        if arch != os.environ['SCRAM_ARCH']:
            msg = 'Your SCRAM_ARCH=%s, while found arch=%s' \
                % (os.environ['SCRAM_ARCH'], arch)
            print_warning(msg)
        msg = '\n%s/%s is not installed within cmssh, proceed' \
                % (rel, arch)
        if user_input(msg, default='N'):
            os.environ['SCRAM_ARCH'] = arch
            if  not os.path.isdir(\
                os.path.join(os.environ['VO_CMS_SW_DIR'], arch)):
                bootstrap(arch)
            return 'ok'
        else:
            msg = '%s/%s rejected by user' % (rel, arch)
            output.append(msg)

    if output:
        return ', '.join(output)

    osname, osarch = osparameters()
    if osname == 'osx' and osarch == 'ia32':
        return 'OSX/ia32 is not supported in CMSSW'
    return 'no match'
Exemplo n.º 4
0
def check_release_arch(rel):
    "Check release/architecture"
    # check if given release name is installed on user system
    rel_dir = '%s/cms/cmssw/%s' % (os.environ['SCRAM_ARCH'], rel)
    if  os.path.isdir(os.path.join(os.environ['VO_CMS_SW_DIR'], rel_dir)):
        return 'ok'

    output = []
    for arch, status in get_release_arch(rel):
        if  not status:
            msg = '%s release is not officially supported under %s' \
                % (rel, arch)
            print_warning(msg)
        if  arch != os.environ['SCRAM_ARCH']:
            msg = 'Your SCRAM_ARCH=%s, while found arch=%s' \
                % (os.environ['SCRAM_ARCH'], arch)
            print_warning(msg)
        msg = '\n%s/%s is not installed within cmssh, proceed' \
                % (rel, arch)
        if  user_input(msg, default='N'):
            os.environ['SCRAM_ARCH'] = arch
            if  not os.path.isdir(\
                os.path.join(os.environ['VO_CMS_SW_DIR'], arch)):
                bootstrap(arch)
            return 'ok'
        else:
            msg = '%s/%s rejected by user' % (rel, arch)
            output.append(msg)

    if  output:
        return ', '.join(output)

    osname, osarch = osparameters()
    if  osname == 'osx' and osarch == 'ia32':
        return 'OSX/ia32 is not supported in CMSSW'
    return 'no match'