Created
March 31, 2025 15:21
-
-
Save adithya2306/8ad241c0f2a7a7cad37bab06d8a074b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
ulimit -n $(ulimit -Hn) | |
push() { | |
BRANCH="vauxite" | |
repo="$1" | |
name=$(grep -m 1 "path=\"$repo\"" manifest/{aospa,system,vendor}.xml .repo/local_manifests/baristablend.xml | head -n 1 | sed -e 's/.*name="//' -e 's/".*//') | |
if [[ -z $name ]]; then | |
name=$(grep -m 1 "name=\"$repo\"" manifest/{aospa,system,vendor}.xml .repo/local_manifests/baristablend.xml | head -n 1 | sed -e 's/.*name="//' -e 's/".*//') | |
fi | |
if ! git -C $repo diff m/$BRANCH > /dev/null; then | |
echo -e "Error in $repo\n" | |
echo $repo >> .failed_diff.tmp | |
elif [ "$(git -C $repo diff m/$BRANCH)" != "" ]; then | |
url="https://github.com/pa-gr/$(echo $name | sed -e 's|AOSPA/||g' -e 's|platform/|android_|g' -e 's|/|_|g')" | |
echo "$repo -> $url" | |
git -C $repo push -f $url || echo $repo >> .failed_push.tmp | |
echo | |
fi | |
} | |
export -f push | |
rm -f .failed_diff.tmp .failed_push.tmp | |
touch .failed_diff.tmp .failed_push.tmp | |
repos=$(find -L * -type d -name '.git' 2> /dev/null | sed 's/\/\.git//g') | |
parallel -j8 -k push {} ::: $repos | |
echo -e "\nFailed diff repos:" | |
cat .failed_diff.tmp | |
echo -e "\nFailed push repos:" | |
cat .failed_push.tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment