[Misc #22206] Fix snapshot dependency generation

Skip dependency generation when exporting stable branches that
predate the Ruby dependency scanner.  Avoid loading GNU make
definitions into the temporary Makefile so snapshot generation also
works with BSD make.
This commit is contained in:
Nobuyoshi Nakada authored and Nobuyoshi Nakada committed 2026-07-23 11:38:55 +09:00
1 parent 199745468e
commit 9645d193dd
2 files changed
+8 -3
Notes: git 2026-07-23 02:39:30 +00:00

No files matched your search

+3 -2
View File
@@ -486,7 +486,6 @@ def package(vcs, rev, destdir, tmp = nil)
end
end
mk << commonmk.gsub(/\{\$([^(){}]*)[^{}]*\}/, "").sub(/^revision\.tmp::$/, '\& Makefile')
mk << File.read("defs/gmake.mk")
mk << <<-'APPEND'
update-download:: touch-unicode-files
@@ -503,7 +502,9 @@ touch-unicode-files:
clean.create(".revision.time")
ENV["CACHE_SAVE"] = "no"
make = MAKE.new(args)
return unless make.run("fix-depends")
if File.file?("tool/mkdepend.rb")
return unless make.run("fix-depends")
end
return unless make.run("update-download")
clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk", "ext/ripper/y.output", ".revision.time")
Dir.glob("**/*") do |dest|
+5 -1
View File
@@ -861,7 +861,11 @@ class TestMkdepend < Test::Unit::TestCase
)
assert_include(snapshot, 'args["MKDEPEND_FILES"] = "--scope=core"')
assert_include(snapshot, 'args["MKDEPEND_OPTIONS"] = ""')
assert_include(snapshot, 'make.run("fix-depends")')
assert_match(
%r{if File\.file\?\("tool/mkdepend\.rb"\).*make\.run\("fix-depends"\)}m,
snapshot,
)
assert_not_include(snapshot, 'File.read("defs/gmake.mk")')
end
def test_file_without_markers_is_not_updated