This repository was archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathUpdateProject
105 lines (96 loc) · 3.03 KB
/
UpdateProject
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
#
# Copyright (C) 2015 The AmmoniaOS Project
# Copyright (C) 2018 The SudaMod 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.
#
PROJECTPATH=(
$ANDROID_BUILD_TOP/android
$ANDROID_BUILD_TOP/build/make
$ANDROID_BUILD_TOP/frameworks/base
$ANDROID_BUILD_TOP/packages/apps/Calendar
$ANDROID_BUILD_TOP/packages/apps/Contacts
$ANDROID_BUILD_TOP/packages/apps/Dialer
$ANDROID_BUILD_TOP/packages/apps/Eleven
$ANDROID_BUILD_TOP/packages/apps/Messaging
$ANDROID_BUILD_TOP/packages/apps/Settings
$ANDROID_BUILD_TOP/packages/providers/ContactsProvider
$ANDROID_BUILD_TOP/packages/services/Telecomm
$ANDROID_BUILD_TOP/vendor/lineage
$ANDROID_BUILD_TOP/packages/apps/LineageParts
$ANDROID_BUILD_TOP/packages/apps/Trebuchet
$ANDROID_BUILD_TOP/system/core
)
PROJECTLIST=(
android.git
android_build.git
android_frameworks_base.git
android_packages_apps_Calendar.git
android_packages_apps_Contacts.git
android_packages_apps_Dialer.git
android_packages_apps_Eleven.git
android_packages_apps_Messaging.git
android_packages_apps_Settings.git
android_packages_providers_ContactsProvider.git
android_packages_services_Telecomm.git
android_vendor_lineage.git
android_packages_apps_LineageParts.git
android_packages_apps_Trebuchet.git
android_system_core.git
)
project=0
auto=0
echo -e "\\033[2J"
if [ ! -z "$1" ]; then
echo "Start repo sync -j$1, Please wait for a while..."
repo sync -j$1
read -p "Start to merge ?[y/n]" No
if [ "$No" = n ]; then
exit 1
fi
fi
function doName() {
PUSHNAME="SudaMod/${PROJECTLIST[project]}"
PULLNAME="Lineageos/${PROJECTLIST[project]}"
}
function doMerge() {
if [ "$Yes" = y ] || [ "$Yes" = "" ]; then
cd $i
doName
git pull https://github.com/$PULLNAME lineage-17.1 && echo "" || exit 1
git commit -am "Merge branch 'lineage-17.1' into sm-6.1"
git push https://github.com/$PUSHNAME HEAD:sm-6.1 && echo "" || exit 1
cd $ANDROID_BUILD_TOP
elif [ "$Yes" = e ]; then
exit 1
fi
}
read -p "The main code is clean, automatic merging ?[y/n]" Auto
if [ "$Auto" = y ] || [ "$Auto" = "" ]; then
auto=`expr $auto + 1`;
fi
for i in ${PROJECTPATH[@]}; do
if [ ! -d $i ]; then
echo "$i,Did not find the directory!"
exit 1
else
if [ "$auto" != 0 ]; then
yes | read -p "$i,Pull ${PROJECTLIST[project]} ?[y/n/e]" Yes
else
read -p "$i,Pull ${PROJECTLIST[project]} ?[y/n/e]" Yes
fi
doMerge
project=`expr $project + 1`;
fi
done