On Fri, Mar 12, 2021 at 04:45:23PM +0800, Li Ping wrote:
Signed-off-by: Li Ping 1477412247@qq.com
tests/rpmbuild-pkg | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/tests/rpmbuild-pkg b/tests/rpmbuild-pkg index a8c8eb6b1..f49ba3a0b 100755 --- a/tests/rpmbuild-pkg +++ b/tests/rpmbuild-pkg @@ -1,11 +1,11 @@ #!/bin/bash -# - rpm_repo +# - upstream_repo
. $LKP_SRC/lib/debug.sh . $LKP_SRC/lib/upload.sh
-[ -n "$rpm_repo" ] || die "rpm_repo is empty" -package_name=${rpm_repo##*/} +[ -n "$upstream_repo" ] || die "upstream_repo is empty" +package_name=${upstream_repo##*/} sync_dest="/initrd/rpmbuild-pkg/${os}-${os_version}/${os_arch}/${package_name}"
init_workspace() @@ -14,21 +14,16 @@ init_workspace() rpmdev-setuptree }
-get_pkgfile() +download_upstream_repo() {
- curl -sS -H 'Content-Type: Application/json' -XPOST "$GIT_SERVER"':8100/git_command' \
- -d '{"git_repo": "'${rpm_repo}'", "git_command": ["git-show", "HEAD:'$1'"]}' -o "${2}"
-}
-download_rpm_repo() -{
- local filelist=$(curl -sS -H 'Content-Type: Application/json' -XPOST "$GIT_SERVER"':8100/git_command' \
-d '{"git_repo": "'${rpm_repo}'", "git_command": ["git-ls-files", "."]}')
- git clone "git://$GIT_SERVER/openeuler/${upstream_repo}" || die "clone ${package_name} git repo failed: git://$GIT_SERVER/openeuler/${upstream_repo}"
maybe it is a better format of log: => die "clone git repo failed: ${package_name} git://$GIT_SERVER/openeuler/${upstream_repo}"
-------- Thanks, Xijian
- cd $package_name || exit
- filelist=$(git ls-files) for pkgfile in ${filelist[@]} do local dir="SOURCES" echo $pkgfile | egrep ".spec$" && dir="SPECS"
get_pkgfile "$pkgfile" "${HOME}/rpmbuild/${dir}/$pkgfile"
donecat "$pkgfile" > "${HOME}/rpmbuild/${dir}/$pkgfile"
}
@@ -63,6 +58,6 @@ upload_rpm_pkg() }
init_workspace -download_rpm_repo +download_upstream_repo build_rpm upload_rpm_pkg -- 2.23.0