new script for creating release tarballs
authorMarius Mauch <genone@gentoo.org>
Sat, 9 Feb 2008 12:47:58 +0000 (12:47 -0000)
committerMarius Mauch <genone@gentoo.org>
Sat, 9 Feb 2008 12:47:58 +0000 (12:47 -0000)
svn path=/main/trunk/; revision=9308

mkrelease.sh [new file with mode: 0755]

diff --git a/mkrelease.sh b/mkrelease.sh
new file mode 100755 (executable)
index 0000000..a92413f
--- /dev/null
@@ -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