python311Packages.moto: 4.2.6 -> 4.2.10
[NixPkgs.git] / pkgs / build-support / setup-hooks / canonicalize-jars.sh
blob5137bfc94b011722fba62a199bbfa58391a7651b
1 # This setup hook causes the fixup phase to repack all JAR files in a
2 # canonical & deterministic fashion, e.g. resetting mtimes (like with normal
3 # store files) and avoiding impure metadata.
5 fixupOutputHooks+=('if [ -z "$dontCanonicalizeJars" -a -e "$prefix" ]; then canonicalizeJarsIn "$prefix"; fi')
7 canonicalizeJarsIn() {
8 local dir="$1"
9 echo "canonicalizing jars in $dir"
10 dir="$(realpath -sm -- "$dir")"
11 while IFS= read -rd '' f; do
12 canonicalizeJar "$f"
13 done < <(find -- "$dir" -type f -name '*.jar' -print0)
16 source @canonicalize_jar@