Skip to content

Commit 1c85ca3

Browse files
committed
Use extended regex instead of Perl regex
1 parent be35669 commit 1c85ca3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

package.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
#
33
set -e
44

5+
# Shorthand for digit class:
6+
d="[[:digit:]]"
57
# Determine the version and build timestamp
68
VERSION=$(sed -n -e "s/^set(log4cxx_VER \"\(.*\)\")/\1/p" < src/cmake/projectVersionDetails.cmake)
7-
if ! echo "$VERSION" | grep -Pq '^\d+\.\d+\.\d+$'; then
9+
if ! echo "$VERSION" | grep -Eq "^$d+\.$d+\.$d+$"; then
810
echo Invalid version number: "$VERSION" >& 2
911
exit 1
1012
fi
1113

1214
OUTPUT_TIMESTAMP=$(sed -n -e "s/^set(log4cxx_OUTPUT_TIMESTAMP \"\(.*\)\")/\1/p" < src/cmake/projectVersionDetails.cmake)
13-
if ! echo "$OUTPUT_TIMESTAMP" | grep -Pq '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$'; then
15+
if ! echo "$OUTPUT_TIMESTAMP" | grep -Eq "^$d{4}-$d{2}-$d{2}T$d{2}:$d{2}:$d{2}Z$"; then
1416
echo Invalid build timestamp: "$OUTPUT_TIMESTAMP" >& 2
1517
echo Run '`'date -u +%Y-%m-%dT%H:%M:%SZ'`' to generate it
1618
exit 1

0 commit comments

Comments
 (0)