Remove Cache dirty-tracking

It really wasn't necessary since Cache#write is not called often.
This commit is contained in:
Josh Holtrop 2019-02-25 21:16:48 -05:00
parent 6ce3d59ad9
commit 68118c2707
2 changed files with 6 additions and 21 deletions

View File

@ -156,7 +156,7 @@ module Rscons
cache.configuration_data["build_dir"] = options[:build_dir]
cache.configuration_data["prefix"] = options[:prefix]
cache.configuration_data["configured"] = rv == 0
cache.write!
cache.write
rv
end

View File

@ -96,29 +96,17 @@ module Rscons
# Configuration data.
def configuration_data=(value)
@cache["configuration_data"] = value
@dirty = true
end
# Write the cache to disk if it is dirty.
# Write the cache to disk.
#
# @return [void]
def write
if @dirty || (@cache["version"] != VERSION)
@cache["version"] = VERSION
validate_json_object(@cache)
File.open(CACHE_FILE, "w") do |fh|
fh.puts(JSON.dump(@cache))
end
@cache["version"] = VERSION
validate_json_object(@cache)
File.open(CACHE_FILE, "w") do |fh|
fh.puts(JSON.dump(@cache))
end
@dirty = false
end
# Force a write of the cache to disk.
#
# @return [void]
def write!
@dirty = true
write
end
# Check if target(s) are up to date.
@ -272,7 +260,6 @@ module Rscons
}
end,
}
@dirty = true
end
end
@ -297,7 +284,6 @@ module Rscons
unless File.exists?(subpath)
FileUtils.mkdir_p(subpath)
@cache["directories"][subpath] = true
@dirty = true
end
end
end
@ -339,7 +325,6 @@ module Rscons
@cache["directories"] ||= {}
@cache["configuration_data"] ||= {}
@lookup_checksums = {}
@dirty = false
end
# Return a file's checksum, or the previously calculated checksum for