: nply/minci

commit 6b61cdc0700fc7a8f8efe5554e8b10c58998f65d
parent 9508b26bbc8b9988e1c31c25c8bdf429602b160b
Author: kristapsdz <kristaps@bsd.lv>
Date: Thu, 5 Mar 2020 14:37:06 +0000

Allow overriding repos and don't use unportable echo.
1 file changed, 25 insertions(+), 4 deletions(-)
M
minci.sh
|
29
+++++++++++++++++++++++++----
diff --git a/minci.sh b/minci.sh
@@ -1,11 +1,13 @@
 #! /bin/sh
 
-MAKE=make
+# Usage:
+# minci.sh [repo...]
+# Use ~/.minci or /etc/minci for configuration, whichever comes first.
+
+MAKE="make"
 API_SECRET=
 API_KEY=
 SERVER=
-TESTS_GLOBAL="/usr/local/share/minci/deps"
-TESTS_LOCAL="$HOME/.local/share/minci/deps"
 STAGING="$HOME/.local/cache/minci"
 CONFIG=
 CONFIG_LOCAL="$HOME/.minci"

@@ -111,6 +113,25 @@ do
 		exit 1
 	fi
 
+	# See if we should run this.
+
+	if [ $# -gt 0 ]
+	then
+		for prog in $@
+		do
+			if [ "$prog" = "$reponame" ]
+			then
+				prog=""
+				break
+			fi
+		done
+		if [ -n "$prog" ]
+		then
+			echo "$0: ignoring: $reponame"
+			continue
+		fi
+	fi
+
 	# Now errors without || are fatal.
 
 	set -e

@@ -248,7 +269,7 @@ do
 	QUERY="${QUERY}&report-unamev=${UNAME_V}"
 	QUERY="${QUERY}&user-apisecret=${API_SECRET}"
 
-	SIGNATURE=`/bin/echo -n "$QUERY" | openssl dgst -md5 -hex | sed 's!^[^=]*= !!'`
+	SIGNATURE=`printf "%s" "$QUERY" | openssl dgst -md5 -hex | sed 's!^[^=]*= !!'`
 
 	# Now actually send the report.
 	# It includes the signature and optionally the build log (only