buildinfo generation: avoid error message with older versions of jo
authorMichael Prokop <mika@grml.org>
Wed, 26 Jan 2022 12:27:23 +0000 (13:27 +0100)
committerMichael Prokop <mika@grml.org>
Wed, 26 Jan 2022 12:27:31 +0000 (13:27 +0100)
We use the jo(1) tool for generating /conf/buildinfo.json.
To avoid syntax errors when sorting the list of keys/values, we
also end the last entry (wayback_date=...) with a "\", so the next
line is considered, and reordering the list is simple.

The usage of ":" isn't supported by older versions of jo, though:

| % jo -v
| jo 1.0
| % jo -p foo=bar :
| Argument `:' is neither k=v nor k@v
| {
|    "foo": "bar"
| }

FTR, newer versions don't cause any failure messages:

| % jo -v
| jo 1.3
| % jo -p foo=bar :
| {
|    "foo": "bar"
| }

Since there's no strong need to use ":", the error message might look
like the /conf/buildinfo.json isn't generated (while it still is), and
I'd like to keep sorting the list easy and error free, let's fix this.
Usage of "--" usually ends list of command line options, let's use this
pattern instead.

grml-live

index cd9290e..e524e71 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -1498,7 +1498,7 @@ generate_build_info() {
     timestamp="$(TZ=UTC date +%s)" \
     update_only="${UPDATE}" \
     wayback_date="${WAYBACK_DATE}" \
-  :
+  --
 }
 # }}}