summaryrefslogtreecommitdiff
path: root/lib/leap_cli/util.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-01-28 13:34:53 -0800
committerelijah <elijah@riseup.net>2015-01-28 13:34:53 -0800
commitb3f186752b5279c8c7311c099bdf2bf19afb7434 (patch)
treed930a840ee3dd11f3d24ba0d468ebd064e850341 /lib/leap_cli/util.rb
parent84ae4c6eba59efc683e102245e0da03b782ea067 (diff)
don't use md5sum command line tool. closes #6675
Diffstat (limited to 'lib/leap_cli/util.rb')
-rw-r--r--lib/leap_cli/util.rb10
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
##