[Reproducible-commits] [debbindiff] 06/07: Strip path from javap output even when relative
Jérémy Bobbio
lunar at moszumanska.debian.org
Wed Jun 24 11:52:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository debbindiff.
commit 94a4430b1a50507a941a18e2949a868dfdd6fa4c
Author: Jérémy Bobbio <lunar at debian.org>
Date: Wed Jun 24 11:47:21 2015 +0000
Strip path from javap output even when relative
---
debbindiff/comparators/java.py | 7 ++++++-
tests/data/class_expected_diff | 6 ++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/debbindiff/comparators/java.py b/debbindiff/comparators/java.py
index 394642c..b0266ad 100644
--- a/debbindiff/comparators/java.py
+++ b/debbindiff/comparators/java.py
@@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with debbindiff. If not, see <http://www.gnu.org/licenses/>.
+import os.path
import re
from debbindiff import tool_required
from debbindiff.comparators.utils import binary_fallback, Command
@@ -24,12 +25,16 @@ from debbindiff.difference import Difference
class Javap(Command):
+ def __init__(self, path, *args, **kwargs):
+ super(Javap, self).__init__(path, *args, **kwargs)
+ self.real_path = os.path.realpath(path)
+
@tool_required('javap')
def cmdline(self):
return ['javap', '-verbose', '-constants', '-s', '-l', '-private', self.path]
def filter(self, line):
- if re.match(r'^Classfile %s$' % re.escape(self.path), line):
+ if re.match(r'^Classfile %s$' % re.escape(self.real_path), line):
return ''
return line
diff --git a/tests/data/class_expected_diff b/tests/data/class_expected_diff
index 0d75268..789d56f 100644
--- a/tests/data/class_expected_diff
+++ b/tests/data/class_expected_diff
@@ -1,8 +1,6 @@
-@@ -1,10 +1,10 @@
--Classfile /home/lunar/Documents/Debian/reproducible-builds/debbindiff/git/tests/data/Test1.class
+@@ -1,9 +1,9 @@
- Last modified 24 juin 2015; size 255 bytes
- MD5 checksum b21793a1a687017fda223dba41bfcbf2
-+Classfile /home/lunar/Documents/Debian/reproducible-builds/debbindiff/git/tests/data/Test2.class
+ Last modified 24 juin 2015; size 254 bytes
+ MD5 checksum 01a9e334bb654f7cde2e4cae29f92a99
Compiled from "Test.java"
@@ -12,7 +10,7 @@
major version: 50
flags: ACC_SUPER
Constant pool:
-@@ -39,12 +39,12 @@
+@@ -38,12 +38,12 @@
public static int main(java.lang.String[]);
Signature: ([Ljava/lang/String;)I
flags: ACC_PUBLIC, ACC_STATIC
--
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