diff --git a/packaging/source/buildpackage.sh b/packaging/source/buildpackage.sh index 62a05412f2..457a4e2460 100755 --- a/packaging/source/buildpackage.sh +++ b/packaging/source/buildpackage.sh @@ -15,5 +15,12 @@ SRCDIR="$(pwd)/../.." pushd "${SRCDIR}" > /dev/null || exit 1 make version VERSION="${TAG}" -git ls-tree HEAD --name-only -r -z | xargs -0 tar cvjf "${OUTPUTDIR}/OpenRA-${TAG}-source.tar.bz2" + +# The output from `git ls-tree` is too long to fit in a single command (overflows MAX_ARG_STRLEN) +# so `xargs` will automatically split the input across multiple `tar` commands. +# Use the amend flag (r) to prevent each call erasing the output from earlier calls. +rm "${OUTPUTDIR}/OpenRA-${TAG}-source.tar" +git ls-tree HEAD --name-only -r -z | xargs -0 tar vrf "${OUTPUTDIR}/OpenRA-${TAG}-source.tar" +bzip2 "${OUTPUTDIR}/OpenRA-${TAG}-source.tar" + popd > /dev/null || exit 1