generate_source_tarball.sh: Handle an existing checkout

- generate_source_tarball.sh: Sync indentation with java-21-openjdk version

Related: RHEL-30937
This commit is contained in:
Andrew Hughes 2024-04-03 03:52:04 +01:00
parent 7f8dd8cf46
commit 97ade9b0cf
2 changed files with 79 additions and 75 deletions

View File

@ -2943,6 +2943,8 @@ cjc.mainProgram(args)
- Remove obsolete file generate_singlerepo_source_tarball.sh - Remove obsolete file generate_singlerepo_source_tarball.sh
- Remove obsolete file get_sources.sh - Remove obsolete file get_sources.sh
- Remove obsolete file update_main_sources.sh - Remove obsolete file update_main_sources.sh
- generate_source_tarball.sh: Handle an existing checkout
- generate_source_tarball.sh: Sync indentation with java-21-openjdk version
- Sync patch set with portable build - Sync patch set with portable build
- Related: RHEL-30937 - Related: RHEL-30937

View File

@ -217,9 +217,13 @@ echo -e "\tREPO_ROOT: ${REPO_ROOT}"
echo -e "\tJCONSOLE_PATCH: ${JCONSOLE_PATCH}" echo -e "\tJCONSOLE_PATCH: ${JCONSOLE_PATCH}"
echo -e "\tBOOT_JDK: ${BOOT_JDK}" echo -e "\tBOOT_JDK: ${BOOT_JDK}"
if [ -d "${FILE_NAME_ROOT}" ] ; then
echo "Reusing existing ${FILE_NAME_ROOT}"
STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")"
TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)"
else
mkdir "${FILE_NAME_ROOT}" mkdir "${FILE_NAME_ROOT}"
pushd "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}"
echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" echo "Cloning ${VERSION} root repository from ${REPO_ROOT}"
if realpath -q "${REPO_ROOT}"; then if realpath -q "${REPO_ROOT}"; then
echo "Local path detected; not adding depth argument"; echo "Local path detected; not adding depth argument";
@ -228,9 +232,7 @@ else
echo "Remote repository detected; adding ${DEPTH}"; echo "Remote repository detected; adding ${DEPTH}";
fi fi
git clone ${DEPTH} -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" git clone ${DEPTH} -b "${VERSION}" "${REPO_ROOT}" "${VERSION}"
pushd "${VERSION}" pushd "${VERSION}"
TAR_TIME="$(git log --max-count 1 --format=%cI)" TAR_TIME="$(git log --max-count 1 --format=%cI)"
# UnderlineTaglet.java has a BSD license with a field-of-use restriction, making it non-Free # UnderlineTaglet.java has a BSD license with a field-of-use restriction, making it non-Free
@ -250,9 +252,10 @@ echo "Patching out use of jconsole.js"
git apply --stat --apply -v -p1 "${JCONSOLE_PATCH}" git apply --stat --apply -v -p1 "${JCONSOLE_PATCH}"
find . -name '*.orig' -exec rm -vf '{}' ';' find . -name '*.orig' -exec rm -vf '{}' ';'
popd popd
popd
fi
pushd "${FILE_NAME_ROOT}"
# Generate .src-rev so build has knowledge of the revision the tarball was # Generate .src-rev so build has knowledge of the revision the tarball was
# created from # created from
mkdir build mkdir build
@ -294,7 +297,6 @@ XZ_OPT=${XZ_OPT-"-T0"} \
tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \
--exclude-vcs -$SWITCH "${TARBALL_NAME}" "${VERSION}" --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${VERSION}"
mv "${TARBALL_NAME}" .. mv "${TARBALL_NAME}" ..
popd popd
if [ "$WITH_TEMP" != "" ] ; then if [ "$WITH_TEMP" != "" ] ; then
echo "Tarball is: $(realpath .)/${TARBALL_NAME}" echo "Tarball is: $(realpath .)/${TARBALL_NAME}"