[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 144/335: add version check to uncrustify hook
From: |
gnunet |
Subject: |
[libmicrohttpd] 144/335: add version check to uncrustify hook |
Date: |
Sat, 27 Jul 2024 22:00:40 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.
commit 6326efdd96bc29d0a4f3fba1e0ed77dceda56f9e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Apr 8 21:15:31 2024 +0200
add version check to uncrustify hook
---
contrib/uncrustify_precommit | 53 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/contrib/uncrustify_precommit b/contrib/uncrustify_precommit
index 24873330..c7678c53 100755
--- a/contrib/uncrustify_precommit
+++ b/contrib/uncrustify_precommit
@@ -1,9 +1,60 @@
-#!/bin/sh
+#!/bin/bash
# use as .git/hooks/pre-commit
+function vercomp () {
+ if [[ $1 == $2 ]]
+ then
+ return 0
+ fi
+ local IFS=.
+ local i ver1=($1) ver2=($2)
+ # fill empty fields in ver1 with zeros
+ for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
+ do
+ ver1[i]=0
+ done
+ for ((i=0; i<${#ver1[@]}; i++))
+ do
+ if [[ -z ${ver2[i]} ]]
+ then
+ # fill empty fields in ver2 with zeros
+ ver2[i]=0
+ fi
+ if ((10#${ver1[i]} > 10#${ver2[i]}))
+ then
+ return 1
+ fi
+ if ((10#${ver1[i]} < 10#${ver2[i]}))
+ then
+ return 2
+ fi
+ done
+ return 0
+}
+
exec 1>&2
+if ! uncrustify --version > /dev/null
+then
+ echo 'uncrustify required'
+ exit 1
+fi
+
+HAVE=$(uncrustify --version | sed -e 's/.*-//' -e 's/_.//')
+
+vercmp 0.78.0 "$HAVE"
+case $? in
+ 0)
+ ;;
+ 1)
+ echo "your uncrustify is too old";
+ exit 1
+ ;;
+ 2)
+ ;;
+esac
+
RET=0
changed=$(git diff --cached --name-only)
crustified=""
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 137/335: microhttpd2.h: fixed macro which had strange parsing results, (continued)
- [libmicrohttpd] 137/335: microhttpd2.h: fixed macro which had strange parsing results, gnunet, 2024/07/27
- [libmicrohttpd] 139/335: microhttpd2.h: updated and reduced the list of required system types, gnunet, 2024/07/27
- [libmicrohttpd] 131/335: Partial revert of 83205a8ab9f030408f8cb89c8cfa46196a5eef04., gnunet, 2024/07/27
- [libmicrohttpd] 133/335: Fixed name of the option parameter in the database, gnunet, 2024/07/27
- [libmicrohttpd] 135/335: microhttpd2.h: workaround for uncrustify bug, gnunet, 2024/07/27
- [libmicrohttpd] 152/335: -fix config, gnunet, 2024/07/27
- [libmicrohttpd] 154/335: Fixed reused enum values, gnunet, 2024/07/27
- [libmicrohttpd] 141/335: D Options DB: update, gnunet, 2024/07/27
- [libmicrohttpd] 155/335: microhttpd2.h: applied formatting, gnunet, 2024/07/27
- [libmicrohttpd] 157/335: stash, gnunet, 2024/07/27
- [libmicrohttpd] 144/335: add version check to uncrustify hook,
gnunet <=
- [libmicrohttpd] 143/335: -fix _some_ compiler errors, gnunet, 2024/07/27
- [libmicrohttpd] 147/335: Fixed data in request options DB, gnunet, 2024/07/27
- [libmicrohttpd] 145/335: Revert most of cacc8860fce31961570a1ba0d6f74836890cfa5b, gnunet, 2024/07/27
- [libmicrohttpd] 132/335: Unified enum formatting, gnunet, 2024/07/27
- [libmicrohttpd] 140/335: Tmp: add doxy-config, gnunet, 2024/07/27
- [libmicrohttpd] 148/335: Fixed all doxygen warnings, gnunet, 2024/07/27
- [libmicrohttpd] 162/335: configure: check for more optional headers, gnunet, 2024/07/27
- [libmicrohttpd] 150/335: microhttpd2.h: fixed all g++ warnings and errors, gnunet, 2024/07/27
- [libmicrohttpd] 146/335: microhttpd2.h: more fixes, gnunet, 2024/07/27
- [libmicrohttpd] 163/335: configure: use more headers when checking for calloc(), gnunet, 2024/07/27