On Sun, Jan 03, 2021 at 08:21:33PM +0800, Zhang Dewan wrote:
On Sun, Jan 03, 2021 at 10:43:09AM +0800, Yu Chuan wrote:
[Why] If the current os has not been integrated into lkp-tests, run method `detect_system`, then var `$_system_name_lowercase` will be 'unknown'. So we should adapt this.
[Error]
- local DISTRO=unknown
++ echo ntpdate ++ /home/yuchuan/lkp-tests/sbin/adapt-packages unknown Traceback (most recent call last): 3: from /home/yuchuan/lkp-tests/sbin/adapt-packages:11:in `<main>' 2: from /usr/share/ruby/psych.rb:497:in `load_file' 1: from /usr/share/ruby/psych.rb:497:in `open' /usr/share/ruby/psych.rb:497:in `initialize': No such file or directory @ rb_sysopen - /home/yuchuan/lkp-tests/distro/adaptation/unknown (Errno::ENOENT)
[How] If the current os has not been integrated into lkp-tests, then return.
Signed-off-by: Yu Chuan 13186087857@163.com
lib/bootstrap.sh | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index 7d15bb370fa9..ab6573af1a7a 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -240,6 +240,7 @@ run_ntpdate() has_cmd ntpdate || { detect_system local DISTRO=$_system_name_lowercase
. $LKP_SRC/distro/installer/$DISTRO $(echo ntpdate | $LKP_SRC/sbin/adapt-packages $DISTRO) }[ "$DISTRO" == "unknown" ] && return
at this pattern : boolen || do it wish to fix the boolen is false. you fix the do, not the boolen is false.
maybe it should check in front.
About the logic:
has_cmd ntpdate || { [ current os is unknown for lkp-tests ] && return install ntpdate }
Do you mean i should add some prompt about the abnormal state?
-------- Thanks Yu Chuan
Thanks, Dewan
-- 2.23.0