summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-02-04 16:35:44 +0900
committerNobuyoshi Nakada <[email protected]>2024-02-04 16:35:44 +0900
commitc40b0d52be00f305fe14b4c060599afeded9b83e ()
treece09f2aaaa5dc034f639fdcd893d95c96037ed05 /ext/extmk.rb
parentbc79229be9d3333083b2e587d708b5d791d23608 (diff)
Glob with base option
When ripping the base directory off the result names.
-rwxr-xr-xext/extmk.rb10
1 files changed, 4 insertions, 6 deletions
@@ -104,7 +104,7 @@ def extract_makefile(makefile, keep = true)
end
return false
end
- srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].map {|fn| File.basename(fn)}.sort
if !srcs.empty?
old_srcs = m[/^ORIG_SRCS[ \t]*=[ \t](.*)/, 1] or return false
(old_srcs.split - srcs).empty? or return false
@@ -507,10 +507,8 @@ cond = proc {|ext, *|
}
($extension || %w[*]).each do |e|
e = e.sub(/\A(?:\.\/)+/, '')
- incl, excl = Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d|
- d = File.dirname(d)
- d.slice!(0, ext_prefix.length + 1)
- d
}.partition {|ext|
with_config(ext, &cond)
}
@@ -522,7 +520,7 @@ cond = proc {|ext, *|
exts.delete_if {|d| File.fnmatch?("-*", d)}
end
end
-ext_prefix = ext_prefix[$top_srcdir.size+1..-2]
@ext_prefix = ext_prefix
@inplace = inplace