已合并
清理编译时grep的告警 #1495
DragonBornHD84创建于 4月9日
清理编译时grep的告警 #1495
已合并
共 2 个文件变更+3-3
| @@ -557,11 +557,11 @@ check_pkg_ver_deps() { | |||
| 557 | check_install_path_valid() { | 557 | check_install_path_valid() { |
| 558 | local install_path="$1" | 558 | local install_path="$1" |
| 559 | # 黑名单设置,不允许//,...这样的路径 | 559 | # 黑名单设置,不允许//,...这样的路径 |
| 560 | - if echo "${install_path}" | grep -Eq '\/{2,}|\.{3,}'; then | 560 | + if echo "${install_path}" | grep -Eq '/{2,}|\.{3,}'; then |
| 561 | return 1 | 561 | return 1 |
| 562 | fi | 562 | fi |
| 563 | # 白名单设置,只允许常见字符 | 563 | # 白名单设置,只允许常见字符 |
| 564 | - if echo "${install_path}" | grep -Eq '^\~?[a-zA-Z0-9./_-]*$'; then | 564 | + if echo "${install_path}" | grep -Eq '^~?[a-zA-Z0-9./_-]*$'; then |
| 565 | return 0 | 565 | return 0 |
| 566 | else | 566 | else |
| 567 | return 1 | 567 | return 1 |
| @@ -132,7 +132,7 @@ _check_version_compatiable() { | |||
| 132 | if [ -d "$install_path/share/info" ]; then | 132 | 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; do | 134 | 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; do | 137 | 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" |