Skip to content

Commit bc305d6

Browse files
committed
tools/semver-compare.sh: add "[[" alias to test action, and non-equality checks [networkupstools#3055]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent f868a82 commit bc305d6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/semver-compare.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ EOF
221221
| awk '{print $2}'
222222
exit
223223
;;
224-
'['|test|--test)
224+
'['|'[['|test|--test)
225225
if [ $# -lt 4 ] ; then
226226
echo "ERROR: Not enough args to 'test' comparison of two semvers" >&2
227227
exit 2
@@ -237,6 +237,13 @@ EOF
237237
exit 1
238238
fi
239239
;;
240+
'-ne'|'!='|'<>')
241+
if [ x"${SEMVER1}" = x"${SEMVER2}" ] ; then
242+
exit 1
243+
else
244+
exit 0
245+
fi
246+
;;
240247
'-gt'|'>')
241248
if [ x"${SEMVER_MIN}" = x"${SEMVER2}" ] && [ x"${SEMVER1}" != x"${SEMVER2}" ] ; then
242249
exit 0

0 commit comments

Comments
 (0)