Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2016 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 | # |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 17 | echo -e "Enter the AOSP ref to merge"; |
| 18 | read ref; |
Humberto Borba | 7ea79de | 2016-12-07 20:19:29 -0200 | [diff] [blame] | 19 | |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 20 | cd ../../../ |
| 21 | |
| 22 | while read path; |
| 23 | do |
| 24 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 25 | project=`echo android_${path} | sed -e 's/\//\_/g'`; |
| 26 | aosp_project=${path}; |
| 27 | if [ "${path}" == "build" ] ; then |
| 28 | path="build/make"; |
Humberto Borba | 3429f95 | 2017-09-08 10:49:37 -0300 | [diff] [blame] | 29 | fi |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 30 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 31 | echo ""; |
| 32 | echo "====================================================================="; |
| 33 | echo " PROJECT: ${project} -> [ ${path}/ ]"; |
| 34 | echo ""; |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 35 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 36 | rm -fr $path; |
| 37 | echo " -> repo sync ${path}"; |
| 38 | ret=$(repo sync -d -f --force-sync ${path} 2>&1); |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 39 | cd $path; |
| 40 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 41 | # make sure that environment is clean |
| 42 | ret=$(git merge --abort 2>&1); |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 43 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 44 | echo " -> Merging remote: https://android.googlesource.com/platform/$aosp_project ${ref}"; |
| 45 | ret=$(git pull https://android.googlesource.com/platform/$aosp_project ${ref} 2>&1); |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 46 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 47 | if echo $ret | grep "CONFLICT (content)" > /dev/null ; then |
| 48 | echo " -> WARNING!: MERGE CONFLICT"; |
| 49 | else |
| 50 | echo " -> DONE!"; |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 51 | fi |
| 52 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 53 | cd - > /dev/null; |
Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 54 | |
Humberto Borba | 5dc4c6e | 2018-02-03 00:34:23 -0200 | [diff] [blame^] | 55 | done < vendor/omni/utils/aosp-forked-list; |