diff --git a/java-17-openjdk.spec b/java-17-openjdk.spec index 56182d6..2a2b4c7 100644 --- a/java-17-openjdk.spec +++ b/java-17-openjdk.spec @@ -2497,6 +2497,11 @@ cjc.mainProgram(args) %endif %changelog +* Sun Aug 04 2024 Anton Bobrov - 1:17.0.12.0.6-0.1.ea +- generate_source_tarball.sh: Use tar exclude options for VCS files +- generate_source_tarball.sh: Improve VCS exclusion +- Related: RHEL-52734 + * Sun Aug 04 2024 Andrew Hughes - 1:17.0.12.0.6-0.1.ea - generate_source_tarball.sh: Update examples in header for clarity - generate_source_tarball.sh: Cleanup message issued when checkout already exists diff --git a/scripts/generate_source_tarball.sh b/scripts/generate_source_tarball.sh index 0af33c3..597b939 100755 --- a/scripts/generate_source_tarball.sh +++ b/scripts/generate_source_tarball.sh @@ -242,34 +242,21 @@ pushd "${FILE_NAME_ROOT}" popd rm -rf build - EA_PART="$(awk -F= \ - '/^DEFAULT_PROMOTED_VERSION_PRE/ { if ($2) print "-"$2 }' \ - "${VERSION}"/make/conf/version-numbers.conf)" - TARBALL_BASE=${FILE_NAME_ROOT}${EA_PART}.tar - pushd "${VERSION}" - # Omit commit checks, history, and GHA from archive. - for skip in .jcheck .hgtags .hgignore .gitattributes .gitignore .github - do - echo "${skip}"" export-ignore" >> .git/info/attributes - done - # Do not bother with --mtime here; specify it to tar below. - # Unforunately, git-archive sorts added files like .src-rev at the end; - # retar below to use GNU tar --sort=name ordering which sorts .src-rev - # at the start. - git archive --output "${TARBALL_BASE}" --prefix="${VERSION}"/ \ - --add-file=.src-rev --format=tar "${VERSION}" - popd - mv "${VERSION}" "${VERSION}".git - tar xf "${VERSION}".git/"${TARBALL_BASE}" echo "Compressing remaining forest" if [ "$COMPRESSION" = "xz" ] ; then SWITCH=cJf else SWITCH=czf fi - TARBALL_NAME=${TARBALL_BASE}.${COMPRESSION} + EA_PART="$(awk -F= \ + '/^DEFAULT_PROMOTED_VERSION_PRE/ { if ($2) print "-"$2 }' \ + "${VERSION}"/make/conf/version-numbers.conf)" + TARBALL_NAME=${FILE_NAME_ROOT}${EA_PART}.tar.${COMPRESSION} XZ_OPT=${XZ_OPT-"-T0"} \ - tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ + tar --exclude-vcs --exclude=.jcheck --exclude=.hgtags \ + --exclude=.hgignore --exclude=.gitattributes \ + --exclude=.gitignore --exclude=.github --exclude=.git \ + --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" mv "${TARBALL_NAME}" .. popd