about summary refs log tree commit diff
path: root/pkgs/build-support/gcc-wrapper/utils.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/gcc-wrapper/utils.sh')
-rw-r--r--pkgs/build-support/gcc-wrapper/utils.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/build-support/gcc-wrapper/utils.sh b/pkgs/build-support/gcc-wrapper/utils.sh
new file mode 100644
index 0000000000000..5163c239527c4
--- /dev/null
+++ b/pkgs/build-support/gcc-wrapper/utils.sh
@@ -0,0 +1,13 @@
+skip () {
+    if test "$NIX_DEBUG" = "1"; then
+        echo "skipping impure path $1" >&2
+    fi
+}
+
+badPath() {
+    local p=$1
+    test \
+        "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
+        "${p:0:4}" != "/tmp" -a \
+        "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
+}