On Wed, Dec 09, 2020 at 02:33:00PM +0800, Wang Chenglong wrote:
On Wed, Dec 09, 2020 at 02:26:54PM +0800, Wang Yong wrote:
On Wed, Dec 09, 2020 at 12:32:53PM +0800, Zhang Yale wrote:
Signed-off-by: Zhang Yale ylzhangah@qq.com
tests/rpmbuild-pkg | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 tests/rpmbuild-pkg
diff --git a/tests/rpmbuild-pkg b/tests/rpmbuild-pkg new file mode 100755 index 00000000..9765eddb --- /dev/null +++ b/tests/rpmbuild-pkg @@ -0,0 +1,81 @@
- yum clean all
Is this necessary?
If there is cache residue, it may cause the package to fail.
May be can use 'yum makecache'
Thanks, Chenglong
Ok!
Thanks, Yale
- yum -y install rpm-build
- yum -y install rpmdevtools
- mkdir -p ~/rpmbuild/{SPECS,SRPMS,SOURCES,BUILD,RPMS}
if installed rpmdevtools, we can use rpmdev-setuptree to generate these directory
+}
+get_pkgfile() +{
- curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \
- -d '{"git_repo": "'${rpm_spec}'", "git_command": ["git-show", "HEAD:'$1'"]}' -o "${2}"
+}
+request_pkg() +{
filelist=$(curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \
-d '{"git_repo": "'${rpm_spec}'", "git_command": ["git-ls-files", "."]}')
local dir="SOURCES"
for pkgfile in ${filelist[*]}
do
echo $pkgfile | egrep "\.spec$" && {
dir="SPECS"
}
get_pkgfile "$pkgfile" "${HOME}/rpmbuild/${dir}/$pkgfile"
done
+}
+rpmbuild_pkg() +{
- spec_dir=~/rpmbuild/SPECS/$benchmark.spec
- sed -i 's/^(Source[^ ]*:[ \t]*)https/\1http/g' `grep http -rl $benchmark.spec`
blank line here
- # Install build depends
- yum-builddep -y $spec_dir
ditto
- # Download tar.gz to default path ~/rpmbuild/SOURCE
- spectool -g -R $spec_dir
ditto
Thanks, Yong