From b3f186752b5279c8c7311c099bdf2bf19afb7434 Mon Sep 17 00:00:00 2001
From: elijah <elijah@riseup.net>
Date: Wed, 28 Jan 2015 13:34:53 -0800
Subject: don't use md5sum command line tool. closes #6675

---
 lib/leap_cli/util.rb | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

(limited to 'lib/leap_cli')

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
 
     ##
-- 
cgit v1.2.3