Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
87405224
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
87405224
编写于
1月 05, 2021
作者:
S
storypku
提交者:
Liu Jiaming
1月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scripts: introduce pathprepend & pathappend & pathremove functions
上级
75f7c433
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
25 deletion
+60
-25
cyber/setup.bash
cyber/setup.bash
+3
-4
scripts/apollo.bashrc
scripts/apollo.bashrc
+4
-12
scripts/apollo_base.sh
scripts/apollo_base.sh
+3
-9
scripts/common.bashrc
scripts/common.bashrc
+50
-0
未找到文件。
cyber/setup.bash
浏览文件 @
87405224
...
...
@@ -16,18 +16,17 @@ service_path="${cyber_tool_path}/cyber_service"
monitor_path
=
"
${
cyber_tool_path
}
/cyber_monitor"
visualizer_path
=
"
${
bazel_bin_path
}
/modules/tools/visualizer"
# TODO(all): place all these in one place and
add_to_path
# TODO(all): place all these in one place and
pathprepend
for
entry
in
"
${
mainboard_path
}
"
\
"
${
recorder_path
}
"
"
${
monitor_path
}
"
\
"
${
channel_path
}
"
"
${
node_path
}
"
\
"
${
service_path
}
"
\
"
${
launch_path
}
"
\
"
${
visualizer_path
}
"
;
do
add_to_path
"
${
entry
}
"
pathprepend
"
${
entry
}
"
done
# ${CYBER_PATH}/python
export
PYTHONPATH
=
${
bazel_bin_path
}
/cyber/python/internal:
${
PYTHONPATH
}
pathprepend
${
bazel_bin_path
}
/cyber/python/internal PYTHONPATH
export
CYBER_DOMAIN_ID
=
80
export
CYBER_IP
=
127.0.0.1
...
...
scripts/apollo.bashrc
浏览文件 @
87405224
...
...
@@ -31,6 +31,9 @@ export APOLLO_CACHE_DIR="${APOLLO_ROOT_DIR}/.cache"
export
APOLLO_SYSROOT_DIR
=
"/opt/apollo/sysroot"
export
TAB
=
" "
# 4 spaces
source
${
APOLLO_ROOT_DIR
}
/scripts/common.bashrc
:
${
VERBOSE
:
=yes
}
BOLD
=
'\033[1m'
...
...
@@ -209,17 +212,6 @@ function find_prettier_srcs() {
-or
-name
"*.yml"
}
## Prevent multiple entries of my_bin_path in PATH
function
add_to_path
()
{
if
[
-z
"
$1
"
]
;
then
return
fi
local
my_bin_path
=
"
$1
"
if
[
-n
"
${
PATH
##*
${
my_bin_path
}}
"
]
&&
[
-n
"
${
PATH
##*
${
my_bin_path
}
:
*
}
"
]
;
then
export
PATH
=
$PATH
:
${
my_bin_path
}
fi
}
## Prevent multiple entries of my_libdir in LD_LIBRARY_PATH
function
add_to_ld_library_path
()
{
if
[
-z
"
$1
"
]
;
then
...
...
@@ -290,7 +282,7 @@ function optarg_check_for_opt() {
function
setup_gpu_support
()
{
if
[
-e
/usr/local/cuda/
]
;
then
add_to_path
"/usr/local/cuda/bin"
pathprepend /usr/local/cuda/bin
fi
determine_gpu_use_target
...
...
scripts/apollo_base.sh
浏览文件 @
87405224
...
...
@@ -24,15 +24,9 @@ HOST_ARCH="$(uname -m)"
function
set_lib_path
()
{
local
CYBER_SETUP
=
"
${
APOLLO_ROOT_DIR
}
/cyber/setup.bash"
[
-e
"
${
CYBER_SETUP
}
"
]
&&
.
"
${
CYBER_SETUP
}
"
# TODO(storypku):
# /usr/local/apollo/local_integ/lib
# FIXME(all): remove PYTHONPATH settings
export
PYTHONPATH
=
"
${
APOLLO_ROOT_DIR
}
/modules/tools:
${
PYTHONPATH
}
"
# Set teleop paths
export
PYTHONPATH
=
"
${
APOLLO_ROOT_DIR
}
/modules/teleop/common:
${
PYTHONPATH
}
"
add_to_path
"/apollo/modules/teleop/common/scripts"
pathprepend
${
APOLLO_ROOT_DIR
}
/modules/tools PYTHONPATH
pathprepend
${
APOLLO_ROOT_DIR
}
/modules/teleop/common PYTHONPATH
pathprepend /apollo/modules/teleop/common/scripts
}
function
create_data_dir
()
{
...
...
docker/build/installers/install_golang.sh
→
scripts/common.bashrc
100755 → 100644
浏览文件 @
87405224
#!/usr/bin/env bash
#! /usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo Authors. All Rights Reserved.
#
...
...
@@ -16,40 +15,36 @@
# limitations under the License.
###############################################################################
# Fail on first error.
set
-e
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
.
./installer_base.sh
VERSION
=
"1.14.4"
ARCH
=
"
$(
uname
-m
)
"
if
[[
"
${
ARCH
}
"
==
"x86_64"
]]
;
then
PKG_NAME
=
"go
${
VERSION
}
.linux-amd64.tar.gz"
CHECKSUM
=
"b518f21f823759ee30faddb1f623810a432499f050c9338777523d9c8551c62c"
elif
[[
"
${
ARCH
}
"
==
"aarch64"
]]
;
then
PKG_NAME
=
"go
${
VERSION
}
.linux-arm64.tar.gz"
CHECKSUM
=
"05dc46ada4e23a1f58e72349f7c366aae2e9c7a7f1e7653095538bc5bba5e077"
else
error
"Unsupported arch:
${
ARCH
}
. Exiting..."
exit
1
fi
DOWNLOAD_LINK
=
"https://dl.google.com/go/
${
PKG_NAME
}
"
download_if_not_cached
"
$PKG_NAME
"
"
$CHECKSUM
"
"
$DOWNLOAD_LINK
"
tar
xzf
${
PKG_NAME
}
-C
"
${
PKGS_DIR
}
"
GOROOT
=
"
${
PKGS_DIR
}
/go"
MY_TEXT
=
"""
export GOROOT=
${
GOROOT
}
if [ -x
\"\$
{GOROOT}/bin/go
\"
]; then
add_to_path
\"\$
{GOROOT}/bin
\"
fi
"""
echo
"
${
MY_TEXT
}
"
|
tee
-a
"
${
APOLLO_PROFILE
}
"
ok
"Successfully installed go
${
VERSION
}
to
${
GOROOT
}
"
# clean up.
rm
-fr
"
${
PKG_NAME
}
"
# Ref: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>
# modifications by Dagmar d'Surreal <rivyqntzne@pbzpnfg.arg>
# Functions to help us manage paths. Second argument is the name of the
# path variable to be modified (default: PATH)
pathremove
()
{
local
IFS
=
':'
local
NEWPATH
local
DIR
local
PATHVARIABLE
=
${
2
:-
PATH
}
for
DIR
in
${
!PATHVARIABLE
}
;
do
if
[
"
$DIR
"
!=
"
$1
"
]
;
then
NEWPATH
=
${
NEWPATH
:+
$NEWPATH
:
}
$DIR
fi
done
export
$PATHVARIABLE
=
"
$NEWPATH
"
}
pathprepend
()
{
pathremove
$1
$2
local
PATHVARIABLE
=
${
2
:-
PATH
}
export
$PATHVARIABLE
=
"
$1
${
!PATHVARIABLE
:+:
${
!PATHVARIABLE
}}
"
}
pathappend
()
{
pathremove
$1
$2
local
PATHVARIABLE
=
${
2
:-
PATH
}
export
$PATHVARIABLE
=
"
${
!PATHVARIABLE
:+
${
!PATHVARIABLE
}
:
}
$1
"
}
export
-f
pathremove pathprepend pathappend
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录