[Why] Support more version's PKGBUILD.
[How] Download the required file through remote-git from /srv/git/pkg/
usage: job yaml: PKGBUILD_TAG: 1.0-20 About $PKGBUILD_TAG, it is from PKGBUILD file's $pkgver-$pkgrel.
You should create a git repo that name same as $benchmark in /srv/git/pkg/ before you add PKGBUILD_TAG to yaml. If not, cci-makepkg will report an error. And everything same as before if no PKGBUILD_TAG.
Signed-off-by: Lin Jiaxin ljx.joe@qq.com --- tests/cci-makepkg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/tests/cci-makepkg b/tests/cci-makepkg index a105f189..67d055a4 100755 --- a/tests/cci-makepkg +++ b/tests/cci-makepkg @@ -39,12 +39,29 @@ cd $LKP_SRC/pkg/$benchmark || die "pkg is empty" mount -t cifs -o guest,vers=1.0,noacl,nouser_xattr //$LKP_SERVER$PKG_MNT $PKG_MNT || die "Failed to run mount" }
+download_pkgfile() +{ + curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \ + -d '{"git_repo": "'$1'", "git_command": ["git-show", "HEAD:'$2'"]}' -o "$2" +} + +get_pkgfile() +{ + PKGBUILD_TAG_FILE="PKGBUILD-$PKGBUILD_TAG" + + download_pkgfile "pkg/$benchmark" "$PKGBUILD_TAG_FILE" + + [ -f "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE not exist" + [ -s "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE is empty" +} + get_pkg_info() { var=$1 pkg_dir=${2:-.} ( . $pkg_dir/PKGBUILD + [ -n "$PKGBUILD_TAG" ] && . $pkg_dir/PKGBUILD-$PKGBUILD_TAG eval echo '$'$var ) } @@ -71,6 +88,8 @@ update_shared_pkg() echo "update shared pkg link ${benchmark}.cgz -> ${bm_name}/${cgz_name}" }
+[ -n "$PKGBUILD_TAG" ] && get_pkgfile + distro_install_depends lkp-dev
[ $os = "centos" ] &&
On Wed, Nov 11, 2020 at 05:30:58PM +0800, Lin Jiaxin wrote:
[Why] Support more version's PKGBUILD.
[How] Download the required file through remote-git from /srv/git/pkg/
usage: job yaml: PKGBUILD_TAG: 1.0-20 About $PKGBUILD_TAG, it is from PKGBUILD file's $pkgver-$pkgrel.
You should create a git repo that name same as $benchmark in /srv/git/pkg/ before you add PKGBUILD_TAG to yaml. If not, cci-makepkg will report an error. And everything same as before if no PKGBUILD_TAG.
Signed-off-by: Lin Jiaxin ljx.joe@qq.com
tests/cci-makepkg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/tests/cci-makepkg b/tests/cci-makepkg index a105f189..67d055a4 100755 --- a/tests/cci-makepkg +++ b/tests/cci-makepkg @@ -39,12 +39,29 @@ cd $LKP_SRC/pkg/$benchmark || die "pkg is empty" mount -t cifs -o guest,vers=1.0,noacl,nouser_xattr //$LKP_SERVER$PKG_MNT $PKG_MNT || die "Failed to run mount" }
+download_pkgfile() +{
- curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \
- -d '{"git_repo": "'$1'", "git_command": ["git-show", "HEAD:'$2'"]}' -o "$2"
+}
+get_pkgfile() +{
- PKGBUILD_TAG_FILE="PKGBUILD-$PKGBUILD_TAG"
- download_pkgfile "pkg/$benchmark" "$PKGBUILD_TAG_FILE"
- [ -f "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE not exist"
I suppose die is not desired -- don't have to write one file for each new tag.
Thanks, Fengguang
- [ -s "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE is empty"
+}
get_pkg_info() { var=$1 pkg_dir=${2:-.} ( . $pkg_dir/PKGBUILD
eval echo '$'$var )[ -n "$PKGBUILD_TAG" ] && . $pkg_dir/PKGBUILD-$PKGBUILD_TAG
} @@ -71,6 +88,8 @@ update_shared_pkg() echo "update shared pkg link ${benchmark}.cgz -> ${bm_name}/${cgz_name}" }
+[ -n "$PKGBUILD_TAG" ] && get_pkgfile
distro_install_depends lkp-dev
[ $os = "centos" ] &&
2.23.0
+download_pkgfile() +{
- curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \
- -d '{"git_repo": "'$1'", "git_command": ["git-show", "HEAD:'$2'"]}' -o "$2"
+}
+get_pkgfile() +{
- PKGBUILD_TAG_FILE="PKGBUILD-$PKGBUILD_TAG"
- download_pkgfile "pkg/$benchmark" "$PKGBUILD_TAG_FILE"
- [ -f "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE not exist"
I suppose die is not desired -- don't have to write one file for each new tag.
Thanks, Fengguang
I do not quite understand. If the file is not getted, don't use die to terminate? And what do you mean 'don't have to write one file for each new tag' ? Severval tag share one file? But their pkgver are different.
- [ -s "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE is empty"
+}
get_pkg_info() { var=$1 pkg_dir=${2:-.} ( . $pkg_dir/PKGBUILD
eval echo '$'$var )[ -n "$PKGBUILD_TAG" ] && . $pkg_dir/PKGBUILD-$PKGBUILD_TAG
} @@ -71,6 +88,8 @@ update_shared_pkg() echo "update shared pkg link ${benchmark}.cgz -> ${bm_name}/${cgz_name}" }
+[ -n "$PKGBUILD_TAG" ] && get_pkgfile
distro_install_depends lkp-dev
[ $os = "centos" ] &&
2.23.0
On Wed, Nov 11, 2020 at 05:30:58PM +0800, Lin Jiaxin wrote:
[Why] Support more version's PKGBUILD.
[How] Download the required file through remote-git from /srv/git/pkg/
usage: job yaml: PKGBUILD_TAG: 1.0-20 About $PKGBUILD_TAG, it is from PKGBUILD file's $pkgver-$pkgrel.
You should create a git repo that name same as $benchmark in /srv/git/pkg/ before you add PKGBUILD_TAG to yaml. If not, cci-makepkg will report an error. And everything same as before if no PKGBUILD_TAG.
Signed-off-by: Lin Jiaxin ljx.joe@qq.com
tests/cci-makepkg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/tests/cci-makepkg b/tests/cci-makepkg index a105f189..67d055a4 100755 --- a/tests/cci-makepkg +++ b/tests/cci-makepkg @@ -39,12 +39,29 @@ cd $LKP_SRC/pkg/$benchmark || die "pkg is empty" mount -t cifs -o guest,vers=1.0,noacl,nouser_xattr //$LKP_SERVER$PKG_MNT $PKG_MNT || die "Failed to run mount" }
+download_pkgfile() +{
- curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \
- -d '{"git_repo": "'$1'", "git_command": ["git-show", "HEAD:'$2'"]}' -o "$2"
+}
+get_pkgfile() +{
- PKGBUILD_TAG_FILE="PKGBUILD-$PKGBUILD_TAG"
Is it a local variable, or to be used after return? If the formal, please add "local " prefix and make it lower case.
Thanks, Fengguang
- download_pkgfile "pkg/$benchmark" "$PKGBUILD_TAG_FILE"
- [ -f "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE not exist"
- [ -s "$PKGBUILD_TAG_FILE" ] || die "$PKGBUILD_TAG_FILE is empty"
+}
get_pkg_info() { var=$1 pkg_dir=${2:-.} ( . $pkg_dir/PKGBUILD
eval echo '$'$var )[ -n "$PKGBUILD_TAG" ] && . $pkg_dir/PKGBUILD-$PKGBUILD_TAG
} @@ -71,6 +88,8 @@ update_shared_pkg() echo "update shared pkg link ${benchmark}.cgz -> ${bm_name}/${cgz_name}" }
+[ -n "$PKGBUILD_TAG" ] && get_pkgfile
distro_install_depends lkp-dev
[ $os = "centos" ] &&
2.23.0
On Thu, Nov 12, 2020 at 12:06:39PM +0800, Wu Fengguang wrote:
On Wed, Nov 11, 2020 at 05:30:58PM +0800, Lin Jiaxin wrote:
[Why] Support more version's PKGBUILD.
[How] Download the required file through remote-git from /srv/git/pkg/
usage: job yaml: PKGBUILD_TAG: 1.0-20 About $PKGBUILD_TAG, it is from PKGBUILD file's $pkgver-$pkgrel.
You should create a git repo that name same as $benchmark in /srv/git/pkg/ before you add PKGBUILD_TAG to yaml. If not, cci-makepkg will report an error. And everything same as before if no PKGBUILD_TAG.
Signed-off-by: Lin Jiaxin ljx.joe@qq.com
tests/cci-makepkg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/tests/cci-makepkg b/tests/cci-makepkg index a105f189..67d055a4 100755 --- a/tests/cci-makepkg +++ b/tests/cci-makepkg @@ -39,12 +39,29 @@ cd $LKP_SRC/pkg/$benchmark || die "pkg is empty" mount -t cifs -o guest,vers=1.0,noacl,nouser_xattr //$LKP_SERVER$PKG_MNT $PKG_MNT || die "Failed to run mount" }
+download_pkgfile() +{
- curl -sS -H 'Content-Type: Application/json' -XPOST "$LKP_SERVER"':8100/git_command' \
- -d '{"git_repo": "'$1'", "git_command": ["git-show", "HEAD:'$2'"]}' -o "$2"
+}
+get_pkgfile() +{
- PKGBUILD_TAG_FILE="PKGBUILD-$PKGBUILD_TAG"
Is it a local variable, or to be used after return? If the formal, please add "local " prefix and make it lower case.
Thanks, Fengguang
Good! I will add local and make it lower case.
Thanks, Jiaxin