1extractVersion() {
2 local jar version
3 local prefix="$1"
4 shift
5 local candidates="$@"
6
7 jar="$(basename -a $candidates | sort | head -n1)"
8
9 version="${jar#$prefix-}"
10
11 echo "${version%.jar}"
12}
13
14autoPatchelfInJar() {
15 local file="$1" rpath="$2"
16 local work
17
18 work="$(mktemp -dt patching.XXXXXXXXXX)"
19 pushd "$work"
20
21 jar xf "$file"
22 rm "$file"
23
24 autoPatchelf -- .
25
26 jar cf "$file" .
27
28 popd
29}