fabfile.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:rosbots_setup_tools 作者: ROSbots 项目源码 文件源码
def _setup_ros_packages_from_git(ros_package_name, git_url, subpackage_list):
    run("echo 'Starting...'")

    home_path = run("pwd")
    git_path = home_path + "/gitspace"
    ros_package_path = git_path + "/" + ros_package_name #"/rosbots"
    ws_dir = home_path + WS_DIR
    install_dir = home_path + INSTALL_DIR

    _fp("Do we need to create gitspace folder?")
    if not fabfiles.exists(git_path):
        run("mkdir " + git_path)

    _fp("Do we need to git clone the repo?")
    if not fabfiles.exists(ros_package_path):
        _fp("Did not find " + ros_package_name + " repo, cloning...")
        with cd(git_path):
            run("git clone " + git_url)

        _fp("Creating symbolic link to main ros workspace")
        with cd(ws_dir + "/src"):
            if fabfiles.exists(ros_package_name):
                run("rm " + ros_package_name)
            run("ln -s " + ros_package_path)
    else:
        #_fp("Found the repo, just fetching top and rebasing")
        #with cd(ros_package_path):
        #    run("git fetch origin")
        #    run("git rebase origin/master")
        _pp("Found the repo, not doing anything - feel free to git fetch and rebase manually")

    for subpackage in subpackage_list:
        _fp("Compiling " + subpackage + "...")
        with cd(ws_dir):
            run("./src/catkin/bin/catkin_make_isolated --pkg " + subpackage + " --install -DCMAKE_BUILD_TYPE=Release --install-space " + install_dir + " -j1")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号