forked from GrapheneOS/script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.sh
executable file
·197 lines (168 loc) · 4.94 KB
/
manage.sh
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#!/bin/bash
set -o errexit -o nounset -o pipefail
source "$(dirname ${BASH_SOURCE[0]})/common.sh"
DELETE_TAG=
build_number=
if [[ $# -eq 1 ]]; then
build_number=$1
elif [[ $# -ne 0 ]]; then
user_error "expected 0 or 1 arguments"
fi
branch=10
aosp_version=QQ2A.200501.001.B3
aosp_tag=android-10.0.0_r36
aosp_forks=(
device_common
device_google_bonito
device_google_bonito-sepolicy
device_google_crosshatch
device_google_crosshatch-sepolicy
device_google_muskie
device_google_taimen
device_google_wahoo
device_linaro_hikey
kernel_configs
platform_art
platform_bionic
platform_bootable_recovery
platform_build
platform_build_soong
platform_development
#platform_external_clang
platform_external_conscrypt
#platform_external_sqlite
platform_frameworks_av
platform_frameworks_base
#platform_frameworks_ex
platform_frameworks_native
platform_frameworks_opt_net_wifi
platform_libcore
platform_manifest
platform_packages_apps_Bluetooth
platform_packages_apps_Camera2
platform_packages_apps_Contacts
platform_packages_apps_DeskClock
#platform_packages_apps_Gallery2
platform_packages_apps_Launcher3
platform_packages_apps_Messaging
platform_packages_apps_Nfc
platform_packages_apps_PackageInstaller
platform_packages_apps_QuickSearchBox
platform_packages_apps_Settings
platform_packages_inputmethods_LatinIME
platform_packages_providers_DownloadProvider
platform_packages_services_Telephony
platform_prebuilts_abi-dumps_vndk
platform_system_bt
platform_system_core
platform_system_extras
platform_system_netd
platform_system_sepolicy
)
declare -A kernels=(
[google_wahoo]=android-10.0.0_r0.60 # May 2019
# broken tag, using branch temporarily
#[google_crosshatch]=android-10.0.0_r0.62 # May 2019
#[linaro_hikey]=dc721a4ac71d
)
independent=(
android-prepare-vendor
branding
hardened_malloc
# temporarily handle out-of-tree kernel modules as independent repositories
kernel_google_crosshatch_drivers_staging_qcacld-3.0
kernel_google_crosshatch_techpack_audio
platform_external_Auditor
platform_external_PdfViewer
platform_external_vanadium
#platform_external_Etar-Calendar
platform_external_seedvault
#platform_external_talkback
platform_packages_apps_ExactCalculator
platform_packages_apps_SetupWizard
platform_packages_apps_Updater
#platform_prebuilts_clang_host_linux-x86 # working around GitHub 100M file limit
script
Vanadium
vendor_linaro
)
for repo in "${aosp_forks[@]}"; do
echo -e "\n>>> $(tput setaf 3)Handling $repo$(tput sgr0)"
cd $repo
git checkout $branch
if [[ -n $DELETE_TAG ]]; then
git tag -d $DELETE_TAG
git push origin :refs/tags/$DELETE_TAG
cd ..
continue
fi
if [[ -n $build_number ]]; then
if [[ $repo == platform_manifest ]]; then
git checkout -B tmp
sed -i s%refs/heads/$branch%refs/tags/$aosp_version.$build_number% default.xml
git commit default.xml -m $aosp_version.$build_number
fi
if [[ $repo != platform_manifest ]]; then
git tag -s $aosp_version.$build_number -m $aosp_version.$build_number
git push origin $aosp_version.$build_number
else
git push -fu origin tmp
fi
if [[ $repo == platform_manifest ]]; then
git checkout $branch
git branch -D tmp
fi
else
git fetch upstream --tags
git pull --rebase upstream $aosp_tag
git push -f
fi
cd ..
done
for kernel in ${!kernels[@]}; do
echo -e "\n>>> $(tput setaf 3)Handling kernel_$kernel$(tput sgr0)"
cd kernel_$kernel
git checkout $branch
if [[ -n $DELETE_TAG ]]; then
git tag -d $DELETE_TAG
git push origin :refs/tags/$DELETE_TAG
cd ..
continue
fi
if [[ -n $build_number ]]; then
git tag -s $aosp_version.$build_number -m $aosp_version.$build_number
git push origin $aosp_version.$build_number
else
git fetch upstream --tags
kernel_tag=${kernels[$kernel]}
if [[ -z $kernel_tag ]]; then
cd ..
continue
fi
git checkout $branch-stable-base
git rebase $kernel_tag
git push -f
git checkout $branch
git rebase $branch-stable-base
git push -f
fi
cd ..
done
for repo in ${independent[@]}; do
echo -e "\n>>> $(tput setaf 3)Handling $repo$(tput sgr0)"
cd $repo
git checkout $branch
if [[ -n $DELETE_TAG ]]; then
git tag -d $DELETE_TAG
git push origin :refs/tags/$DELETE_TAG
cd ..
continue
fi
if [[ -n $build_number ]]; then
git tag -s $aosp_version.$build_number -m $aosp_version.$build_number
git push origin $aosp_version.$build_number
else
git push -f
fi
cd ..
done