Skip to content

Instantly share code, notes, and snippets.

@chenrui333
Created September 19, 2023 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenrui333/78fb360594b5544ba08f7e2709bb093f to your computer and use it in GitHub Desktop.
Save chenrui333/78fb360594b5544ba08f7e2709bb093f to your computer and use it in GitHub Desktop.
#!/bin/bash
RED="\033[0;31m"
NC="\033[0m"
c="@"
while true ; do
if ( git show -m "$c" | grep -q '^- *sha256.*sonoma' ) ; then
for file in `git show -m "$c" | grep '^diff ' | sed -e 's/.*\/Formula\///'` ; do
form=`echo $file | sed -e 's/\.rb//' -e 's/.*\///'`
if ( git show -m "$c" -- $file | grep -q '^- *sha256.*sonoma' ) ; then
if ( grep -q 'sha256.*sonoma' $file ) ; then
echo "$form: bottle restored (removed in commit $c)"
else
echo -e "$form: ${RED}bottle lost${NC}"
fi
fi
done
#f=`git show -m "$c" | head -n 6 | grep 'update .* bottle' | sed -e 's/^ *//' -e 's/:.*//'`
#if ( grep -q 'sha256 .*sonoma' $f.rb ) ; then
# true
# echo "$f: bottle was restored"
#else
# echo -e "${RED}$f${NC}"
#fi
fi
c=`git show "$c" | head -n 1 | sed -e 's/^commit //'`
c="${c}^"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment