]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm-java-requires
add java_min_classdataversion support
[packages/rpm.git] / rpm-java-requires
old mode 100644 (file)
new mode 100755 (executable)
index dc069c8..8bbac6f
@@ -16,9 +16,23 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 # xsltproc for eclipse feature.xml
 : ${xsltproc=/usr/bin/xsltproc}
 
+# "%define java_min_classdataversion 51.0" in spec to minimum version to be 51.0
+: ${MIN_CLASSDATAVERSION=}
+
 # save $- state, to enable in functions
 debug=$-
 
+javaclassversionfilter() {
+       if [ "$MIN_CLASSDATAVERSION" ]; then
+               set -- $* "$MIN_CLASSDATAVERSION"
+       fi
+
+       local v
+       for v in $*; do
+               echo "java(ClassDataVersion) >= $v"
+       done | sort -V | tail -n 1
+}
+
 javaclassversion() {
        set -$debug
        local mode=$1; shift
@@ -33,10 +47,7 @@ javaclassversion() {
                return 1
        fi
 
-       local v
-       for v in $classver; do
-               echo "java(ClassDataVersion) >= $v"
-       done
+       javaclassversionfilter $classver
        return 0
 }
 
This page took 0.062888 seconds and 4 git commands to generate.