[Reproducible-commits] [debbindiff] 01/09: Fix handling of objdump output
Jérémy Bobbio
lunar at moszumanska.debian.org
Tue Sep 30 15:10:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository debbindiff.
commit 67c5b476dae0e59e0a8a04f87992bebce41a3af7
Author: Jérémy Bobbio <lunar at debian.org>
Date: Tue Sep 30 10:25:01 2014 +0200
Fix handling of objdump output
---
debbindiff/comparators/elf.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/debbindiff/comparators/elf.py b/debbindiff/comparators/elf.py
index ec8247b..77d410a 100644
--- a/debbindiff/comparators/elf.py
+++ b/debbindiff/comparators/elf.py
@@ -18,6 +18,7 @@
# along with debbindiff. If not, see <http://www.gnu.org/licenses/>.
import os.path
+import re
import subprocess
from debbindiff.comparators.utils import binary_fallback
from debbindiff.difference import Difference
@@ -29,7 +30,9 @@ def readelf_debug_dump(path):
return subprocess.check_output(['readelf', '--debug-dump', path], shell=False)
def objdump_disassemble(path):
- return subprocess.check_output(['objdump', '--disassemble', path], shell=False)
+ output = subprocess.check_output(['objdump', '--disassemble', path], shell=False)
+ # the full path appears in the output, we need to remove it
+ return re.sub(re.escape(path), os.path.basename(path), output)
@binary_fallback
def compare_elf_files(path1, path2, source=None):
@@ -45,5 +48,5 @@ def compare_elf_files(path1, path2, source=None):
objdump1 = objdump_disassemble(path1)
objdump2 = objdump_disassemble(path2)
if objdump1 != objdump2:
- differences.append(Difference(objdump1.splitlines(1), objdump2.splitlines(1), path1, path2, source='objdump --dissamble'))
+ differences.append(Difference(objdump1.splitlines(1), objdump2.splitlines(1), path1, path2, source='objdump --disassemble'))
return differences
--
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