From 5ce8940d54ab6c2a19c4971b0f44d46cef0bfd55 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 15 Apr 2014 13:39:45 -0400 Subject: [PATCH] stop encoding Cache contents --- lib/rscons/cache.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rscons/cache.rb b/lib/rscons/cache.rb index 0fc0da9..c937131 100644 --- a/lib/rscons/cache.rb +++ b/lib/rscons/cache.rb @@ -152,18 +152,18 @@ module Rscons # @param env [Environment] The {Rscons::Environment}. def register_build(targets, command, deps, env) Array(targets).each do |target| - @cache["targets"][target.encode(__ENCODING__)] = { + @cache["targets"][target] = { "command" => Digest::MD5.hexdigest(command.inspect), "checksum" => calculate_checksum(target), "deps" => deps.map do |dep| { - "fname" => dep.encode(__ENCODING__), + "fname" => dep, "checksum" => lookup_checksum(dep), } end, "user_deps" => (env.get_user_deps(target) || []).map do |dep| { - "fname" => dep.encode(__ENCODING__), + "fname" => dep, "checksum" => lookup_checksum(dep), } end, @@ -181,7 +181,7 @@ module Rscons def mkdir_p(path) parts = path.split(/[\\\/]/) parts.each_index do |i| - subpath = File.join(*parts[0, i + 1]).encode(__ENCODING__) + subpath = File.join(*parts[0, i + 1]) unless File.exists?(subpath) FileUtils.mkdir(subpath) @cache["directories"][subpath] = true @@ -207,7 +207,7 @@ module Rscons # Calculate and return a file's checksum # @param file [String] The file name. def calculate_checksum(file) - @lookup_checksums[file] = Digest::MD5.hexdigest(File.read(file, mode: "rb")).encode(__ENCODING__) rescue "" + @lookup_checksums[file] = Digest::MD5.hexdigest(File.read(file, mode: "rb")) rescue "" end end end