diff options
author | elijah <elijah@riseup.net> | 2015-01-28 13:34:53 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-01-28 13:34:53 -0800 |
commit | b3f186752b5279c8c7311c099bdf2bf19afb7434 (patch) | |
tree | d930a840ee3dd11f3d24ba0d468ebd064e850341 /lib | |
parent | 84ae4c6eba59efc683e102245e0da03b782ea067 (diff) |
don't use md5sum command line tool. closes #6675
Diffstat (limited to 'lib')
-rw-r--r-- | lib/leap_cli/util.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb index 9edb150..5014238 100644 --- a/lib/leap_cli/util.rb +++ b/lib/leap_cli/util.rb @@ -355,16 +355,12 @@ module LeapCli end # - # compares md5 fingerprints to see if the contents of a file match the string we have in memory + # compares md5 fingerprints to see if the contents of a file match the + # string we have in memory # def file_content_equals?(filepath, contents) filepath = Path.named_path(filepath) - output = `md5sum '#{filepath}'`.strip - if $?.to_i == 0 - return output.split(" ").first == Digest::MD5.hexdigest(contents).to_s - else - return false - end + Digest::MD5.file(filepath).hexdigest == Digest::MD5.hexdigest(contents) end ## |