Skip to content

Commit

Permalink
Revert clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed Sep 4, 2024
1 parent f94bb2a commit a94d654
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
50 changes: 47 additions & 3 deletions tooling/reproducible/repro_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,9 @@ function processModuleInfo() {
# Remove non-relevant files
function removeGeneratedClasses() {
local JDK_DIR="$1"
local OS="$2"

rm -rf "$JDK_DIR/bin/server/classes.jsa"
rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa"
rm -rf "$JDK_DIR/release"
rm -rf "$JDK_DIR/NOTICE"
}

# Remove all Signatures
Expand Down Expand Up @@ -424,6 +421,36 @@ function cleanTemurinFiles() {
echo "Removing Temurin NOTICE file from $DIR"
rm "${DIR}"/NOTICE

if [[ $(uname) =~ Darwin* ]]; then
echo "Removing Temurin specific lines from release file in $DIR"
sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release"
sed -i "" '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release"
sed -i "" '/^SOURCE_REPO=.*$/d' "${DIR}/release"
sed -i "" '/^FULL_VERSION=.*$/d' "${DIR}/release"
sed -i "" '/^SEMANTIC_VERSION=.*$/d' "${DIR}/release"
sed -i "" '/^BUILD_INFO=.*$/d' "${DIR}/release"
sed -i "" '/^JVM_VARIANT=.*$/d' "${DIR}/release"
sed -i "" '/^JVM_VERSION=.*$/d' "${DIR}/release"
sed -i "" '/^IMAGE_TYPE=.*$/d' "${DIR}/release"

echo "Removing SOURCE= from ${DIR}/release file, as Temurin builds from Adoptium mirror repo _adopt tag"
sed -i "" '/^SOURCE=.*$/d' "${DIR}/release"
else
echo "Removing Temurin specific lines from release file in $DIR"
sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release"
sed -i '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release"
sed -i '/^SOURCE_REPO=.*$/d' "${DIR}/release"
sed -i '/^FULL_VERSION=.*$/d' "${DIR}/release"
sed -i '/^SEMANTIC_VERSION=.*$/d' "${DIR}/release"
sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release"
sed -i '/^JVM_VARIANT=.*$/d' "${DIR}/release"
sed -i '/^JVM_VERSION=.*$/d' "${DIR}/release"
sed -i '/^IMAGE_TYPE=.*$/d' "${DIR}/release"

echo "Removing SOURCE= from ${DIR}/release file, as Temurin builds from Adoptium mirror repo _adopt tag"
sed -i '/^SOURCE=.*$/d' "${DIR}/release"
fi

echo "Removing cacerts file, as Temurin builds with different Mozilla cacerts"
find "${DIR}" -type f -name "cacerts" -delete

Expand All @@ -433,6 +460,23 @@ function cleanTemurinFiles() {
rm -rf "${DIR}/demo"
}

# Temurin release file metadata BUILD_INFO/SOURCE can/will be different
function cleanTemurinBuildInfo() {
local DIR="$1"

echo "Cleaning any Temurin build-scripts release file BUILD_INFO from ${DIR}"

if [[ $(uname) =~ Darwin* ]]; then
sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release"
sed -i "" '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release"
sed -i "" '/^BUILD_INFO=.*$/d' "${DIR}/release"
else
sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release"
sed -i '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release"
sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release"
fi
}

# Patch the Vendor strings from the BootJDK in jrt-fs/jar MANIFEST
function patchManifests() {
local JDK_DIR="$1"
Expand Down
2 changes: 1 addition & 1 deletion tooling/reproducible/repro_process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OS="$2"

expandJDK "$JDK_DIR" "$OS"

removeGeneratedClasses "$JDK_DIR" "$OS"
removeGeneratedClasses "$JDK_DIR"
if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then

# Remove existing signature
Expand Down

0 comments on commit a94d654

Please sign in to comment.