Skip to content

Commit dfe6062

Browse files
authored
Merge pull request networkupstools#2920 from jimklimov/spellcheck-quick
Fix shell regexes with empty (part of) expectation for portability
2 parents 304f0c3 + e286d0d commit dfe6062

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -3705,7 +3705,7 @@ no)
37053705
if test -n "${DOC_CANNOTBUILD_LIST}"; then
37063706
DOC_CANNOTBUILD_LIST_LINES="`echo "${DOC_CANNOTBUILD_LIST}" | tr ' ' '\n' | grep -vE '^$'`"
37073707
for DOCTYPE in ${nut_doc_build_list} ; do
3708-
if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}(|=yes)\$" >/dev/null 2>/dev/null ; then
3708+
if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}(=yes)?\$" >/dev/null 2>/dev/null ; then
37093709
AC_MSG_ERROR([Unable to build${DOC_CANNOTBUILD_LIST} documentation (check for 'no' results above)])
37103710
else if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}=(skip|auto|dist-auto)\$" >/dev/null 2>/dev/null ; then
37113711
AC_MSG_NOTICE([Unable to build${DOC_CANNOTBUILD_LIST} documentation (check for 'no' results above), skipping])

scripts/Windows/dllldd.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dllldd() (
2626
for OD in objdump "$ARCH-objdump" ; do
2727
(command -v "$OD" >/dev/null 2>/dev/null) || continue
2828

29-
ODOUT="`$OD -x "$@" 2>/dev/null | grep -Ei "DLL Name:" | awk '{print $NF}' | sort | uniq | grep -vEi '^(|/.*/)(msvcrt|userenv|bcrypt|rpcrt4|usp10|(advapi|kernel|user|wsock|ws2_|gdi|ole||shell)(32|64))\.dll$'`" \
29+
ODOUT="`$OD -x "$@" 2>/dev/null | grep -Ei "DLL Name:" | awk '{print $NF}' | sort | uniq | grep -vEi '^(/.*/)?(msvcrt|userenv|bcrypt|rpcrt4|usp10|(advapi|kernel|user|wsock|ws2_|gdi|ole||shell)(32|64))\.dll$'`" \
3030
&& [ -n "$ODOUT" ] || continue
3131

3232
for F in $ODOUT ; do

tools/gitlog2version.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ getver_git() {
197197
# string over longer ones if available, or older RC over newer release
198198
# like "v2.8.2-rc8" preferred over "v2.8.3" if they happen to be tagging
199199
# the same commit):
200-
DESC_PRERELEASE="`git describe --tags | grep -E '^v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*(|-(rc|alpha|beta)-*[0-9][0-9]*)$'`" \
200+
DESC_PRERELEASE="`git describe --tags | grep -E '^v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*([0-9]*|[-](rc|alpha|beta)[-]*[0-9][0-9]*)$'`" \
201201
|| DESC_PRERELEASE=""
202202

203203
# How much of the known trunk history is in current HEAD?
@@ -283,7 +283,7 @@ getver_default() {
283283
# Assume triplet (possibly prefixed with `v`) + suffix
284284
# like `v2.8.3-rc6` or `2.8.2-beta-1`
285285
# FIXME: Check the assumption better!
286-
SUFFIX="`echo "${NUT_VERSION_DEFAULT}" | grep -E '^v*[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*(|-(rc|alpha|beta)-*[0-9][0-9]*)$' | sed -e 's/^v*//' -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)\([^0-9].*\)$/\2/'`" \
286+
SUFFIX="`echo "${NUT_VERSION_DEFAULT}" | grep -E '^v*[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*([0-9]*|[-](rc|alpha|beta)[-]*[0-9][0-9]*)$' | sed -e 's/^v*//' -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)\([^0-9].*\)$/\2/'`" \
287287
&& [ -n "${SUFFIX}" ] \
288288
&& SUFFIX_PRERELEASE="`echo "${SUFFIX}" | sed 's/^-*//'`" \
289289
&& NUT_VERSION_DEFAULT="`echo "${NUT_VERSION_DEFAULT}" | sed -e 's/'"${SUFFIX}"'$//'`"

0 commit comments

Comments
 (0)