已合并
清理编译时grep的告警 #1495
DragonBornHD84创建于 4月9日
清理编译时grep的告警 #1495
已合并
DragonBornHD84创建于 4月9日
2 个文件变更+3-3
@@ -557,11 +557,11 @@ check_pkg_ver_deps() {
557check_install_path_valid() {557check_install_path_valid() {
558 local install_path="$1"558 local install_path="$1"
559 # 黑名单设置,不允许//,...这样的路径559 # 黑名单设置,不允许//,...这样的路径
560- if echo "${install_path}" | grep -Eq '\/{2,}|\.{3,}'; then560+ if echo "${install_path}" | grep -Eq '/{2,}|\.{3,}'; then
561 return 1561 return 1
562 fi562 fi
563 # 白名单设置,只允许常见字符563 # 白名单设置,只允许常见字符
564- if echo "${install_path}" | grep -Eq '^\~?[a-zA-Z0-9./_-]*$'; then564+ if echo "${install_path}" | grep -Eq '^~?[a-zA-Z0-9./_-]*$'; then
565 return 0565 return 0
566 else566 else
567 return 1567 return 1
@@ -132,7 +132,7 @@ _check_version_compatiable() {
132 if [ -d "$install_path/share/info" ]; then132 if [ -d "$install_path/share/info" ]; then
133 err_msgs="$(133 err_msgs="$(
134 ls "$install_path/share/info" | grep -v "^${package}$" | while read src_pkg; do134 ls "$install_path/share/info" | grep -v "^${package}$" | while read src_pkg; do
135- get_formal_package_name "src_pkg_formal" "$package"135+ get_formal_package_name "src_pkg_formal" "$src_pkg"
136 installed_version_info="$install_path/share/info/$src_pkg/version.info"136 installed_version_info="$install_path/share/info/$src_pkg/version.info"
137 grep "^required_package_${package_formal}_version=" "$installed_version_info" | cut -d= -f2- | tr -d '"' | while read required; do137 grep "^required_package_${package_formal}_version=" "$installed_version_info" | cut -d= -f2- | tr -d '"' | while read required; do
138 _check_version_required "$self_version" "$required" "$script_dir" "$src_pkg_formal" "$package_formal"138 _check_version_required "$self_version" "$required" "$script_dir" "$src_pkg_formal" "$package_formal"