On Wed, Mar 24, 2021 at 05:25:40PM +0800, Luan Shengde wrote:
- package_name=${upstream_repo##*/}
- rpm_dest="${dest_dir}/${os_arch}/Packages"
- src_rpm_dest="${dest_dir}/source/Packages"
- init_workspace
- download_upstream_repo
+}
+from_srpm() +{
- [ -n "$repo_name" ] || die "repo_name is empty"
- [ -n "$repo_addr" ] || die "repo_addr is empty"
- rpm_dest="${dest_dir}/${repo_name}/${os_arch}/Packages"
- src_rpm_dest="${dest_dir}/${repo_name}/source/Packages"
- install_srpm
+}
+check_flow() +{
- if [ -n "$repo_name" ]; then
from_srpm
- else
from_git
- fi
case only one else and only one line command, you can use: [[ -n "$repo_name" ]] && from_srpm || from_git
ok
Thanks, Yong