| 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 | # | 
|  | 17 | echo -e "Enter the AOSP ref to merge" | 
|  | 18 | read ref | 
|  | 19 |  | 
| Humberto Borba | 7ea79de | 2016-12-07 20:19:29 -0200 | [diff] [blame] | 20 | branch_name=${ref}"-merge" | 
|  | 21 | # echo $branch_name | 
|  | 22 |  | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 23 | cd ../../../ | 
|  | 24 |  | 
|  | 25 | while read path; | 
|  | 26 | do | 
|  | 27 |  | 
|  | 28 | project=`echo android_${path} | sed -e 's/\//\_/g'` | 
| Humberto Borba | 3429f95 | 2017-09-08 10:49:37 -0300 | [diff] [blame] | 29 | if [ "${project}" == "android_build_make" ] ; then | 
|  | 30 | project="android_build" | 
| Marko Man | 07f76bc | 2017-10-10 11:04:07 +0200 | [diff] [blame] | 31 | buildpath="build" | 
| Humberto Borba | 3429f95 | 2017-09-08 10:49:37 -0300 | [diff] [blame] | 32 | fi | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 33 |  | 
|  | 34 | echo "" | 
|  | 35 | echo "=====================================================================" | 
|  | 36 | echo " PROJECT: ${project} -> [ ${path}/ ]" | 
|  | 37 | echo "" | 
|  | 38 |  | 
|  | 39 | cd $path; | 
|  | 40 |  | 
|  | 41 | git merge --abort; | 
|  | 42 |  | 
|  | 43 | repo sync -d . | 
|  | 44 |  | 
| Humberto Borba | 7ea79de | 2016-12-07 20:19:29 -0200 | [diff] [blame] | 45 | if git branch | grep ${branch_name} > /dev/null; then | 
|  | 46 | git branch -D ${branch_name} > /dev/null | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 47 | fi | 
|  | 48 |  | 
| Humberto Borba | 7ea79de | 2016-12-07 20:19:29 -0200 | [diff] [blame] | 49 | repo start ${branch_name} . | 
| Marko Man | 07f76bc | 2017-10-10 11:04:07 +0200 | [diff] [blame] | 50 | if [ buildpath="build" ] ; then | 
|  | 51 | if ! git remote | grep "aosp" > /dev/null; then | 
|  | 52 | git remote add aosp https://android.googlesource.com/platform/$buildpath > /dev/null | 
|  | 53 | fi | 
|  | 54 | else | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 55 |  | 
| Marko Man | 07f76bc | 2017-10-10 11:04:07 +0200 | [diff] [blame] | 56 | if ! git remote | grep "aosp" > /dev/null; then | 
|  | 57 | git remote add aosp https://android.googlesource.com/platform/$path > /dev/null | 
|  | 58 | fi | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 59 | fi | 
|  | 60 |  | 
| darkobas | 3def7e0 | 2016-07-07 15:18:40 +0200 | [diff] [blame] | 61 | git fetch --tags aosp | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 62 |  | 
|  | 63 | #echo "=====================================================================" | 
|  | 64 | #echo " Merging {$ref}" | 
|  | 65 | #echo "=====================================================================" | 
| Marko Man | 07f76bc | 2017-10-10 11:04:07 +0200 | [diff] [blame] | 66 | if [ buildpath="build" ] ; then | 
|  | 67 | git merge --squash $ref && git commit -m "Merge $ref"; | 
|  | 68 | else | 
|  | 69 | git merge $ref; | 
|  | 70 | fi | 
| Jake Whatley | 4e1248a | 2016-03-10 21:22:56 -0500 | [diff] [blame] | 71 |  | 
|  | 72 | cd - > /dev/null | 
|  | 73 |  | 
| Humberto Borba | 87dbab2 | 2016-07-28 19:05:13 -0300 | [diff] [blame] | 74 | done < vendor/omni/utils/aosp-forked-list |