diff --git a/make_hotpatch b/make_hotpatch index 8c060514a32b180d7b562a45cba9cb8a17433e5c..776566220ea59168ca7e402f67a61d9b5257529b 100644 --- a/make_hotpatch +++ b/make_hotpatch @@ -114,27 +114,27 @@ function fn_check_reg_char() echo "error: the string is empty, check string failed" return 1 fi - ##ַ + ##字符串长度 if [ -n "$l_str_maxlen" ] && [ -z "`echo $l_str_maxlen | sed 's/[0-9]//g'`" ];then if [ $len_str -gt $l_str_maxlen ]; then echo "error: The length of $l_str exceed max length $l_str_maxlen." return 1 fi fi - #ַܰ + #不能包含其他字符 if [ -n "$l_str_ex" ] && [ -n "`echo $l_str | grep -E [$l_str_ex] 2>/dev/null`" ];then echo "error: string $l_str included characters $l_str_ex." return 1 fi - ##ֺĸͷ + ##数字和字母开头 if [ -z "`echo $l_str | grep -E '^[a-z0-9A-Z]'`" ];then echo "error: string $l_str must start with a character ('0-9' or 'A-Z' or 'a-z')." return 1 fi - ##ֺֻĸ -_ + ##只能数字和字母 -_ if [ -n "`echo $l_str | grep -E '[^a-z0-9A-Z_-]'`" ];then if [ -n "$l_str_ex" ] ;then - ##־д + ##这个日志写不好 echo "error: string $l_str can only contain characters included by ('0-9', 'a-z', 'A-Z')" else echo "error: string $l_str can only contain characters included by ('0-9', 'a-z', 'A-Z', '-', '_')." @@ -326,20 +326,20 @@ function fn_verify_input() if [ -z "`echo "$input_param" | grep -w "\-i"`" \ -a -z "`echo $input_param | grep -w "\-\-id"`" \ -a $# -gt 1 ];then - echo "error: missing param -i or --id" + echo "error: missing param -i or --id" + fn_do_clean + fn_usage + exit 1 + fi + if [ -z "`echo "$input_param" | grep -w "\-d"`" \ + -a -z "`echo $input_param | grep -w "\-\-diffext"`" \ + -a -z "`echo $input_param | grep -w "\-p"`" \ + -a -z "`echo $input_param | grep -w "\-\-patch"`" \ + -a $# -gt 1 ];then + echo "error: missing param -d,--diffext or -p,--patch" fn_do_clean fn_usage exit 1 -fi -if [ -z "`echo "$input_param" | grep -w "\-d"`" \ - -a -z "`echo $input_param | grep -w "\-\-diffext"`" \ - -a -z "`echo $input_param | grep -w "\-p"`" \ - -a -z "`echo $input_param | grep -w "\-\-patch"`" \ - -a $# -gt 1 ];then -echo "error: missing param -d,--diffext or -p,--patch" -fn_do_clean -fn_usage -exit 1 fi while [ $# -ge 1 ]; do @@ -485,7 +485,7 @@ function fn_init_module_build() return 1 fi - #make a new softlink ij + #make a new softlink 或改成链接 ln -sf $l_modulesrc $G_PRIVATE_MODULE if [ $? -ne 0 ];then echo "error: copy $l_modulesrc to $G_PRIVATE_MODULE failed"