Exemple #1
0
def match_repo_args(spec, all=False, abs=True):
    """Matches repository arguments to an actual list of repositories"""

    if all:
        return match_repos(lmh_locate("content"), abs=abs)
    elif len(spec) == 0:
        return match_repos(".", abs=abs)
    else:
        return match_repos(spec, abs=abs)
Exemple #2
0
def export(f = None):
    """Exports the list of currently installed repositories. """

    # Get all locally installed directories
    installed = match_repos(lmh_locate("content"))

    if(f == None):
        for mod in installed:
            std(mod)
        return True
    try:
        write_file(f, os.linesep.join(installed))
        return True
    except:
        err("Unable to write %s" % f)
        return False
Exemple #3
0
def export(f=None):
    """Exports the list of currently installed repositories. """

    # Get all locally installed directories
    installed = match_repos(lmh_locate("content"))

    if (f == None):
        for mod in installed:
            std(mod)
        return True
    try:
        write_file(f, os.linesep.join(installed))
        return True
    except:
        err("Unable to write %s" % f)
        return False
Exemple #4
0
def do(args, unknown):
    # If there are no repositories, check everything for dependencies.
    if len(args.spec) == 0:
        std("Nothing to install, re-installing all existing repositories.  ")
        return install(*match_repos(lmh_locate("content")))

    if not get_config("install::noglobs"):
        args.spec = ls_remote(*args.spec)
        if len(args.spec) == 0:
            err("Nothing to install...")
            return True
        if args.no_confirm_install:
            std("Picked", len(args.spec),"repositories. ")
        else:
            std("Picked", len(args.spec),"repositories: ")
            std(*args.spec)
            if read_raw("Continue (y/N)?").lower() != "y":
                err("Installation aborted. ")
                return False


    return install(*args.spec)