[PATCH v3 lkp-tests 3/3] lib/job2sh.rb: fix bug: can not find the file:pkg/$program/PKGBUILD

[why] when the $dir not exist, cat > $dir/$file << 'EOF' xxx EOF will echo error message: can not find the file $dir/$file Signed-off-by: Li Ping <15396232681@163.com> --- lib/job2sh.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 9c95ff4b..7e6a5d7c 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -350,6 +350,7 @@ class Job2sh < Job out_line out_line "\texport define_files='#{define_files.keys.join ' '}'" define_files.each do |file, val| + out_line "\tmkdir -p $LKP_SRC/$(dirname #{file})" out_line "\tcat > $LKP_SRC/#{file} <<'EOF'" out_line val out_line "EOF" -- 2.23.0

Changelog can be improved. Just show the EXACT/ORIGINAL error message. No need further explain since the fix is obvious enough. Thanks, Fengguang On Wed, Nov 04, 2020 at 09:02:30PM +0800, Li Ping wrote:
[why] when the $dir not exist, cat > $dir/$file << 'EOF' xxx EOF will echo error message: can not find the file $dir/$file
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job2sh.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 9c95ff4b..7e6a5d7c 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -350,6 +350,7 @@ class Job2sh < Job out_line out_line "\texport define_files='#{define_files.keys.join ' '}'" define_files.each do |file, val| + out_line "\tmkdir -p $LKP_SRC/$(dirname #{file})" out_line "\tcat > $LKP_SRC/#{file} <<'EOF'" out_line val out_line "EOF" -- 2.23.0

On Thu, Nov 05, 2020 at 09:38:49AM +0800, Wu Fengguang wrote:
Changelog can be improved.
Just show the EXACT/ORIGINAL error message. No need further explain since the fix is obvious enough.
original error message? ==> cat > $dir/$file << 'EOF' can not genarate the file: $dir/$file automatically
Thanks, Fengguang
On Wed, Nov 04, 2020 at 09:02:30PM +0800, Li Ping wrote:
[why] when the $dir not exist, cat > $dir/$file << 'EOF' xxx EOF will echo error message: can not find the file $dir/$file
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job2sh.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 9c95ff4b..7e6a5d7c 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -350,6 +350,7 @@ class Job2sh < Job out_line out_line "\texport define_files='#{define_files.keys.join ' '}'" define_files.each do |file, val| + out_line "\tmkdir -p $LKP_SRC/$(dirname #{file})" out_line "\tcat > $LKP_SRC/#{file} <<'EOF'" out_line val out_line "EOF" -- 2.23.0

On Thu, Nov 05, 2020 at 10:14:05AM +0800, Li Ping wrote:
On Thu, Nov 05, 2020 at 09:38:49AM +0800, Wu Fengguang wrote:
Changelog can be improved.
Just show the EXACT/ORIGINAL error message. No need further explain since the fix is obvious enough.
original error message? ==> cat > $dir/$file << 'EOF' can not genarate the file: $dir/$file automatically
那是你编辑过的。。 我要原汁原味的。 Thanks, Fengguang
participants (2)
-
Li Ping
-
Wu Fengguang