Revision a71afd47 autotools/check-version
b/autotools/check-version | ||
---|---|---|
1 | 1 |
#!/bin/bash |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2010 Google Inc. |
|
4 |
# Copyright (C) 2010,2013 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
31 | 31 |
# Format "x.y.z" |
32 | 32 |
$numpat.$numpat.$numpat) : ;; |
33 | 33 |
|
34 |
# Format "x.y.z~rcN" or "x.y.z~betaN" for N > 0 |
|
35 |
$numpat.$numpat.$numpat~@(rc|beta)[1-9]*([0-9])) : ;; |
|
34 |
# Format "x.y.z~rcN" or "x.y.z~betaN" or "x.y.z~alphaN" for N > 0
|
|
35 |
$numpat.$numpat.$numpat~@(rc|beta|alpha)[1-9]*([0-9])) : ;;
|
|
36 | 36 |
|
37 | 37 |
*) |
38 | 38 |
echo "Invalid version format: $version" >&2 |
... | ... | |
42 | 42 |
|
43 | 43 |
readonly newsver="Version ${version/\~/ }" |
44 | 44 |
|
45 |
if ! grep -q -x "$newsver" $newsfile |
|
45 |
# Only alpha versions are allowed not to have their own NEWS section yet |
|
46 |
set +e |
|
47 |
FOUND=x`echo $version | grep "alpha[1-9]*[0-9]$"` |
|
48 |
set -e |
|
49 |
if [ $FOUND == "x" ] |
|
46 | 50 |
then |
47 |
echo "Unable to find heading '$newsver' in NEWS" >&2 |
|
48 |
exit 1 |
|
51 |
if ! grep -q -x "$newsver" $newsfile |
|
52 |
then |
|
53 |
echo "Unable to find heading '$newsver' in NEWS" >&2 |
|
54 |
exit 1 |
|
55 |
fi |
|
49 | 56 |
fi |
50 | 57 |
|
51 | 58 |
exit 0 |
Also available in: Unified diff