generate_source_tarball.sh: Use tar exclude options for VCS files
- generate_source_tarball.sh: Use tar exclude options for VCS files - Related: RHEL-46639
This commit is contained in:
		
							parent
							
								
									929c6ad62e
								
							
						
					
					
						commit
						c43cb0b0c2
					
				| @ -2486,6 +2486,9 @@ require "copy_jdk_configs.lua" | ||||
| %endif | ||||
| 
 | ||||
| %changelog | ||||
| * Mon Jul  8 2024 Anton Bobrov <abobrov@redhat.com> - 1:17.0.12.0.6-0.1.ea | ||||
| - generate_source_tarball.sh: Use tar exclude options for VCS files | ||||
| 
 | ||||
| * Mon Jul  8 2024 Andrew Hughes <gnu.andrew@redhat.com> - 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 | ||||
|  | ||||
| @ -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 \ | ||||
|           --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ | ||||
|           -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" | ||||
|     mv "${TARBALL_NAME}" .. | ||||
| popd | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user