
On Thu, Dec 24, 2020 at 05:17:12PM +0800, Liu Shaofei wrote:
On Thu, Dec 24, 2020 at 04:53:51PM +0800, Wang Yong wrote:
[Why] config file in some software need storage and recall
now we can add config value in yaml and cp ${config} to ${cci_dir}/${pkgname}/ in PKGBUILD so that config file
cci_dir change real directory.
it will export in this script
can be uploaded correctly
$ cat test.yaml ... config: ${config} ...
what is ${config} ?
k: v it's value name
+check_config_var() +{ + [ -n "$config" ] || return +}
I thank you can delete the function.
ok
+get_config() +{ + local cci_http_host=${INITRD_HTTP_HOST} + local cci_http_port=${INITRD_HTTP_PORT:-8800} + export cci_dir=/cci/build-config + local remote_dir="http://${cci_http_host}:${cci_http_port}${cci_dir}/${pkgname}" + + mkdir -p ${cci_dir} + + check_config_var + http_get_file "${remote_dir}/${config}" "${cci_dir}/${pkgname}/${config}" +} + +upload_config() +{ + upload_to_target_dir "${cci_dir}/${pkgname}" +} + mount_dest() { # the same image is mounted to cifs and nfs, the generated cgz files @@ -46,7 +71,7 @@ get_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##*/}" - } +}
request_pkg() { @@ -125,13 +150,17 @@ build_source_pkg() fi } replace_source PKGBUILD.src - create_cgz_name + get_config
^----- change like this:
[ -n "$config" ] && get_config
ok
PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" \ $LKP_SRC/sbin/makepkg ${pkg_args} --config $LKP_SRC/etc/makepkg.conf
- [ "$?" == 0 ] || exit 1 + local build_state="$?" + + upload_config
^------ locate inside get_config, right?
no matter make true or false, it will upload config file for recall Thanks, Yong