[PATCH lkp-tests 4/5] sbin/set-env.sh: take apart the method of adding env-variables

Signed-off-by: Hu XueJiao <1034502035@qq.com> --- sbin/set-env.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sbin/set-env.sh b/sbin/set-env.sh index a8b161fa..ce1ad427 100644 --- a/sbin/set-env.sh +++ b/sbin/set-env.sh @@ -2,10 +2,17 @@ . lib/env.sh -write_shellrc() +submit_env() +{ + echo $@ >> $(shell_profile) + source $(shell_profile) +} + +write_env() { echo "export LKP_SRC=$PWD" >> $(shell_profile) echo "export PATH=\$PATH:\$LKP_SRC/sbin:\$LKP_SRC/bin" >> $(shell_profile) + source $(shell_profile) } write_host() @@ -28,5 +35,5 @@ write_host() EOF } -write_shellrc +write_env write_host -- 2.23.0

On Tue, Dec 08, 2020 at 03:05:03PM +0800, Hu Xuejiao wrote:
Signed-off-by: Hu XueJiao <1034502035@qq.com> --- sbin/set-env.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sbin/set-env.sh b/sbin/set-env.sh index a8b161fa..ce1ad427 100644 --- a/sbin/set-env.sh +++ b/sbin/set-env.sh @@ -2,10 +2,17 @@
. lib/env.sh
-write_shellrc()
+submit_env()
add_profile_env() ? Thanks sunyukui
+{ + echo $@ >> $(shell_profile) + source $(shell_profile) +} + +write_env() { echo "export LKP_SRC=$PWD" >> $(shell_profile) echo "export PATH=\$PATH:\$LKP_SRC/sbin:\$LKP_SRC/bin" >> $(shell_profile) + source $(shell_profile) }
write_host() @@ -28,5 +35,5 @@ write_host() EOF }
-write_shellrc +write_env write_host -- 2.23.0

On Tue, Dec 08, 2020 at 03:05:03PM +0800, Hu Xuejiao wrote:
Signed-off-by: Hu XueJiao <1034502035@qq.com> --- sbin/set-env.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sbin/set-env.sh b/sbin/set-env.sh index a8b161fa..ce1ad427 100644 --- a/sbin/set-env.sh +++ b/sbin/set-env.sh @@ -2,10 +2,17 @@
. lib/env.sh
-write_shellrc() +submit_env() +{ + echo $@ >> $(shell_profile) + source $(shell_profile) +} + +write_env() { echo "export LKP_SRC=$PWD" >> $(shell_profile) echo "export PATH=\$PATH:\$LKP_SRC/sbin:\$LKP_SRC/bin" >> $(shell_profile) + source $(shell_profile) }
I think to finish same function for "submit_env" and "write_env". why not merge together? Thanks, Liushaofei
write_host() @@ -28,5 +35,5 @@ write_host() EOF }
-write_shellrc +write_env write_host -- 2.23.0

-write_shellrc() +submit_env() +{ + echo $@ >> $(shell_profile) + source $(shell_profile) +}
Where the submit_env function invoked?
+write_env() { echo "export LKP_SRC=$PWD" >> $(shell_profile) echo "export PATH=\$PATH:\$LKP_SRC/sbin:\$LKP_SRC/bin" >> $(shell_profile) + source $(shell_profile)
Maybe Here submit_env better? Thanks, Zhangyu
}
write_host() @@ -28,5 +35,5 @@ write_host() EOF }
-write_shellrc +write_env write_host -- 2.23.0
participants (4)
-
Hu Xuejiao
-
Liu Shaofei
-
Sun Yukui
-
Zhang Yu