From 628547a8e5aa4169a9b78ebf6f592e49601528e6 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 26 Jan 2019 14:06:43 +0000 Subject: [PATCH] Fix source package creation. --- packaging/source/buildpackage.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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