diff options
author | EuAndreh <eu@euandre.org> | 2022-03-28 14:04:09 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-03-28 14:04:09 -0300 |
commit | 23dcf918f64728068ee4d64e03b446e679e78a1d (patch) | |
tree | 9597020398445de015d4cef18c94f0e468fda89d /src/infrastructure/machines.scm | |
parent | TODOs.md: Add #td-d92756f5-97db-e9ff-dd1e-0149a694c565 (diff) | |
download | server-23dcf918f64728068ee4d64e03b446e679e78a1d.tar.gz server-23dcf918f64728068ee4d64e03b446e679e78a1d.tar.xz |
src/infrastructure/machines.scm: Remove m4, stop depending on it
Diffstat (limited to 'src/infrastructure/machines.scm')
-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 |