From b958d97cfd6b37dcc90a23cb21911b30ca095d79 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Wed, 3 Apr 2024 03:55:33 +0100 Subject: [PATCH] generate_source_tarball.sh: Support using a subdirectory via TO_COMPRESS Related: RHEL-30937 --- java-1.8.0-openjdk.spec | 1 + scripts/generate_source_tarball.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index eef5994..c63b366 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -2945,6 +2945,7 @@ cjc.mainProgram(args) - 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 +- generate_source_tarball.sh: Support using a subdirectory via TO_COMPRESS - Sync patch set with portable build - Related: RHEL-30937 diff --git a/scripts/generate_source_tarball.sh b/scripts/generate_source_tarball.sh index 84beb87..0b5b96b 100755 --- a/scripts/generate_source_tarball.sh +++ b/scripts/generate_source_tarball.sh @@ -97,6 +97,8 @@ if [ "$1" = "help" ] ; then echo " (defaults to PROJECT_NAME-VERSION)" echo "REPO_ROOT - the location of the Git repository to archive" echo " (defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME.git)" + echo "TO_COMPRESS - what part of clone to pack" + echo " (defaults to ${VERSION})" echo "JCONSOLE_PATCH - the path to a patch to fix non-availiability of" echo " jconsole.js (optional; defaults to ${JCONSOLE_PATCH_DEFAULT})" echo "BOOT_JDK - the bootstrap JDK to satisfy the configure run" @@ -206,6 +208,11 @@ if [ "$REPO_ROOT" = "" ] ; then echo "No repository root specified; default to ${REPO_ROOT}" fi; +if [ "$TO_COMPRESS" = "" ] ; then + TO_COMPRESS="${VERSION}" + echo "No targets to be compressed specified ; default to ${TO_COMPRESS}" +fi; + echo -e "Settings:" echo -e "\tVERSION: ${VERSION}" echo -e "\tPROJECT_NAME: ${PROJECT_NAME}" @@ -214,6 +221,7 @@ echo -e "\tOPENJDK_URL: ${OPENJDK_URL}" echo -e "\tCOMPRESSION: ${COMPRESSION}" echo -e "\tFILE_NAME_ROOT: ${FILE_NAME_ROOT}" echo -e "\tREPO_ROOT: ${REPO_ROOT}" +echo -e "\tTO_COMPRESS: ${TO_COMPRESS}" echo -e "\tJCONSOLE_PATCH: ${JCONSOLE_PATCH}" echo -e "\tBOOT_JDK: ${BOOT_JDK}" @@ -295,7 +303,7 @@ pushd "${FILE_NAME_ROOT}" TARBALL_NAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} XZ_OPT=${XZ_OPT-"-T0"} \ tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ - --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${VERSION}" + --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" mv "${TARBALL_NAME}" .. popd if [ "$WITH_TEMP" != "" ] ; then