Created
September 19, 2023 20:06
-
-
Save chenrui333/78fb360594b5544ba08f7e2709bb093f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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