aboutsummaryrefslogtreecommitdiff
path: root/ck.
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-10-10 03:54:40 -0400
committerB. Watson <urchlay@slackware.uk>2026-10-10 03:54:40 -0400
commit6abac20d38e021279a88f412b78431369300dc62 (patch)
tree4338cc99e58e484332d89e908e0f5f3de56a2a1e /ck.
parent12d44ae5d93ba1ad604c4f30e3db861b6b2b9260 (diff)
downloadck4up-config-6abac20d38e021279a88f412b78431369300dc62.tar.gz
Add gitlab.conf, lists of unchecked builds (*.txt), ck and ck. scripts.
Diffstat (limited to 'ck.')
-rwxr-xr-xck.42
1 files changed, 42 insertions, 0 deletions
diff --git a/ck. b/ck.
new file mode 100755
index 0000000..7ab3b8a
--- /dev/null
+++ b/ck.
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+colorize_ver() {
+ color="${1:-3}"
+ perl -pe 's,(\d[\d.]+),\x1b[1;3'$color'm$1\x1b[0m,x'
+}
+
+sort_color() {
+ sort -V | colorize_ver
+}
+
+last_gh_commit() {
+ # only show latest commit
+ head -1 | sed 's,.*::Commit/\([^<]*\)</id>,\1,'
+}
+
+last_gh_tag() {
+ # only show latest commit
+ head -1 | sed 's,.*/v*\([^/]*\)</id.*,\1,'
+}
+
+DIR=~/.ck4up
+build="$( basename $( pwd ) )"
+conf="$( grep -l "^$build " $DIR/*.conf )"
+
+case "$conf" in
+ "") echo "can't find $build in $DIR/*.conf" 2>&1 ; exit 0 ;;
+ *" "*) echo "$build is in multiple configs: $conf" 2>&1; exit 0;;
+ *) ;;
+esac
+
+if grep -q "^$build .*github.*commits.atom" $conf; then
+ postproc="last_gh_commit"
+elif grep -q "^$build .*github.*tags.atom" $conf ; then
+ postproc="last_gh_tag"
+else
+ postproc="sort_color"
+fi
+
+ck4up -dk -f "$conf" "^$build\\s" | $postproc
+source ./*.info
+echo "===> VERSION=$VERSION" | colorize_ver 2