Vachounet | 7ff3bc0 | 2021-02-10 14:32:36 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2021 OmniROM Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | echo -e "Enter the CAF ref to merge"; |
| 18 | read ref; |
| 19 | |
| 20 | cd ../../../ |
| 21 | |
| 22 | while read path; |
| 23 | do |
| 24 | |
| 25 | project=`echo android_${path} | sed -e 's/\//\_/g'`; |
| 26 | caf_project=${path}; |
| 27 | if [ "${path}" == "build" ] ; then |
| 28 | path="build/make"; |
| 29 | fi |
| 30 | |
| 31 | echo ""; |
| 32 | echo "====================================================================="; |
| 33 | echo " PROJECT: ${project} -> [ ${path}/ ]"; |
| 34 | echo ""; |
| 35 | |
| 36 | rm -fr $path; |
| 37 | echo " -> repo sync ${path}"; |
| 38 | ret=$(repo sync -d -f --force-sync ${path} 2>&1); |
| 39 | cd $path; |
| 40 | |
| 41 | # make sure that environment is clean |
| 42 | ret=$(git merge --abort 2>&1); |
| 43 | |
| 44 | echo " -> Merging remote: https://source.codeaurora.org/quic/la/platform/$caf_project ${ref}"; |
| 45 | ret=$(git pull https://source.codeaurora.org/quic/la/platform/$caf_project ${ref} 2>&1); |
| 46 | |
| 47 | if echo $ret | grep "CONFLICT (content)" > /dev/null ; then |
| 48 | echo -e " -> \e[33mWARNING!: \e[31mMERGE CONFLICT\e[0m"; |
| 49 | else |
| 50 | echo -e " -> \e[32mDONE!\e[0m"; |
| 51 | fi |
| 52 | |
| 53 | cd - > /dev/null; |
| 54 | |
| 55 | done < vendor/omni/utils/caf-repos-list; |