2018-03-03 21:36:03 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-07-19 01:31:23 +02:00
|
|
|
# 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.
|
|
|
|
|
2018-03-03 21:36:03 +01:00
|
|
|
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
|