- SVN_TRUNK="${SVN_ROOT}/trunk"
-
- SVN_BRANCHES="${SVN_ROOT}/branches"
- PACKAGE_BRANCH="${SVN_BRANCHES}/${PACKAGE_RELEASE}"
-
- SVN_TAGS="${SVN_ROOT}/tags"
- PACKAGE_TAG="${SVN_TAGS}/${PACKAGE_RELEASE}"
-
- if [ "${SVN_URL}" = "${SVN_TRUNK}" ]; then
- RELEASE_TYPE=minor
- elif [ "${SVN_URL/${SVN_BRANCHES}/}" != "${SVN_URL}" ]; then
- RELEASE_TYPE=micro
- else
- echo "error: bad URL: ${SVN_URL}" >&2
- die "unable to branch from the current location"
- fi
-}
-svn_setup_show() {
- cat <<INFO
-Release Type: ${RELEASE_TYPE}
- Branch URL: ${PACKAGE_BRANCH}
- Tag URL: ${PACKAGE_TAG}
-INFO
-}
-
-do_svn_echo_msg() { echo "svn: $1: $3"; }
-do_svn_echo() {
- case "$1" in
- commit)
- do_svn_echo_msg "$@"
- shift 3
- [ "$*" ] && echo "Files: $@"
- ;;
- copy|move)
- do_svn_echo_msg "$@"
- echo "From: ${4:-$2}"
- echo " To: ${5:-$3}"
- ;;
- *)
- local ACTION="$1"
- shift
- echo "svn: ${ACTION}: $@"
- ;;
- esac
-}
-do_svn() {
- do_svn_echo "$@"
- [ "${RELEASE_DRY_RUN}" ] || svn "$@"
-}
-do_svn_switch() {
- do_svn switch "$@"
- package_info_load
-}
-
-
-package_info_load_name() {
- grep AC_INIT configure.in | perl -ne 's/^.+\(\[([-\w]*)\],.+$/$1/ and print'
-}
-package_info_load_version() {
- grep AC_INIT configure.in | perl -ne 's/^.+\[([-\w\.]*)\],$/$1/ and print'
-}
-
-package_info_load() {
- [ -f "configure.in" ] || \
- die "package_info_load: configure.in is missing"
-
- PACKAGE_NAME="$(package_info_load_name)"
- # todo: fix this
- PACKAGE_TARNAME="${PACKAGE_NAME}"
-
- PACKAGE_VERSION="$(package_info_load_version)"
- [ "${RELEASE_VERSION}" ] || \
- RELEASE_VERSION=${PACKAGE_VERSION/-dev/}
-
- [ "${PACKAGE_NAME}" -a "${PACKAGE_VERSION}" ] || \
- die "package information is missing from configure script"
-
- PACKAGE_VERSION_TAGS=
- [ "${PACKAGE_VERSION/-/}" = "${PACKAGE_VERSION}" ] || \
- PACKAGE_VERSION_TAGS="-${PACKAGE_VERSION#*-}"
- PACKAGE_VERSION_BASE="${PACKAGE_VERSION%%-*}"
- PACKAGE_MICRO="${PACKAGE_VERSION_BASE##*.}"
- PACKAGE_MAJOR_AND_MINOR="${PACKAGE_VERSION_BASE%.*}"
- PACKAGE_MAJOR="${PACKAGE_MAJOR_AND_MINOR%.*}"
- PACKAGE_MINOR="${PACKAGE_MAJOR_AND_MINOR#*.}"
-
- PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}"
- if [ "${RELEASE_DRY_RUN}" ]; then
- PACKAGE_RELEASE="${PACKAGE_TARNAME}-${PACKAGE_VERSION}"
- else
- PACKAGE_RELEASE="${PACKAGE_TARNAME}-${RELEASE_VERSION}"
- fi
-}
-
-package_info_show() {
- cat <<INFO
-Name: ${PACKAGE_TARNAME}
-Release: ${RELEASE_VERSION}
-Version: ${PACKAGE_VERSION}
- Number: ${PACKAGE_VERSION_BASE}
- Series: ${PACKAGE_MAJOR_AND_MINOR}
- Major: ${PACKAGE_MAJOR}
- Minor: ${PACKAGE_MINOR}
- Micro: ${PACKAGE_MICRO}
- Tags: ${PACKAGE_VERSION_TAGS}
- Branch: ${PACKAGE_RELEASE}
-Release: ${PACKAGE_TARNAME}-${PACKAGE_VERSION_BASE}${PACKAGE_VERSION_TAGS}
-INFO
-}