#!/bin/sh
set -eu
# The input is the source-compiled, byte-preserving Gradle proposal. This step
# installs it before Go compilation; it does not filter or rewrite a ZIP.
agent=/src/internal/obi-src/pkg/internal/java/embedded/obi-java-agent.jar
input=/inputs/linux-agent/obi-java-agent-linux-amd64.jar
old=b1c9b6c8a79198475e2a9a5532ee6e8c621b33d749c0f1a6f433f6c826c340c2
new=0c15d947141e7b292d7de448ca82ec678243503b9ea8d14f46132bdb99b87137
printf '%s  %s\n' "$old" "$agent" | sha256sum -c -
printf '%s  %s\n' "$new" "$input" | sha256sum -c -
cp "$input" "$agent"
printf '%s  %s\n' "$new" "$agent" | sha256sum -c -
mkdir -p /out/source/linux-agent /out/records
cp "$input" /out/source/linux-agent/
cp /inputs/linux-agent/linux-amd64-agent.* /out/source/linux-agent/
cat > /out/records/java-packaging.json <<'JSON'
{
  "profile": "linux-amd64-agent",
  "original_jar_sha256": "b1c9b6c8a79198475e2a9a5532ee6e8c621b33d749c0f1a6f433f6c826c340c2",
  "compiled_jar_sha256": "0c15d947141e7b292d7de448ca82ec678243503b9ea8d14f46132bdb99b87137",
  "source_module_versions_changed": false,
  "original_generated_source_checkpoint_preserved": true,
  "release_eligible": false
}
JSON
