Skip to content

Instantly share code, notes, and snippets.

@rokibhasansagar
Last active February 29, 2020 21:36
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 rokibhasansagar/2de6065bf57c9d1027cbafbb8ce7bbf0 to your computer and use it in GitHub Desktop.
Save rokibhasansagar/2de6065bf57c9d1027cbafbb8ce7bbf0 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Copyright (C) 2020 OmniROM Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ref="android-6.0.1_r81"
echo -en "The AOSP ref to merge - "
echo -e $ref
branch_name=${ref}"-merge"
cd ../../../
while read path;
do
project=`echo android_${path} | sed -e 's/\//\_/g'`
echo ""
echo "====================================================================="
echo " PROJECT: ${project} -> [ ${path}/ ]"
echo ""
rm -fr $path;
echo " -> repo sync ${path}";
ret=$(repo sync -d -f --force-sync ${path} 2>&1);
cd $path;
# make sure that environment is clean
ret=$(git merge --abort 2>&1);
if git branch | grep ${branch_name} > /dev/null; then
git branch -D ${branch_name} > /dev/null
fi
if ! git remote | grep "aosp" > /dev/null; then
git remote add aosp https://android.googlesource.com/platform/$path > /dev/null
fi
echo " -> Merging remote: https://android.googlesource.com/platform/$path ${ref}";
ret=$(git pull https://android.googlesource.com/platform/$path ${ref} 2>&1);
if echo $ret | grep "CONFLICT (content)" > /dev/null ; then
echo " -> WARNING!: MERGE CONFLICT";
else
echo " -> DONE!";
fi
cd - > /dev/null
done < vendor/omni/utils/aosp-forked-list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment