2018-04-06 14:12:57 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Find all imag commands which changed since last install
|
|
|
|
|
2018-10-12 15:44:57 +00:00
|
|
|
imag versions 2>&1 | \
|
|
|
|
grep "imag-" | \
|
|
|
|
sed 's,\ *->.*\ , ,' | \
|
2018-04-06 14:12:57 +00:00
|
|
|
while read binary hash; do
|
2018-10-12 15:44:57 +00:00
|
|
|
if [[ "$hash" =~ v.*\..*\..*- ]]; then
|
|
|
|
hash="$(echo "$hash" | sed 's,.*-g,,')"
|
|
|
|
fi
|
|
|
|
|
|
|
|
log="$(git diff --name-only ${hash}..master 2>/dev/null)"
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
echo "$log" | \
|
|
|
|
grep "$binary" >/dev/null 2>/dev/null && \
|
|
|
|
echo -e "changed since last install ($hash): $binary"
|
|
|
|
else
|
|
|
|
echo "WARN: Could not check $binary because git hash '$hash' is not present"
|
|
|
|
fi
|
|
|
|
|
2018-04-06 14:12:57 +00:00
|
|
|
done
|
2018-10-12 15:44:57 +00:00
|
|
|
|