优化 PKG_Finder,适配 main 分支源码

This commit is contained in:
Hyy2001X 2021-06-23 17:53:59 +08:00
parent 394b176637
commit a36cf2c333
1 changed files with 9 additions and 5 deletions

View File

@ -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 <f | d> 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() {