[ruby/etc] Chec if the target file exists, not "depend" file

https://github.com/ruby/etc/commit/b95ddef386
This commit is contained in:
Nobuyoshi Nakada 2023-07-12 21:03:29 +09:00 коммит произвёл git
Родитель 2fa77fb82d
Коммит 4fced78605
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -44,14 +44,16 @@ have_struct_member('struct group', 'gr_passwd', 'grp.h')
# for https://github.com/ruby/etc
srcdir = File.expand_path("..", __FILE__)
constdefs = "#{srcdir}/constdefs.h"
ruby = RbConfig.ruby
if File.file?(ruby)
ruby = [ruby]
else
require "shellwords"
ruby = Shellwords.split(ruby)
if !File.exist?(constdefs)
ruby = RbConfig.ruby
if File.file?(ruby)
ruby = [ruby]
else
require "shellwords"
ruby = Shellwords.split(ruby)
end
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
end
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
# TODO: remove when dropping 2.7 support, as exported since 3.0
have_func('rb_deprecate_constant(Qnil, "None")')