-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclean-aqua.sh
executable file
·286 lines (232 loc) · 13.2 KB
/
clean-aqua.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
#!/bin/bash
# Copyright (C) 2019 AquariOS
#
# 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.
# Specify the location of your local AquariOS source directory
SOURCE_DIR=$HOME/aquarios
# Specify which branch you'll be using
BRANCH=a9
# Specify remotes
REMOTE=aqua
REMOTE2=aqua2
git rebase --abort 2>&1 >/dev/null 2>/dev/null
git cherry-pick --abort 2>&1 >/dev/null 2>/dev/null
function cleanslate() {
echo "Clearing stage..."
sleep 1
git rebase --abort >> /dev/null 2>&1
git cherry-pick --abort >> /dev/null 2>&1
}
function track() {
echo "Switching to tracked branch..."
sleep 1
git fetch $REMOTE $BRANCH;git checkout -b $BRANCH --track $REMOTE/$BRANCH
}
# Colors
BOLD='\033[1;37m'
CLEAR='\033[0m'
### LIST OF TRACKED REPOS ###
echo -e $BOLD "Checking bootable/recovery"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd bootable/recovery;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking build/make"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd build/make;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking build/soong"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd build/soong;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/google/blueline"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/google/blueline;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/google/crosshatch"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/google/crosshatch;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/google/taimen"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/google/taimen;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/google/walleye"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/google/walleye;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/google/wahoo"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/google/wahoo;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/huawei/angler"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/huawei/angler;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking device/lge/bullhead"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd device/lge/bullhead;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking external/google"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd external/google;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking external/selinux"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd external/selinux;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking frameworks/av"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd frameworks/av; cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking frameworks/base"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd frameworks/base;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking frameworks/native"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd frameworks/native;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking frameworks/support"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd frameworks/support;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking kernel/google/bluecross"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd kernel/google/bluecross;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking kernel/google/wahoo"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd kernel/google/wahoo;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking kernel/huawei/angler"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd kernel/huawei/angler;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking manifest"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd manifest;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/Bluetooth"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/Bluetooth; cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/CoralReef"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/CoralReef; cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/DocumentsUI"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/DocumentsUI;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/EmergencyInfo"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/EmergencyInfo;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/Dialer"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/Dialer;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/Launcher3"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/Launcher3;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/OmniStyle"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/OmniStyle;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/Nfc"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/Nfc;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/SettingsIntelligence"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/SettingsIntelligence;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/SmartNav"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/SmartNav;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/Settings"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/Settings;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/SmartNavSettings"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/SmartNavSettings;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/apps/WeatherClient"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/apps/WeatherClient;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/services/Telecomm"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/services/Telecomm;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking packages/providers/DownloadProviders"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd packages/providers/DownloadProviders;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking prebuilts/clang/host/linux-x86"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd prebuilts/clang/host/linux-x86;cleanslate;git checkout -b temp_branch;git branch -D p9x;git fetch gitlab p9x;git checkout -b p9x --track gitlab/p9x;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking system/core"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd system/core;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking system/extras"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd system/extras;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking system/sepolicy"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd system/sepolicy;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking system/vold"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd system/vold;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking vendor/aquarios"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd vendor/aquarios;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking vendor/assets"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd vendor/assets;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking vendor/google"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd vendor/google;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch $REMOTE2 $BRANCH;git checkout -b $BRANCH --track $REMOTE2/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking vendor/pixelgapps"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd vendor/pixelgapps;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;git fetch gitlab $BRANCH;git checkout -b $BRANCH --track gitlab/$BRANCH;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo -e $BOLD "Checking vendor/support"
echo -e $CLEAR
cd $SOURCE_DIR/ && cd vendor/support;cleanslate;git checkout -b temp_branch;git branch -D $BRANCH;track;git branch -D temp_branch && git reset --hard;git status;
echo -e " "
echo ""
echo ""
echo "=== ≪ 🐬 ⚯ 🐙 ⚯ 🐟 ⚯ 🐬 ⚯ 🐟 ⚯ 🐙 ⚯ 🐬 ≫ ==="
echo ""
echo " All repos tracked by AquariOS are now"
echo " up-to-date and in-line with git source!"
echo " Confirm this by using git status"
echo ""
echo " ⚯ ⚯ ⚯"
echo " Script made by Calphonic"
echo ""
echo "=== ≪ 🐬 ⚯ 🐙 ⚯ 🐟 ⚯ 🐬 ⚯ 🐟 ⚯ 🐙 ⚯ 🐬 ≫ ==="
echo ""
exit 0