1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/pkgs/tools/misc/diffoscope/list-missing-tools.sh
Tuomas Tynkkynen a595896c56 diffoscope: Document the script to locate missing optional dependencies
And give it it a bit more descriptive name of list-missing-tools.sh.
2018-07-19 02:31:23 +03:00

24 lines
656 B
Bash
Executable file

#!/usr/bin/env bash
# This script lists all the optional command-line tools that diffoscope can use
# (i.e. `diffoscope --list-tools`) but are missing from the Nix expression.
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