3 RELEASE_BUILDDIR=${RELEASE_BUILDDIR:-/var/tmp/portage-release}
4 SOURCE_DIR=${RELEASE_BUILDDIR}/checkout
5 BRANCH=${BRANCH:-trunk}
6 REPOSITORY=svn+ssh://cvs.gentoo.org/var/svnroot/portage/main
7 SVN_LOCATION=${REPOSITORY}/${BRANCH}
14 echo "Usage: ${0##*/} [--anon] [-t|--tag] [-u|--upload <location>] <version>"
18 ARGS=$(getopt -o tu: --long anon,changelog-rev:,tag,upload: \
20 [ $? != 0 ] && die "initialization error"
27 REPOSITORY=svn://anonsvn.gentoo.org/portage/main
28 SVN_LOCATION=${REPOSITORY}/${BRANCH}
48 die "unknown option: $1"
53 [ -z "$1" ] && die "Need version argument"
54 [ -n "${1/[0-9]*}" ] && die "Invalid version argument"
57 RELEASE=portage-${VERSION}
58 RELEASE_DIR=${RELEASE_BUILDDIR}/${RELEASE}
59 RELEASE_TARBALL="${RELEASE_BUILDDIR}/${RELEASE}.tar.bz2"
61 echo ">>> Cleaning working directories ${RELEASE_DIR} ${SOURCE_DIR}"
62 rm -rf "${RELEASE_DIR}" "${SOURCE_DIR}" || die "directory cleanup failed"
63 mkdir -p "${RELEASE_DIR}" || die "directory creation failed"
65 echo ">>> Starting Subversion export"
66 svn export "${SVN_LOCATION}" "${SOURCE_DIR}" > /dev/null || die "svn export failed"
68 echo ">>> Creating Changelog"
69 svn2cl_opts="-i --reparagraph"
70 [ -n "$CHANGELOG_REVISION" ] && svn2cl_opts+=" -r HEAD:$CHANGELOG_REVISION"
71 svn2cl $svn2cl_opts -o "${SOURCE_DIR}/ChangeLog" "${SVN_LOCATION}" \
72 || die "ChangeLog creation failed"
74 echo ">>> Building release tree"
75 cp -a "${SOURCE_DIR}/"{bin,cnf,doc,man,pym,src} "${RELEASE_DIR}/" || die "directory copy failed"
76 cp "${SOURCE_DIR}/"{ChangeLog,DEVELOPING,NEWS,RELEASE-NOTES,TEST-NOTES} \
77 "${RELEASE_DIR}/" || die "file copy failed"
79 cd "${RELEASE_BUILDDIR}"
81 echo ">>> Creating release tarball ${RELEASE_TARBALL}"
82 tar --owner portage --group portage -cjf "${RELEASE_TARBALL}" "${RELEASE}" || \
83 die "tarball creation failed"
85 DISTDIR=$(portageq distdir)
86 if [ -n "${DISTDIR}" -a -d "${DISTDIR}" -a -w "${DISTDIR}" ]; then
87 echo ">>> Copying release tarball into ${DISTDIR}"
88 cp "${RELEASE_TARBALL}" "${DISTDIR}"/ || echo "!!! tarball copy failed"
91 if [ -n "${UPLOAD_LOCATION}" ]; then
92 echo ">>> Uploading ${RELEASE_TARBALL} to ${UPLOAD_LOCATION}"
93 scp "${RELEASE_TARBALL}" "dev.gentoo.org:${UPLOAD_LOCATION}" || die "upload failed"
95 echo "${RELEASE_TARBALL} created"
98 if [ -n "${CREATE_TAG}" ]; then
99 echo ">>> Tagging ${VERSION} in repository"
100 svn cp ${SVN_LOCATION} ${REPOSITORY}/tags/${VERSION} || die "tagging failed"