Ejemplo n.º 1
0
def main():
    # sudo apt-get install -y exuberant-ctags
    if sys.platform.startswith("win32"):
        try:
            ensure_ctags_win32()
        except Exception:
            print("failed to get ctags.exe for win32")
            pass

    PULL = "--pull" in sys.argv

    BUNDLE_DPATH = util_git1.BUNDLE_DPATH
    ensuredir(BUNDLE_DPATH)
    VIM_REPOS_WITH_SUBMODULES = util_git1.VIM_REPOS_WITH_SUBMODULES
    VIM_REPO_URLS = util_git1.VIM_REPO_URLS
    VIM_REPO_DIRS = util_git1.get_repo_dirs(VIM_REPO_URLS, BUNDLE_DPATH)
    # All modules in the bundle dir (even if not listed)
    BUNDLE_DIRS = [join(BUNDLE_DPATH, name) for name in os.listdir(BUNDLE_DPATH)]

    cd(BUNDLE_DPATH)

    util_git1.checkout_repos(VIM_REPO_URLS, VIM_REPO_DIRS)

    __NOT_GIT_REPOS__ = []
    __BUNDLE_REPOS__ = []

    for repodir in BUNDLE_DIRS:
        # Mark which repos do not have .git dirs
        if not util_git1.is_gitrepo(repodir):
            __NOT_GIT_REPOS__.append(repodir)
        else:
            __BUNDLE_REPOS__.append(repodir)

    if PULL:
        util_git1.pull_repos(__BUNDLE_REPOS__, VIM_REPOS_WITH_SUBMODULES)

    ensure_nongit_plugins()

    # Print suggestions for removing nonbundle repos
    if len(__NOT_GIT_REPOS__) > 0:
        print("Please fix these nongit repos: ")
        print("\n".join(__NOT_GIT_REPOS__))
        print("maybe like this: ")
        clutterdir = util_git1.unixpath("~/local/vim/vimfiles/clutter")
        suggested_cmds = ["mkdir " + clutterdir] + [
            "mv " + util_git1.unixpath(dir_) + " " + clutterdir for dir_ in __NOT_GIT_REPOS__
        ]
        print("\n".join(suggested_cmds))
Ejemplo n.º 2
0
def main():
    # sudo apt-get install -y exuberant-ctags
    if sys.platform.startswith('win32'):
        try:
            ensure_ctags_win32()
        except Exception:
            print('failed to get ctags.exe for win32')
            pass

    PULL = '--pull' in sys.argv

    BUNDLE_DPATH = util_git1.BUNDLE_DPATH
    ensuredir(BUNDLE_DPATH)
    VIM_REPOS_WITH_SUBMODULES = util_git1.VIM_REPOS_WITH_SUBMODULES
    VIM_REPO_URLS = util_git1.VIM_REPO_URLS
    VIM_REPO_DIRS = util_git1.get_repo_dirs(VIM_REPO_URLS, BUNDLE_DPATH)
    # All modules in the bundle dir (even if not listed)
    BUNDLE_DIRS = [join(BUNDLE_DPATH, name) for name in os.listdir(BUNDLE_DPATH)]

    cd(BUNDLE_DPATH)

    util_git1.checkout_repos(VIM_REPO_URLS, VIM_REPO_DIRS)

    __NOT_GIT_REPOS__ = []
    __BUNDLE_REPOS__  = []

    for repodir in BUNDLE_DIRS:
        # Mark which repos do not have .git dirs
        if not util_git1.is_gitrepo(repodir):
            __NOT_GIT_REPOS__.append(repodir)
        else:
            __BUNDLE_REPOS__.append(repodir)

    if PULL:
        util_git1.pull_repos(__BUNDLE_REPOS__, VIM_REPOS_WITH_SUBMODULES)

    ensure_nongit_plugins()

    # Print suggestions for removing nonbundle repos
    if len(__NOT_GIT_REPOS__) > 0:
        print('Please fix these nongit repos: ')
        print('\n'.join(__NOT_GIT_REPOS__))
        print('maybe like this: ')
        clutterdir = util_git1.unixpath('~/local/vim/vimfiles/clutter')
        suggested_cmds = (
            ['mkdir ' + clutterdir] +
            ['mv ' + util_git1.unixpath(dir_) + ' ' + clutterdir for dir_ in __NOT_GIT_REPOS__])
        print('\n'.join(suggested_cmds))
Ejemplo n.º 3
0
def main():
    # sudo apt-get install -y exuberant-ctags
    if sys.platform.startswith('win32'):
        try:
            ensure_ctags_win32()
        except Exception:
            print('failed to get ctags.exe for win32')
            pass

    import REPOS1
    import util_git1
    from meta_util_git1 import get_repo_dirs
    from meta_util_git1 import cd

    BUNDLE_DPATH = REPOS1.BUNDLE_DPATH
    ensuredir(BUNDLE_DPATH)
    VIM_REPOS_WITH_SUBMODULES = REPOS1.VIM_REPOS_WITH_SUBMODULES
    VIM_REPO_URLS = REPOS1.VIM_REPO_URLS
    VIM_REPO_DIRS = get_repo_dirs(VIM_REPO_URLS, BUNDLE_DPATH)
    # All modules in the bundle dir (even if not listed)
    import os
    BUNDLE_DIRS = [join(BUNDLE_DPATH, name)
                   for name in os.listdir(BUNDLE_DPATH)]

    cd(BUNDLE_DPATH)

    print('VIM_REPO_DIRS = {!r}'.format(VIM_REPO_DIRS))
    print('VIM_REPO_URLS = {!r}'.format(VIM_REPO_URLS))
    # util_git1.checkout_repos(VIM_REPO_URLS, VIM_REPO_DIRS)
    import ubelt as ub
    for repodir, repourl in zip(VIM_REPO_DIRS, VIM_REPO_URLS):
        print('[git] checkexist: ' + repodir)
        if not exists(repodir):
            cd(dirname(repodir))
            ub.cmd('git clone ' + repourl, verbose=3)

    __NOT_GIT_REPOS__ = []
    __BUNDLE_REPOS__  = []

    for repodir in BUNDLE_DIRS:
        # Mark which repos do not have .git dirs
        if not util_git1.is_gitrepo(repodir):
            __NOT_GIT_REPOS__.append(repodir)
        else:
            __BUNDLE_REPOS__.append(repodir)

    if ub.argflag('--pull'):
        util_git1.pull_repos(__BUNDLE_REPOS__, VIM_REPOS_WITH_SUBMODULES)

    ensure_nongit_plugins()

    # Print suggestions for removing nonbundle repos
    if len(__NOT_GIT_REPOS__) > 0:
        print('Please fix these nongit repos: ')
        print('\n'.join(__NOT_GIT_REPOS__))
        print('maybe like this: ')
        clutterdir = util_git1.unixpath('~/local/vim/vimfiles/clutter')
        suggested_cmds = (
            ['mkdir ' + clutterdir] +
            ['mv ' + util_git1.unixpath(dir_) + ' ' + clutterdir for dir_ in __NOT_GIT_REPOS__])
        print('\n'.join(suggested_cmds))

    # Hack for nerd fonts
    # """
    # cd ~/local/vim/vimfiles/bundle
    # # git clone https://github.com/ryanoasis/nerd-fonts.git --depth 1
    # https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
    # https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
    # """

    # HACK FOR JEDI

    import os
    for repo in VIM_REPOS_WITH_SUBMODULES:
        cd(join(BUNDLE_DPATH, repo))
        command = 'git submodule update --init --recursive'
        try:
            import ubelt as ub
            ub.cmd(command, verbose=2)
        except Exception:
            os.system(command)
Ejemplo n.º 4
0
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import sys
import util_git1
import REPOS1

# Get IBEIS git repository URLS and their local path
ibeis_repo_urls = REPOS1.CODE_REPO_URLS
ibeis_repo_dirs = REPOS1.CODE_REPOS


if __name__ == '__main__':
    if '--nocheck' not in sys.argv:
        # Checkout IBEIS repos out if they don't exist
        # util_git1.checkout_repos(ibeis_repo_urls, ibeis_repo_dirs)
        util_git1.checkout_repos(*REPOS1.CODE_REPO_TUP)
        util_git1.checkout_repos(*REPOS1.LATEX_REPO_TUP)
    if '--pull' in sys.argv:
        # Pull IBEIS repos
        util_git1.pull_repos(ibeis_repo_dirs)
    if '--develop' in sys.argv:
        # Install with setuptools using the develop flag
        util_git1.setup_develop_repos(ibeis_repo_dirs)
Ejemplo n.º 5
0
def main():
    # sudo apt-get install -y exuberant-ctags
    if sys.platform.startswith('win32'):
        try:
            ensure_ctags_win32()
        except Exception:
            print('failed to get ctags.exe for win32')
            pass

    PULL = '--pull' in sys.argv

    BUNDLE_DPATH = util_git1.BUNDLE_DPATH
    ensuredir(BUNDLE_DPATH)
    VIM_REPOS_WITH_SUBMODULES = util_git1.VIM_REPOS_WITH_SUBMODULES
    VIM_REPO_URLS = util_git1.VIM_REPO_URLS
    VIM_REPO_DIRS = util_git1.get_repo_dirs(VIM_REPO_URLS, BUNDLE_DPATH)
    # All modules in the bundle dir (even if not listed)
    import os
    BUNDLE_DIRS = [join(BUNDLE_DPATH, name) for name in os.listdir(BUNDLE_DPATH)]

    cd(BUNDLE_DPATH)

    util_git1.checkout_repos(VIM_REPO_URLS, VIM_REPO_DIRS)

    __NOT_GIT_REPOS__ = []
    __BUNDLE_REPOS__  = []

    for repodir in BUNDLE_DIRS:
        # Mark which repos do not have .git dirs
        if not util_git1.is_gitrepo(repodir):
            __NOT_GIT_REPOS__.append(repodir)
        else:
            __BUNDLE_REPOS__.append(repodir)

    if PULL:
        util_git1.pull_repos(__BUNDLE_REPOS__, VIM_REPOS_WITH_SUBMODULES)

    ensure_nongit_plugins()

    # Print suggestions for removing nonbundle repos
    if len(__NOT_GIT_REPOS__) > 0:
        print('Please fix these nongit repos: ')
        print('\n'.join(__NOT_GIT_REPOS__))
        print('maybe like this: ')
        clutterdir = util_git1.unixpath('~/local/vim/vimfiles/clutter')
        suggested_cmds = (
            ['mkdir ' + clutterdir] +
            ['mv ' + util_git1.unixpath(dir_) + ' ' + clutterdir for dir_ in __NOT_GIT_REPOS__])
        print('\n'.join(suggested_cmds))

    # Hack for nerd fonts
    # """
    # cd ~/local/vim/vimfiles/bundle
    # # git clone https://github.com/ryanoasis/nerd-fonts.git --depth 1
    # https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
    # https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
    # """

    # HACK FOR JEDI

    import os
    for repo in VIM_REPOS_WITH_SUBMODULES:
        cd(join(BUNDLE_DPATH, repo))
        command = 'git submodule update --init --recursive'
        try:
            import ubelt as ub
            ub.cmd(command, verbout=1, verbose=2)
        except Exception:
            os.system(command)