5ca8d5a9b144f89d7c470fc6ea7ed0c184c70b01
3 # usage: cut-release [-n] version-designation [make-args...]
7 echo -n "Does that look right? [y/n] "
9 if [ "$yn" = y
-o "$yn" = Y
-o "$yn" = yes -o "$yn" = YES
-o "$yn" = Yes
]; then
11 elif [ "$yn" = n
-o "$yn" = N
-o "$yn" = no
-o "$yn" = NO
-o "$yn" = No
]; then
12 echo "Aborting as per user request." >&2
20 if [ "$1" = -n ]; then
28 echo "Usage: $(basename "$0") [-n] version-designation [make-args...]" >&2
29 echo "-n does a dry run (i.e., do sanity checks and build but don't touch the repository)"
33 if ! [ -e src
/expr
/node.h
-a -e .svn
]; then
34 echo "$(basename "$0"): ERROR: you should run this from the top-level of a CVC4 subversion working directory" >&2
41 if echo "$version" |
grep '[^a-zA-Z0-9_.+(){}^%#-]' &>/dev
/null
; then
42 echo "$(basename "$0"): ERROR: version designation \`$version' contains illegal characters" >&2
46 vs
=($
(echo "$version" |
sed 's,^\([0-9]*\)\.\([0-9]*\)\(\.\([0-9]*\)\)\?\(.*\),\1 \2 \4 \5,'))
54 echo "Release: $release"
57 version
="$major.$minor"
58 if [ "$release" != 0 ]; then
59 version
="$version.$release"
61 version
="$version$extra"
62 echo "Version: $version"
66 if ! svn
ls "https://subversive.cims.nyu.edu/cvc4/cvc4/tags/releases/$version" 2>&1 >/dev
/null |
grep non-existent
>/dev
/null
; then
67 echo "$(basename "$0"): ERROR: subversion repo already contains a release \`$version'" >&2
72 if [ -n "$(svn status -q configure.ac)" ]; then
73 echo "$(basename "$0"): ERROR: in dry-run mode, cannot operate properly with local modifications to \"configure.ac\", sorry" >&2
76 elif [ -n "$(svn status -q)" ]; then
77 echo "$(basename "$0"): ERROR: \"svn status\" indicates there are local modifications; please commit first" >&2
81 root
="$(svn info | grep "^Repository Root
: https
://subversive.cims.nyu.edu
/.
*" | cut -f3 -d' ')"
82 if [ -z "$root" ]; then
83 echo "$(basename "$0"): ERROR: can't get repository root URL" 2>&1
87 if [ `svn -uq status | wc -l` -ne 1 ]; then
88 echo "$(basename "$0"): ERROR: this working directory isn't up to date" 2>&1
92 if ! grep '^m4_define(_CVC4_MAJOR, *[0-9][0-9]* *)' configure.ac
&>/dev
/null ||
93 ! grep '^m4_define(_CVC4_MINOR, *[0-9][0-9]* *)' configure.ac
&>/dev
/null ||
94 ! grep '^m4_define(_CVC4_RELEASE, *[0-9][0-9]* *)' configure.ac
&>/dev
/null ||
95 ! grep '^m4_define(_CVC4_EXTRAVERSION, *\[.*\] *)' configure.ac
&>/dev
/null
; then
96 echo "$(basename "$0"): ERROR: cannot locate the version info lines of configure.ac" >&2
99 perl
-pi -e 's/^m4_define\(_CVC4_MAJOR, ( *)[0-9]+( *)\)/m4_define(_CVC4_MAJOR, ${1}'"$major"'$2)/;
100 s/^m4_define\(_CVC4_MINOR, ( *)[0-9]+( *)\)/m4_define(_CVC4_MINOR, ${1}'"$minor"'$2)/;
101 s/^m4_define\(_CVC4_RELEASE, ( *)[0-9]+( *)\)/m4_define(_CVC4_RELEASE, ${1}'"$release"'$2)/;
102 s/^m4_define\(_CVC4_EXTRAVERSION, ( *)\[.*\]( *)\)/m4_define(_CVC4_EXTRAVERSION, $1\['"$extra"'\]$2)/' configure.ac
104 trap 'echo; echo; echo "Aborting in error."; svn revert configure.ac; echo' EXIT
107 echo 'Made the following change to configure.ac:'
109 svn
diff configure.ac
113 if ! grep '^m4_define(_CVC4_MAJOR, *'"$major"' *)' configure.ac
&>/dev
/null ||
114 ! grep '^m4_define(_CVC4_MINOR, *'"$minor"' *)' configure.ac
&>/dev
/null ||
115 ! grep '^m4_define(_CVC4_RELEASE, *'"$release"' *)' configure.ac
&>/dev
/null ||
116 ! grep '^m4_define(_CVC4_EXTRAVERSION, *\['"$extra"'\] *)' configure.ac
&>/dev
/null
; then
117 echo "$(basename "$0"): INTERNAL ERROR: cannot find the modified version info lines in configure.ac, bailing..." >&2
120 if [ -z "$(svn status -q configure.ac)" ]; then
121 echo "$(basename "$0"): INTERNAL ERROR: \"svn status\" indicates there are no local modifications to configure.ac; I expected the ones I just made!" >&2
126 version="'$version'"; \
129 mkdir "release-$version"; \
130 cd "release-$version"; \
131 ../configure production-cln-staticbinary --disable-shared --enable-unit-testing --with-cudd --with-readline; \
133 tar xf "cvc4-$version.tar.gz"; \
134 cd "cvc4-$version"; \
135 ./configure production-cln-staticbinary --disable-shared --enable-unit-testing --with-cudd --with-readline; \
137 make distcheck "$@"; \
142 if ! [ -e release-
$version/cvc4-
$version.
tar.gz
]; then
143 echo "$(basename "$0"): INTERNAL ERROR: cannot find the distribution tarball I just built" >&2
146 if ! [ -e release-
$version/src
/main
/cvc4
]; then
147 echo "$(basename "$0"): INTERNAL ERROR: cannot find the binary I just built" >&2
152 echo 'This release of CVC4 will identify itself as:'
154 release-
$version/src
/main
/cvc4
--version
159 echo 'This binary release of CVC4 will identify itself as being configured like this:'
161 release-
$version/src
/main
/cvc4
--show-config
166 echo "Signing tarball..."
167 cp -p "release-$version/cvc4-$version.tar.gz" .
168 gpg
-b --armor "cvc4-$version.tar.gz"
171 echo "Signing binary..."
172 cp -p "release-$version/src/main/cvc4" "cvc4-$version"
173 gpg
-b --armor "cvc4-$version"
176 echo "About to run: svn commit -m \"Cutting release $version.\""
178 $dryrun || svn commit
-m "Cutting release $version."
181 echo "About to run: svn copy -m \"Cutting release $version.\" \"$root\" \"https://subversive.cims.nyu.edu/cvc4/cvc4/tags/releases/$version\""
183 $dryrun || svn copy
-m "Cutting release $version." "$root" "https://subversive.cims.nyu.edu/cvc4/cvc4/tags/releases/$version"