summaryrefslogtreecommitdiff
path: root/scripts/guix-retry
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/guix-retry')
-rwxr-xr-xscripts/guix-retry21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/guix-retry b/scripts/guix-retry
new file mode 100755
index 0000000..c504048
--- /dev/null
+++ b/scripts/guix-retry
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+error="write_to_session_record_port"
+
+# create redirection
+# file descripters
+exec 11>&1 # stdout
+exec 22>&2 # stderr
+
+while true; do
+ # send stdout to stdout
+ # send stderr though pipe
+ output=$("$@" 2>&1 1>&11 | tee >(cat - >&22)) # return stderr to
+ # normal stderr as well
+
+ # check if error is in stderr
+ if echo "$output" | grep -q "$error"; then
+ continue
+ fi
+ break
+done