diff --git a/Scripts/AutoBuild_Function.sh b/Scripts/AutoBuild_Function.sh index 811fcbe..d539d51 100755 --- a/Scripts/AutoBuild_Function.sh +++ b/Scripts/AutoBuild_Function.sh @@ -12,10 +12,12 @@ GET_INFO() { Openwrt_Author="$(echo "${Openwrt_Repo}" | cut -d "/" -f4)" Openwrt_Repo_Name="$(echo "${Openwrt_Repo}" | cut -d "/" -f5)" Openwrt_Branch="$(GET_BRANCH)" - [[ ! ${Openwrt_Branch} == master ]] && { + if [[ ${Openwrt_Branch} == master || -z ${Openwrt_Branch} ]];then + Openwrt_Version_="R$(date +%y.%m)-" + else Openwrt_Branch="$(echo ${Openwrt_Branch} | egrep -o "[0-9]+.[0-9]+")" - Openwrt_Version_="R${Openwrt_Branch}-" - } || Openwrt_Version_="R$(date +%y.%m)-" + Openwrt_Version_="R${Openwrt_Branch}.0-" + fi case "${Openwrt_Author}" in coolsnowwolf) Version_File=package/lean/default-settings/files/zzz-default-settings @@ -353,11 +355,13 @@ TIME() { } PKG_Finder() { + local Result [[ $# -ne 3 ]] && { - TIME "[ERROR] Error options: [$#] [$*] !" + TIME "Usage: PKG_Finder Search_Path Target_Name/Target_Path" return 0 } - find $2 -name $3 -type $1 -depth -exec echo {} \; + Result=$(find $2 -name $3 -type $1 -depth -exec echo {} \;) + [[ -n ${Result} ]] && echo "${Result}" } AddPackage_List() {