[Reproducible-commits] [debbindiff] 13/19: Convert Haskell comparators to Command class

Jérémy Bobbio lunar at moszumanska.debian.org
Tue Mar 31 14:59:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/feed-diff
in repository debbindiff.

commit 064ec09f8e067c955e68a62b52bdd0a48a344098
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Mon Mar 30 16:51:20 2015 +0200

    Convert Haskell comparators to Command class
---
 debbindiff/comparators/haskell.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/debbindiff/comparators/haskell.py b/debbindiff/comparators/haskell.py
index abb0d0e..abdab33 100644
--- a/debbindiff/comparators/haskell.py
+++ b/debbindiff/comparators/haskell.py
@@ -19,21 +19,19 @@
 
 import subprocess
 from debbindiff import tool_required
-from debbindiff.comparators.utils import binary_fallback
+from debbindiff.comparators.utils import binary_fallback, Command
 from debbindiff.difference import Difference
 
 
- at tool_required('ghc')
-def show_iface(path):
-    return subprocess.check_output(['ghc', '--show-iface', path], shell=False).decode('ascii')
+class ShowIface(Command):
+    @tool_required('ghc')
+    def cmdline(self):
+        return ['ghc', '--show-iface', path]
 
 
 @binary_fallback
 def compare_hi_files(path1, path2, source=None):
-    iface1 = show_iface(path1)
-    iface2 = show_iface(path2)
-    difference = Difference.from_unicode(
-                     iface1, iface2, path1, path2, source='ghc --show-iface')
+    difference = Difference.from_command(ShowIface, path1, path2)
     if not difference:
         return []
     return [difference]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list