On Mon, Apr 12, 2021 at 05:12:50PM +0800, Wang Yong wrote:
post rpm data to rpm-repo in order to createrepo
ref: commit 5dd22c1e010734bc5e610f4abe46baec0f36f5bb
Signed-off-by: Wang Yong wangyong0117@qq.com
tests/rpmbuild-pkg | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/tests/rpmbuild-pkg b/tests/rpmbuild-pkg index a91ae4a08..3d63bebae 100755 --- a/tests/rpmbuild-pkg +++ b/tests/rpmbuild-pkg @@ -108,6 +108,33 @@ upload_rpm_pkg() done }
+update_repo_mq() +{
- rpm_list=($(find ${HOME}/rpmbuild/RPMS -type f -name "*.rpm" -exec basename {} ;))
- srpm_list=($(find ${HOME}/rpmbuild/SRPMS -type f -name "*.rpm" -exec basename {} ;))
- j=0
- k=0
- for rpm_name in ${rpm_list[@]}
- do
rpm_list[$j]="\"/srv${rpm_dest}/${rpm_name}\""
((j++))
- done
- for src_rpm_name in ${srpm_list[@]}
- do
srpm_list[$k]="\"/srv${src_rpm_dest}/${src_rpm_name}\""
((k++))
- done
^---- you should encapsulate as a funtion for loop "for ... do ...done ", while call the funtion.
Thanks, Liushaofei
- full_list=(${rpm_list[@]} ${srpm_list[@]})
- full_list=$(echo ${full_list[@]} | sed 's; ;,;g')
- curl -H 'Content-Type: Application/json' -XPOST "${LKP_SERVER}:10003/upload" \
-d "{\"upload_rpms\": ["${full_list}"]}"
+}
[ -n "$repo_name" ] && from_srpm || from_git build_rpm upload_rpm_pkg
+update_repo_mq
2.23.0