summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmkrelease.sh31
1 files changed, 28 insertions, 3 deletions
diff --git a/mkrelease.sh b/mkrelease.sh
index a92413f92..098c80d1b 100755
--- a/mkrelease.sh
+++ b/mkrelease.sh
@@ -3,13 +3,32 @@
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}
+REPOSITORY=svn+ssh://cvs.gentoo.org/var/svnroot/portage/main
+SVN_LOCATION=${REPOSITORY}/${BRANCH}
die() {
echo $@
+ echo "Usage: $(basename $0) [-t|--tag] [-u|--upload <location>] <version>"
exit 1
}
+while [ "${1:1}" == "-" ]; then
+ case "$1" in
+ -t|--tag)
+ CREATE_TAG=true
+ shift
+ ;;
+ -u|--upload)
+ [ -z "$2" ] && die "missing argument to upload option"
+ UPLOAD_LOCATION=${2}
+ shift; shift
+ ;;
+ *)
+ die "unknown option: $1"
+ ;;
+ esac
+fi
+
[ -z "$1" ] && die "Need version argument"
[ -n "${1/[0-9]*}" ] && die "Invalid version argument"
@@ -22,8 +41,8 @@ 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"
+svn export "${SVN_LOCATION}" "${SOURCE_DIR}" > /dev/null || die "svn export failed"
+svn2cl -o "${SOURCE_DIR}/ChangeLog" "${SVN_LOCATION}" || 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"
@@ -38,3 +57,9 @@ if [ -n "${UPLOAD_LOCATION}" ]; then
else
echo "${RELEASE_TARBALL} created"
fi
+
+if [ -n "${CREATE_TAG}" ]; then
+ echo "Tagging ${VERSION} in repository"
+ svn cp ${SVN_LOCATION} ${REPOSITORY}/tags/${VERSION} || die "tagging failed"
+fi
+