2021-10-28 06:52:43 +00:00
|
|
|
# This setup hook causes the fixup phase to repack all JAR files in a
|
|
|
|
# canonical & deterministic fashion, e.g. resetting mtimes (like with normal
|
|
|
|
# store files) and avoiding impure metadata.
|
|
|
|
|
|
|
|
fixupOutputHooks+=('if [ -z "$dontCanonicalizeJars" -a -e "$prefix" ]; then canonicalizeJarsIn "$prefix"; fi')
|
|
|
|
|
|
|
|
canonicalizeJarsIn() {
|
|
|
|
local dir="$1"
|
2023-02-02 18:25:31 +00:00
|
|
|
echo "canonicalizing jars in $dir"
|
2021-10-28 06:52:43 +00:00
|
|
|
dir="$(realpath -sm -- "$dir")"
|
|
|
|
while IFS= read -rd '' f; do
|
|
|
|
canonicalizeJar "$f"
|
|
|
|
done < <(find -- "$dir" -type f -name '*.jar' -print0)
|
|
|
|
}
|
|
|
|
|
|
|
|
source @canonicalize_jar@
|