has_key?(key) Returns true when key given by key exists, otherwise false.
Signed-off-by: Ren Wen 15991987063@163.com --- src/lib/job.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index d10a1e9..e3d47de 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -289,7 +289,7 @@ class Job "SCHED_PORT"]
initialized_keys.each do |key| - if @hash.has_key?(key) == false + unless @hash.has_key?(key) return false end end @@ -301,7 +301,7 @@ class Job private def set_kernel_version boot_dir = "#{SRV_OS}/#{os_dir}/boot" suffix = "-#{kernel_version}" if self["kernel_version"]? - self["linux_vmlinuz_path"] = File.real_path("#{boot_dir}/vmlinuz#{suffix}") + self["linux_vmlinuz_path"] = File.real_path("#{boot_dir}/vmlinuz#{suffix}") if "#{os_mount}" == "initramfs" self["linux_modules_initrd"] = File.real_path("#{boot_dir}/modules#{suffix}.cgz") self["linux_headers_initrd"] = File.real_path("#{boot_dir}/headers#{suffix}.cgz") @@ -429,7 +429,7 @@ class Job else program_version = "latest" end - + deps_dest_file = "#{SRV_INITRD}/deps/#{mount_type}/#{os_dir}/#{program}/#{program}.cgz" pkg_dest_file = "#{SRV_INITRD}/pkg/#{mount_type}/#{os_dir}/#{program}/#{program_version}.cgz"
Please ignore this mail.
On Thu, Nov 12, 2020 at 04:06:59PM +0800, Ren Wen wrote:
has_key?(key) Returns true when key given by key exists, otherwise false.
Signed-off-by: Ren Wen 15991987063@163.com
src/lib/job.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index d10a1e9..e3d47de 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -289,7 +289,7 @@ class Job "SCHED_PORT"]
initialized_keys.each do |key|
if @hash.has_key?(key) == false
endunless @hash.has_key?(key) return false end
@@ -301,7 +301,7 @@ class Job private def set_kernel_version boot_dir = "#{SRV_OS}/#{os_dir}/boot" suffix = "-#{kernel_version}" if self["kernel_version"]?
- self["linux_vmlinuz_path"] = File.real_path("#{boot_dir}/vmlinuz#{suffix}")
- self["linux_vmlinuz_path"] = File.real_path("#{boot_dir}/vmlinuz#{suffix}") if "#{os_mount}" == "initramfs" self["linux_modules_initrd"] = File.real_path("#{boot_dir}/modules#{suffix}.cgz") self["linux_headers_initrd"] = File.real_path("#{boot_dir}/headers#{suffix}.cgz")
@@ -429,7 +429,7 @@ class Job else program_version = "latest" end
deps_dest_file = "#{SRV_INITRD}/deps/#{mount_type}/#{os_dir}/#{program}/#{program}.cgz" pkg_dest_file = "#{SRV_INITRD}/pkg/#{mount_type}/#{os_dir}/#{program}/#{program_version}.cgz"
-- 2.23.0