root/trunk/scripts/tag-licq-release.sh

Revision 6067, 2.5 kB (checked in by erijo, 10 months ago)

Include qt4-gui

  • Property svn:executable set to *
Line 
1#!/bin/sh
2#
3# Script to tag a Licq release.
4#
5# Copyright (c) 2007 Erik Johansson <erijo@licq.org>
6#
7# Distributed under the terms of the GNU GPL version 2.
8#
9
10### SETTINGS ###
11
12# Set to the URL you use to check out Licq
13REPO="svn+ssh://licq"
14
15### END SETTINGS ###
16function usage()
17{
18    echo "Usage: $0 -v version -r rev"
19    echo "  -h, --help  This message"
20    echo "  -v          Name the tag licq-<version> (e.g. 1.3.5-rc3)"
21    echo "  -r          Revision to tag (e.g. 5656)"
22}
23
24args=$(getopt -n "$0" -o h,v:,r: -l help -- $*)
25if [ $? -ne 0 ]; then
26    echo ""
27    usage
28    exit 1
29fi
30
31set -- $args
32while [ $# -gt 0 ]; do
33    case $1 in
34    -h|--help) usage; exit 0 ;;
35    -v) VERSION="licq-$(eval echo $2)"; shift ;;
36    -r) REV=$(eval echo $2); shift ;;
37    --) ;;
38    *) echo "$0: unknown option '$1'"; exit 1 ;;
39    esac
40    shift
41done
42
43if [ -z "$VERSION" -o -z "$REV" ]; then
44    echo "$0: Missing argument"
45    echo "Try \`$0 --help' for more information"
46    exit 2
47fi
48
49TMPDIR=$(mktemp -d) || exit 1
50TAGDIR="${TMPDIR}/${VERSION}"
51
52function cleanup
53{
54  echo "Removing ${TMPDIR}"
55  rm -rf "${TMPDIR}"
56}
57
58function failed
59{
60  echo "failed"
61  cleanup
62  exit 1
63}
64
65echo -n "Getting tags dir..."
66svn co -N -q "${REPO}/tags" "${TMPDIR}" || failed
67echo "done"
68
69function svncp
70{
71  echo -n "Copying $1 to $2..."
72  svn cp -r$REV -q "${REPO}/trunk/$1" "${TAGDIR}/$2" || failed
73  echo "done"
74}
75
76svncp licq /
77
78# Remove the checked out externals
79for dir in $(svn pg svn:externals "${TAGDIR}" | awk '{print $1}'); do
80  if [ -d "${TAGDIR}/${dir}" ]; then
81    echo -n "Removing external ${dir}..."
82    rm -rf "${TAGDIR}/${dir}" || failed
83    echo "done"
84  fi
85done
86
87# Remove the externals property
88echo -n "Removing svn:externals..."
89svn pd -q svn:externals "${TAGDIR}" || failed
90echo "done"
91
92# Add admin and all plugins
93svncp admin admin
94for plugin in auto-reply console email licqweb msn osd qt-gui qt4-gui rms; do
95  svncp $plugin plugins/$plugin
96done
97
98function separator
99{
100  echo ""
101  echo "###########################################################################"
102  echo ""
103}
104
105# Create the commit message
106msg="${TMPDIR}/svn-commit.tmp"
107echo "Tagged ${VERSION} from trunk r${REV}." > "$msg"
108separator
109
110echo "svn status:"
111svn st -q "${TMPDIR}"
112separator
113
114echo "svn diff:"
115svn diff "${TMPDIR}"
116separator
117
118echo "Commit message:"
119cat "$msg"
120separator
121
122echo -n "Enter yes to commit: "
123read ans
124if [ "$ans" == "yes" ]; then
125  svn ci -F "$msg" "${TMPDIR}"
126  cleanup
127else
128  echo "OK, commit ${TMPDIR} manually then."
129  echo "I left the commit message in ${msg}."
130fi
Note: See TracBrowser for help on using the browser.