diff options
author | 2021-06-19 21:10:39 +0200 | |
---|---|---|
committer | 2021-06-19 21:10:39 +0200 | |
commit | 916b92e8a987b403fa73f27dd0d2d7e3a44c44ad (patch) | |
tree | 3555a29dbf75cf781949978ca733a2e0555b955d | |
parent | release 0.6.6 (diff) | |
download | javatoolkit-916b92e8a987b403fa73f27dd0d2d7e3a44c44ad.tar.gz javatoolkit-916b92e8a987b403fa73f27dd0d2d7e3a44c44ad.tar.bz2 javatoolkit-916b92e8a987b403fa73f27dd0d2d7e3a44c44ad.zip |
correctly handling java versions in class-version-verify.py
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
-rwxr-xr-x | src/py/class-version-verify.py | 2 | ||||
-rw-r--r-- | src/py/javatoolkit/cvv.py | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/py/class-version-verify.py b/src/py/class-version-verify.py index 968618c..dc44d90 100755 --- a/src/py/class-version-verify.py +++ b/src/py/class-version-verify.py @@ -56,8 +56,6 @@ def main(): print("-t is mandatory") sys.exit(2) - options.version = int(options.version.split(".")[-1]) - cvv_magic = CVVMagic(options.version) for arg in args: diff --git a/src/py/javatoolkit/cvv.py b/src/py/javatoolkit/cvv.py index 1f15415..b0fdc84 100644 --- a/src/py/javatoolkit/cvv.py +++ b/src/py/javatoolkit/cvv.py @@ -10,18 +10,28 @@ from zipfile import ZipFile class CVVMagic: def __init__(self, target): - self.target = target + # this is a number 8 9 10 11 etc, not including 1. + if '.' in target: + self.target = int(target.split(".")[-1]) + else: + self.target = int(target) self.good = [] self.bad = [] self.skipped = [] def add(self, version, jar, file): if file == "module-info.class" and self.target < 9: - self.skipped.append(("1.%s" % (version), jar, file)) + self.skipped.append((version, jar, file)) elif version <= self.target: - self.good.append(("1.%s" % (version), jar, file)) + if version < 9: + self.good.append(("1.%s" % (version), jar, file)) + else: + self.good.append((version, jar, file)) else: - self.bad.append(("1.%s" % (version), jar, file)) + if version < 9: + self.bad.append(("1.%s" % (version), jar, file)) + else: + self.bad.append((version, jar, file)) def do_class(self,filename): classFile = file(filename,"rb") |