summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2018-03-03 22:36:03 +0200
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2018-03-03 22:36:03 +0200
commit6326053490c70114656c0f04c0c894a249a7eab0 (patch)
tree68189676c22af3638eb6859428360045aa26584e /pkgs/tools
parent9041eff01ee07026696ac30bb2510ec3efc9a447 (diff)
downloadnixlib-6326053490c70114656c0f04c0c894a249a7eab0.tar
nixlib-6326053490c70114656c0f04c0c894a249a7eab0.tar.gz
nixlib-6326053490c70114656c0f04c0c894a249a7eab0.tar.bz2
nixlib-6326053490c70114656c0f04c0c894a249a7eab0.tar.lz
nixlib-6326053490c70114656c0f04c0c894a249a7eab0.tar.xz
nixlib-6326053490c70114656c0f04c0c894a249a7eab0.tar.zst
nixlib-6326053490c70114656c0f04c0c894a249a7eab0.zip
diffoscope: Add script to list required tools
Diffstat (limited to 'pkgs/tools')
-rwxr-xr-xpkgs/tools/misc/diffoscope/list-tools.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/tools/misc/diffoscope/list-tools.sh b/pkgs/tools/misc/diffoscope/list-tools.sh
new file mode 100755
index 000000000000..9af7f0e38899
--- /dev/null
+++ b/pkgs/tools/misc/diffoscope/list-tools.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+diffoscope=$(nix-build --no-out-link -E 'with import ./. {}; diffoscope.override { enableBloat = true; }')/bin/diffoscope
+
+required=$($diffoscope --list-tools | \
+    grep '^External-Tools-Required:' | \
+    cut -d ' ' -f2- | \
+    tr -d ,)
+
+# Uber-hacky!
+pathScript=$(cat $diffoscope | grep PATH)
+
+export PATH=$(nix-build --no-out-link -A which)/bin
+eval "$pathScript"
+
+for tool in $required; do
+    if ! which $tool >/dev/null 2>&1; then
+        echo $tool
+    fi
+done | sort