diff options
-rw-r--r-- | src/infrastructure/machines.scm | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/infrastructure/machines.scm b/src/infrastructure/machines.scm index 70e6cb2..93baec5 100644 --- a/src/infrastructure/machines.scm +++ b/src/infrastructure/machines.scm @@ -107,7 +107,21 @@ date '+%Y-%m-%dT%H:%M:%S%Z' } - OUT="$(echo 'mkstemp(template)' | m4 -D template="${TMPDIR:-/tmp}/m4-tmpname")" + uuid() { + # Taken from: + # https://serverfault.com/a/799198 + od -xN20 /dev/urandom | + head -n1 | + awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' + } + + mkstemp() { + name="${TMPDIR:-/tmp}/uuid-tmpname with spaces.$(uuid)" + touch "$name" + echo "$name" + } + + OUT="$(mkstemp)" printf 'Running command: %s\nStarting at: %s\n\n' "$*" "$(now)" >> "$OUT" ("$@" 2>&1) >> "$OUT" STATUS="$?" @@ -254,8 +268,7 @@ (append (map (compose list specification->package+output symbol->string) '(nss-certs ; required for guix pull git-minimal - borg - m4)) + borg)) %base-packages)) (services (append |