24
24
MIRROR="$HOME/mirror/ubuntu"
25
MIRROR_RTM="$HOME/mirror/ubuntu-rtm"
26
MIRROR_PHONE_OVERLAY="$HOME/mirror/phone-overlay"
27
25
GERMINATE="$HOME/mirror/ubuntu-germinate"
28
26
OUT="$HOME/public_html"
31
DEVEL_RTM_FACTORY=14.09-factory
32
PROPOSED_MIGRATION_SERIES="precise trusty xenial bionic cosmic disco eoan"
33
PROPOSED_MIGRATION_SERIES_RTM="14.09 14.09-factory"
28
PROPOSED_MIGRATION_SERIES="trusty xenial bionic focal jammy lunar mantic noble"
35
30
mtimes="$(mktemp -d)"
37
32
collect_mtimes () {
39
34
"$MIRROR"/dists/*/Release \
40
"$MIRROR_RTM"/dists/*/Release \
41
"$MIRROR_PHONE_OVERLAY"/dists/*/Release \
42
35
"$GERMINATE/germinate.output" \
43
36
"$HOME/extra-germinate/germinate.output" \
44
37
>"$mtimes/$1" 2>/dev/null || true
52
45
[ "$(mtime old "$1")" != "$(mtime new "$1")" ]
56
[ -e "$MIRROR_RTM/dists/$1" ]
59
48
release_changed () {
61
mtime_changed "$MIRROR_RTM/dists/$1/Release"
63
mtime_changed "$MIRROR/dists/$1/Release"
49
mtime_changed "$MIRROR/dists/$1/Release"
67
52
germinate_changed () {
83
68
pm_pending_tests () {
86
excuses="$HOME/public_html/proposed-migration/ubuntu-rtm/$1/update_excuses.html"
88
excuses="$HOME/public_html/proposed-migration/$1/update_excuses.html"
90
grep -q "Test in progress" "$excuses"
70
excuses="$HOME/public_html/proposed-migration/$1/update_excuses.html"
71
[ ! -f "$excuses" ] || grep -q "Test in progress" "$excuses"
113
94
--exclude gutsy\* --exclude hardy\* --exclude intrepid\* \
114
95
--exclude jaunty\* --exclude karmic\* --exclude lucid\* \
115
96
--exclude maverick\* --exclude natty\* --exclude oneiric\* \
116
--exclude quantal\* --exclude raring\* --exclude saucy\* \
117
--exclude utopic\* --exclude wily\* \
97
--exclude precise\* --exclude quantal\* --exclude raring\* \
98
--exclude saucy\* --exclude utopic\* --exclude wily\* \
118
99
--exclude yakkety\* --exclude zesty\* --exclude artful\* \
100
--exclude cosmic\* --exclude disco\* --exclude eoan\* \
101
--exclude groovy\* --exclude hirsute\* --exclude impish\* \
102
--exclude kinetic\* \
119
103
--include Packages\* --include Sources\* --include Release\* \
120
104
--include udeb.list --include \*\*/installer-\*/current \
121
--include "**/$DEVEL/Contents-*" \
105
--include Contents-\* \
122
106
--include \*/ --exclude \* --delete --delete-excluded \
123
107
--prune-empty-dirs \
124
108
ftpmaster.internal::ubuntu-dists/ "$MIRROR/dists/"
126
mkdir -p "$MIRROR_RTM"
128
--include Packages\* --include Sources\* --include Release\* \
129
--include udeb.list --include \*\*/installer-\*/current \
130
--include "**/$DEVEL_RTM/Contents-*" \
131
--include "**/$DEVEL_RTM_FACTORY/Contents-*" \
132
--include \*/ --exclude \* --delete --delete-excluded \
134
bilimbi.canonical.com::ubuntu-rtm-dists/ "$MIRROR_RTM/dists/"
136
mkdir -p "$MIRROR_PHONE_OVERLAY"
137
http_proxy=http://squid.internal:3128/ wget -q --mirror \
138
-nH --cut-dirs=3 -np -R '*index.html*' \
139
-P "$MIRROR_PHONE_OVERLAY" \
140
-X '/*/*/*/*/*/*/i18n' \
141
http://ppa.launchpad.net/ci-train-ppa-service/stable-phone-overlay/ubuntu/dists/
143
110
collect_mtimes new
145
112
# The $DEVEL-proposed chdist configuration is used by proposed-migration;
162
129
background_wait chdist_pids
164
if mtime_changed "$MIRROR/.*/Release" || \
165
mtime_changed "$MIRROR_RTM/.*/Release" || \
166
mtime_changed "$MIRROR_PHONE_OVERLAY/.*/Release"; then
167
background pids run-apt-mirror-snapshot
171
132
run_proposed_migration () {
172
133
DISTRIBUTION=ubuntu SERIES="$1" run-proposed-migration
136
check_git_uptodate() {
139
branch=$(git symbolic-ref --short -q HEAD)
140
[ -z "$(git diff origin/$branch..$branch)" ]
174
143
for series in $PROPOSED_MIGRATION_SERIES; do
175
144
if release_changed "$series" || release_changed "$series-proposed" || \
176
145
release_changed "$series-updates" || \
177
pm_pending_tests "$series"; then
146
pm_pending_tests "$series" || \
147
! check_git_uptodate "$HOME/proposed-migration/data/${series}-proposed/Hints"
178
149
background pids run_proposed_migration "$series"
182
run_proposed_migration_rtm () {
183
DISTRIBUTION=ubuntu-rtm SERIES="$1" \
184
B2_CONFIG=/home/ubuntu-archive/proposed-migration/britney-rtm.conf \
185
B2_CONFIG_NOBREAKALL=/home/ubuntu-archive/proposed-migration/britney_nobreakall-rtm.conf \
186
run-proposed-migration
188
for series in $PROPOSED_MIGRATION_SERIES_RTM; do
189
if release_changed "$series" || release_changed "$series-proposed" || \
190
release_changed "$series-updates" || \
191
pm_pending_tests "$series"; then
192
background pids run_proposed_migration_rtm "$series"
196
# Both update-transitions and run-britney need this.
197
rsync -aq --delete --prune-empty-dirs \
199
"/srv/chroots/trusty-transitions/srv/transitions/mirror/ubuntu/dists/"
201
153
if release_changed "$DEVEL-proposed"; then
202
154
background pids update-transitions
205
if release_changed "$DEVEL"; then
206
background pids run-britney
209
157
# Now update all the other chdist configurations, and wait for that to
210
158
# finish before doing anything else.
229
177
background pids cron.NBS
233
DISTRIBUTION=ubuntu-rtm RELEASE="$1" \
234
OUTDIR="$HOME/public_html/NBS-RTM" \
235
OUTFILE="$HOME/public_html/nbs-rtm.html" \
238
if release_changed "$DEVEL_RTM"; then
239
background pids nbs_rtm "$DEVEL_RTM"
242
180
if release_changed "$DEVEL" || release_changed "$DEVEL-proposed"; then
243
181
# Do an extra germinate run so that we can run component-mismatches
244
182
# against -proposed. (We can't do this as part of LP archive
245
183
# publishing because that would probably cause us to break our
246
184
# 30-minute window.)
247
185
background pids \
248
env PYTHONPATH="$HOME/ubuntu-archive-tools:$HOME/germinate" \
186
env PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}$HOME/ubuntu-archive-tools:$HOME/germinate" \
249
187
extra-germinate -o "$HOME/extra-germinate" ubuntu
260
198
collect_mtimes new
262
200
if germinate_changed; then
263
# Give germinate a two minute window to stop spewing to output
264
# and assume it's finished, this should be more than enough time,
265
# given that it outputs nearly constantly when run, and completes
266
# in under three minutes, on average
267
NEW_GERMINATE_MTIME="$(mtime new "$GERMINATE/germinate.output")"
268
if [ $(($(date +%s) - $NEW_GERMINATE_MTIME)) -gt 120 ]; then
201
# Check for the marker line emitted by lp:ubuntu-archive-publishing
202
# at the end of the run. If we don't find this, then we've rsynced
203
# partial output and should try again later.
204
if fgrep -q 'Germination complete.' "$GERMINATE/germinate.output"; then
269
205
component_mismatches () {
273
209
-d "$OUT/$name.dot" -o "$OUT/$name.txt.new" \
274
210
--html-output-file "$OUT/$name.html" \
275
211
--csv-file "$OUT/$name.csv" \
212
--exclude "community-maas" \
277
214
if [ "$name" = component-mismatches ]; then
278
215
process-component-mismatches-diff \
279
216
"$OUT/$name.txt" "$OUT/$name.txt.new"
281
218
mv "$OUT/$name.txt.new" "$OUT/$name.txt"
282
dot -Tsvg -Gdpi=55 -o "$OUT/$name.svg" "$OUT/$name.dot"
219
dot -Tsvg -o "$OUT/$name.svg" "$OUT/$name.dot"
284
221
background pids component_mismatches component-mismatches
285
222
background pids component_mismatches component-mismatches-proposed \