Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: add a script for creating bootstrapped tarballs for release #1937

Merged
merged 1 commit into from
Dec 15, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tools/mk-release-source
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
REVISION="${1}"
COMPRESS="gzip"
WORKDIR="xbmc-${REVISION}"

if [[ -z "${REVISION}" ]]; then echo "Usage: ${0} tag|branch|commit [gzip|xz|...]" && exit 1; fi
if [[ -d "${WORKDIR}" ]]; then echo "${WORKDIR} dir exists, refusing to overwrite" && exit 1; fi
if [[ -n "${2}" ]]; then COMPRESS="${2}"; fi

which git >/dev/null || exit 1
git rev-list -1 ${REVISION} >/dev/null || exit 1

mkdir -p "${WORKDIR}"
GIT_WORK_TREE="${WORKDIR}" git checkout "${REVISION}" -- . || exit 1

pushd "${WORKDIR}" >/dev/null
./bootstrap || ( rm -rf "${WORKDIR}" && exit 1 )
popd >/dev/null

pushd "${WORKDIR}/tools/android/depends" >/dev/null
./bootstrap || ( rm -rf "${WORKDIR}" && exit 1 )
popd >/dev/null

echo "${REVISION}" > "${WORKDIR}"/VERSION
echo "`git rev-list -1 ${REVISION}`" >> "${WORKDIR}"/VERSION

tar cf "${WORKDIR}.tar" "${WORKDIR}" || ( rm -f "${WORKDIR}.tar" && rm -rf "${WORKDIR}" exit 1 )
${COMPRESS} ${WORKDIR}.tar || ( rm -f "${WORKDIR}.tar" && rm -rf "${WORKDIR}" && exit 1 )

rm -rf ${WORKDIR}
exit 0