From 8e0f30c61a98429d678f92738660aa34cb08395d Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Sat, 9 Feb 2008 12:47:58 +0000 Subject: [PATCH] new script for creating release tarballs svn path=/main/trunk/; revision=9308 --- mkrelease.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 mkrelease.sh diff --git a/mkrelease.sh b/mkrelease.sh new file mode 100755 index 000000000..a92413f92 --- /dev/null +++ b/mkrelease.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +RELEASE_BUILDDIR=${RELEASE_BUILDDIR:-/var/tmp/portage-release} +SOURCE_DIR=${RELEASE_BUILDDIR}/checkout +BRANCH=${BRANCH:-trunk} +REPOSITORY=svn+ssh://cvs.gentoo.org/var/svnroot/portage/main/${BRANCH} + +die() { + echo $@ + exit 1 +} + +[ -z "$1" ] && die "Need version argument" +[ -n "${1/[0-9]*}" ] && die "Invalid version argument" + +VERSION=${1} +RELEASE=portage-${VERSION} +RELEASE_DIR=${RELEASE_BUILDDIR}/${RELEASE} +RELEASE_TARBALL="${RELEASE_BUILDDIR}/${RELEASE}.tar.bz2" + +rm -rf "${RELEASE_DIR}" "${SOURCE_DIR}" || die "directory cleanup failed" +mkdir -p "${RELEASE_DIR}" || die "directory creation failed" + + +svn export "${REPOSITORY}" "${SOURCE_DIR}" || die "svn export failed" +svn2cl -o "${SOURCE_DIR}/ChangeLog" "${REPOSITORY}" || die "ChangeLog creation failed" + +cp -a "${SOURCE_DIR}/"{bin,cnf,doc,man,pym,src} "${RELEASE_DIR}/" || die "directory copy failed" +cp "${SOURCE_DIR}/"{ChangeLog,DEVELOPING,NEWS,RELEASE-NOTES,TEST-NOTES,TODO} "${RELEASE_DIR}/" || die "file copy failed" + +cd "${RELEASE_BUILDDIR}" + +tar cfj "${RELEASE_TARBALL}" "${RELEASE}" || die "tarball creation failed" + +if [ -n "${UPLOAD_LOCATION}" ]; then + echo "uploading ${RELEASE_TARBALL} to ${UPLOAD_LOCATION}" + scp "${RELEASE_TARBALL}" "dev.gentoo.org:${UPLOAD_LOCATION}" || die "upload failed" +else + echo "${RELEASE_TARBALL} created" +fi -- 2.26.2