blob: 418c3936fc454147c82e3ab00449ab8812b9f58f [file] [log] [blame]
Jake Whatley4e1248a2016-03-10 21:22:56 -05001#!/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 Borba5dc4c6e2018-02-03 00:34:23 -020017echo -e "Enter the AOSP ref to merge";
18read ref;
Humberto Borba7ea79de2016-12-07 20:19:29 -020019
Jake Whatley4e1248a2016-03-10 21:22:56 -050020cd ../../../
21
22while read path;
23 do
24
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020025 project=`echo android_${path} | sed -e 's/\//\_/g'`;
26 aosp_project=${path};
27 if [ "${path}" == "build" ] ; then
28 path="build/make";
Humberto Borba3429f952017-09-08 10:49:37 -030029 fi
Jake Whatley4e1248a2016-03-10 21:22:56 -050030
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020031 echo "";
32 echo "=====================================================================";
33 echo " PROJECT: ${project} -> [ ${path}/ ]";
34 echo "";
Jake Whatley4e1248a2016-03-10 21:22:56 -050035
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020036 rm -fr $path;
37 echo " -> repo sync ${path}";
38 ret=$(repo sync -d -f --force-sync ${path} 2>&1);
Jake Whatley4e1248a2016-03-10 21:22:56 -050039 cd $path;
40
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020041 # make sure that environment is clean
42 ret=$(git merge --abort 2>&1);
Jake Whatley4e1248a2016-03-10 21:22:56 -050043
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020044 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 Whatley4e1248a2016-03-10 21:22:56 -050046
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020047 if echo $ret | grep "CONFLICT (content)" > /dev/null ; then
48 echo " -> WARNING!: MERGE CONFLICT";
49 else
50 echo " -> DONE!";
Jake Whatley4e1248a2016-03-10 21:22:56 -050051 fi
52
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020053 cd - > /dev/null;
Jake Whatley4e1248a2016-03-10 21:22:56 -050054
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020055done < vendor/omni/utils/aosp-forked-list;