Beispiel #1
0
def clean():
    """ Remove all downloaded packages """
    logger.info("[Deleting] remove java libs in %s" % get_lib_path())
    shutil.rmtree(get_lib_path())
    index_manager.remove_all()
    index_manager.commit()
    logger.info("[Finished] all downloaded files erased")
Beispiel #2
0
def _install(artifacts, exclusions=[], options={}):
    dryrun = options.get("dry-run", False)
    _exclusions = options.get('exclude', [])
    if _exclusions:
        _exclusions = map(lambda x: Artifact(*(x.split(":"))), _exclusions)
        exclusions.extend(_exclusions)

    download_list = _resolve_artifacts(artifacts, exclusions)
    
    if not dryrun:
        ## download to cache first
        for artifact in download_list:
            if artifact.repos != cache_manager.as_repos():
                artifact.repos.download_jar(artifact, 
                        cache_manager.get_jar_path(artifact))
        pool.join()
        for artifact in download_list:
            cache_manager.get_artifact_jar(artifact, get_lib_path())

        index_manager.commit()
        logger.info("[Finished] dependencies resolved")
    else:
        logger.info("[Install] Artifacts to install:")
        for artifact in download_list:
            print artifact
Beispiel #3
0
def clean():
    """ Remove all downloaded packages """
    logger.info("[Deleting] remove java libs in %s" % get_lib_path())
    shutil.rmtree(get_lib_path())
    index_manager.remove_all()
    index_manager.commit()
    logger.info("[Finished] all downloaded files erased")
Beispiel #4
0
def _install(artifacts, exclusions=[], options={}):
    dryrun = options.get("dry-run", False)
    verify = not options.get("insecure", True)
    _exclusions = options.get('exclude', [])
    copy_pom = options.get('copy-pom', False)
    if _exclusions:
        _exclusions = map(lambda x: Artifact(*(x.split(":"))), _exclusions)
        exclusions.extend(_exclusions)

    download_list = _resolve_artifacts(artifacts, exclusions, verify)

    if not dryrun:
        ## download to cache first
        for artifact in download_list:
            if artifact.repos != cache_manager.as_repos():
                artifact.repos.download_jar(
                    artifact, cache_manager.get_jar_path(artifact), verify)
        pool.join()
        for artifact in download_list:
            cache_manager.get_artifact_jar(artifact, get_lib_path())
            if copy_pom:
                cache_manager.get_artifact_pom(artifact, get_lib_path())

        index_manager.commit()
        logger.info("[Finished] dependencies resolved")
    else:
        logger.info("[Install] Artifacts to install:")
        for artifact in download_list:
            logger.info(artifact)
Beispiel #5
0
def remove(artifact_id):
    """ Remove an artifact from library path """
    logger.info('[Checking] %s in library index' % artifact_id)
    artifact = Artifact.from_id(artifact_id)
    artifact_path = os.path.join(get_lib_path(), artifact.to_jip_name())

    if index_manager.is_installed(artifact) and os.path.exists(artifact_path):
        os.remove(artifact_path)
        index_manager.remove_artifact(artifact)
        index_manager.commit()
        logger.info('[Finished] %s removed from library path' % artifact_id)
    else:
        logger.error('[Error] %s not installed' % artifact_id)
        sys.exit(1)
Beispiel #6
0
def remove(artifact_id):
    """ Remove an artifact from library path """
    logger.info('[Checking] %s in library index' % artifact_id)
    artifact = Artifact.from_id(artifact_id)
    artifact_path = os.path.join(get_lib_path(), artifact.to_jip_name())

    if index_manager.is_installed(artifact) and os.path.exists(artifact_path):
        os.remove(artifact_path)
        index_manager.remove_artifact(artifact)
        index_manager.commit()
        logger.info('[Finished] %s removed from library path' % artifact_id)
    else:
        logger.error('[Error] %s not installed' % artifact_id)
        sys.exit(1)