26
by Ubuntu Archive
add more archive report jobs |
1 |
#! /bin/sh
|
2 |
set -e
|
|
3 |
||
90
by Colin Watson
archive-reports: avoid having a duplicate cleanup function |
4 |
LOCK= |
5 |
mtimes= |
|
6 |
cleanup () { |
|
7 |
[ "$mtimes" ] && rm -rf "$mtimes" |
|
8 |
[ "$LOCK" ] && rm -f "$LOCK" |
|
9 |
}
|
|
10 |
trap cleanup EXIT HUP INT QUIT TERM
|
|
11 |
||
119
by Colin Watson
archive-reports: be quiet about lockfile errors when stdout is not a terminal |
12 |
if [ -t 1 ]; then |
13 |
REDIR= |
|
14 |
else
|
|
15 |
REDIR='>/dev/null 2>&1' |
|
16 |
fi
|
|
17 |
||
91
by Colin Watson
archive-reports: ordering fix |
18 |
LOCK="$HOME/.archive-reports.lock" |
119
by Colin Watson
archive-reports: be quiet about lockfile errors when stdout is not a terminal |
19 |
if ! eval lockfile -r1 "$LOCK" $REDIR; then |
103
by Colin Watson
archive-reports: don't remove lock file on lock acquisition failure |
20 |
trap - EXIT HUP INT QUIT TERM
|
88
by Colin Watson
archive-reports: add locking |
21 |
exit 1 |
22 |
fi
|
|
23 |
||
26
by Ubuntu Archive
add more archive report jobs |
24 |
MIRROR="$HOME/mirror/ubuntu" |
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
25 |
GERMINATE="$HOME/mirror/ubuntu-germinate" |
26 |
OUT="$HOME/public_html" |
|
376
by Steve Langasek
noble->oracular |
27 |
DEVEL=oracular |
28 |
PROPOSED_MIGRATION_SERIES="trusty xenial bionic focal jammy mantic noble oracular" |
|
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
29 |
|
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
30 |
mtimes="$(mktemp -d)" |
31 |
||
32 |
collect_mtimes () { |
|
33 |
stat -c '%n %Y' \ |
|
34 |
"$MIRROR"/dists/*/Release \ |
|
35 |
"$GERMINATE/germinate.output" \ |
|
97
by Colin Watson
archive-reports, extra-germinate: write out extra germinate files by series rather than suite, to match expectations of component-mismatches |
36 |
"$HOME/extra-germinate/germinate.output" \ |
141
by Colin Watson
archive-reports: Sync dry-run ubuntu-rtm archive from dogfood, and run chdist updates for it. |
37 |
>"$mtimes/$1" 2>/dev/null || true |
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
38 |
}
|
39 |
||
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
40 |
mtime () { |
67
by Colin Watson
archive-reports: mtime should not use grep -q |
41 |
(grep "^$2 " "$mtimes/$1" || echo "$2 0") | cut -d' ' -f2 |
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
42 |
}
|
43 |
||
44 |
mtime_changed () { |
|
66
by Colin Watson
archive-reports: fix mtime_changed syntax |
45 |
[ "$(mtime old "$1")" != "$(mtime new "$1")" ] |
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
46 |
}
|
47 |
||
48 |
release_changed () { |
|
265
by Colin Watson
Stop running reports on ubuntu-rtm or the stable phone overlay. |
49 |
mtime_changed "$MIRROR/dists/$1/Release" |
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
50 |
}
|
51 |
||
52 |
germinate_changed () { |
|
97
by Colin Watson
archive-reports, extra-germinate: write out extra germinate files by series rather than suite, to match expectations of component-mismatches |
53 |
mtime_changed "$GERMINATE/germinate.output" || \ |
54 |
mtime_changed "$HOME/extra-germinate/germinate.output" |
|
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
55 |
}
|
56 |
||
141
by Colin Watson
archive-reports: Sync dry-run ubuntu-rtm archive from dogfood, and run chdist updates for it. |
57 |
is_devel () { |
58 |
case $suite in |
|
265
by Colin Watson
Stop running reports on ubuntu-rtm or the stable phone overlay. |
59 |
$DEVEL-proposed) |
141
by Colin Watson
archive-reports: Sync dry-run ubuntu-rtm archive from dogfood, and run chdist updates for it. |
60 |
return 0 |
61 |
;;
|
|
62 |
*)
|
|
63 |
return 1 |
|
64 |
;;
|
|
65 |
esac
|
|
66 |
}
|
|
67 |
||
165
by Colin Watson
archive-reports: run proposed-migration if any tests are in progress, even if the suites in question haven't changed |
68 |
pm_pending_tests () { |
69 |
local excuses
|
|
265
by Colin Watson
Stop running reports on ubuntu-rtm or the stable phone overlay. |
70 |
excuses="$HOME/public_html/proposed-migration/$1/update_excuses.html" |
257
by Adam Conrad
archive-reports: Avoid chicken-and-egg problem of attempting to grep excuses before we have excuses to grep. |
71 |
[ ! -f "$excuses" ] || grep -q "Test in progress" "$excuses" |
165
by Colin Watson
archive-reports: run proposed-migration if any tests are in progress, even if the suites in question haven't changed |
72 |
}
|
73 |
||
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
74 |
background () { |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
75 |
local var="$1" |
76 |
shift
|
|
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
77 |
"$@" & |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
78 |
eval "$var=\"\${$var:+\$$var }\$!\"" |
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
79 |
}
|
80 |
||
33
by Ubuntu Archive
archive-reports: ensure that chdist update is complete before starting run-britney |
81 |
background_wait () { |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
82 |
local var="$1" |
83 |
for pid in $(eval "echo \$$var"); do |
|
33
by Ubuntu Archive
archive-reports: ensure that chdist update is complete before starting run-britney |
84 |
wait "$pid" |
85 |
done
|
|
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
86 |
eval "$var=" |
33
by Ubuntu Archive
archive-reports: ensure that chdist update is complete before starting run-britney |
87 |
}
|
88 |
||
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
89 |
collect_mtimes old |
26
by Ubuntu Archive
add more archive report jobs |
90 |
|
151
by Colin Watson
archive-reports: Ensure that $MIRROR and $MIRROR_RTM exist before trying to rsync into their subdirectories. |
91 |
mkdir -p "$MIRROR" |
112
by Colin Watson
archive-reports: quieten rsync |
92 |
rsync -aq \
|
26
by Ubuntu Archive
add more archive report jobs |
93 |
--exclude dapper\* --exclude edgy\* --exclude feisty\* \ |
102
by Colin Watson
hardy and oneiric are EOL |
94 |
--exclude gutsy\* --exclude hardy\* --exclude intrepid\* \ |
189
by Colin Watson
archive-reports: lucid and utopic are EOL |
95 |
--exclude jaunty\* --exclude karmic\* --exclude lucid\* \ |
96 |
--exclude maverick\* --exclude natty\* --exclude oneiric\* \ |
|
314
by Steve Langasek
Drop references to obsolete series (precise, disco) |
97 |
--exclude precise\* --exclude quantal\* --exclude raring\* \ |
98 |
--exclude saucy\* --exclude utopic\* --exclude wily\* \ |
|
234
by Adam Conrad
cosmic -> disco; drop artful |
99 |
--exclude yakkety\* --exclude zesty\* --exclude artful\* \ |
304
by Andy Whitcroft
archive-reports: disco and eoan are both long gone |
100 |
--exclude cosmic\* --exclude disco\* --exclude eoan\* \ |
329.1.1
by utkarsh at ubuntu
Add EOL'd releases to the list |
101 |
--exclude groovy\* --exclude hirsute\* --exclude impish\* \ |
373
by Łukasz 'sil2100' Zemczak
Add lunar to the exclude list. |
102 |
--exclude kinetic\* --exclude lunar\* \ |
26
by Ubuntu Archive
add more archive report jobs |
103 |
--include Packages\* --include Sources\* --include Release\* \ |
104 |
--include udeb.list --include \*\*/installer-\*/current \ |
|
362
by Steve Langasek
Mirror Contents files for all releases, not just devel |
105 |
--include Contents-\* \ |
190
by Colin Watson
archive-reports: use rsync --delete-excluded where appropriate |
106 |
--include \*/ --exclude \* --delete --delete-excluded \ |
107 |
--prune-empty-dirs \
|
|
26
by Ubuntu Archive
add more archive report jobs |
108 |
ftpmaster.internal::ubuntu-dists/ "$MIRROR/dists/" |
109 |
||
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
110 |
collect_mtimes new |
111 |
||
111
by Colin Watson
archive-reports: repeat "saucy" less often |
112 |
# The $DEVEL-proposed chdist configuration is used by proposed-migration;
|
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
113 |
# it's important to get that done as soon as possible, so we do it first.
|
114 |
chdist_pids= |
|
115 |
chdists=0 |
|
116 |
for dist in "$HOME/.chdist"/*; do |
|
117 |
[ -d "$dist" ] || continue |
|
118 |
suite="${dist##*/}" |
|
119 |
suite="${suite%-*}" |
|
141
by Colin Watson
archive-reports: Sync dry-run ubuntu-rtm archive from dogfood, and run chdist updates for it. |
120 |
if is_devel "$suite" && release_changed "$suite"; then |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
121 |
background chdist_pids chdist apt-get "${dist##*/}" update >/dev/null |
122 |
chdists=$(($chdists + 1)) |
|
123 |
fi
|
|
191
by Colin Watson
archive-reports: bump to seven chdists at once, to account for s390x |
124 |
if [ "$chdists" = 7 ]; then |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
125 |
background_wait chdist_pids |
126 |
chdists=0 |
|
127 |
fi
|
|
128 |
done
|
|
129 |
background_wait chdist_pids |
|
130 |
||
131 |
pids= |
|
164
by Colin Watson
archive-reports: slightly refactor how proposed-migration is run to make it easier to extend |
132 |
run_proposed_migration () { |
133 |
DISTRIBUTION=ubuntu SERIES="$1" run-proposed-migration |
|
134 |
}
|
|
302
by Steve Langasek
fix branch up-to-dateness check for git instead of bzr |
135 |
|
136 |
check_git_uptodate() { |
|
137 |
cd "$1" |
|
138 |
git fetch origin -q |
|
305
by Iain Lane
archive-reports: Use a method to get the current git branch which works on old 16.04 git |
139 |
branch=$(git symbolic-ref --short -q HEAD) |
302
by Steve Langasek
fix branch up-to-dateness check for git instead of bzr |
140 |
[ -z "$(git diff origin/$branch..$branch)" ] |
141 |
}
|
|
142 |
||
164
by Colin Watson
archive-reports: slightly refactor how proposed-migration is run to make it easier to extend |
143 |
for series in $PROPOSED_MIGRATION_SERIES; do |
165
by Colin Watson
archive-reports: run proposed-migration if any tests are in progress, even if the suites in question haven't changed |
144 |
if release_changed "$series" || release_changed "$series-proposed" || \ |
167
by Colin Watson
archive-reports: check for -updates changing when deciding whether to run proposed-migration |
145 |
release_changed "$series-updates" || \ |
290.1.2
by Steve Langasek
Changes to hints files should also trigger a rerun of p-m, even if the archive is unchanged |
146 |
pm_pending_tests "$series" || \ |
302
by Steve Langasek
fix branch up-to-dateness check for git instead of bzr |
147 |
! check_git_uptodate "$HOME/proposed-migration/data/${series}-proposed/Hints" |
290.1.2
by Steve Langasek
Changes to hints files should also trigger a rerun of p-m, even if the archive is unchanged |
148 |
then
|
164
by Colin Watson
archive-reports: slightly refactor how proposed-migration is run to make it easier to extend |
149 |
background pids run_proposed_migration "$series" |
150 |
fi
|
|
151 |
done
|
|
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
152 |
|
113
by Colin Watson
archive-reports: run update-transitions a little earlier; it doesn't need chdist |
153 |
if release_changed "$DEVEL-proposed"; then |
154 |
background pids update-transitions |
|
155 |
fi
|
|
156 |
||
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
157 |
# Now update all the other chdist configurations, and wait for that to
|
158 |
# finish before doing anything else.
|
|
159 |
chdist_pids= |
|
160 |
chdists=0 |
|
161 |
for dist in "$HOME/.chdist"/*; do |
|
162 |
[ -d "$dist" ] || continue |
|
163 |
suite="${dist##*/}" |
|
164 |
suite="${suite%-*}" |
|
141
by Colin Watson
archive-reports: Sync dry-run ubuntu-rtm archive from dogfood, and run chdist updates for it. |
165 |
if ! is_devel "$suite" && release_changed "$suite"; then |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
166 |
background chdist_pids chdist apt-get "${dist##*/}" update >/dev/null |
167 |
chdists=$(($chdists + 1)) |
|
168 |
fi
|
|
191
by Colin Watson
archive-reports: bump to seven chdists at once, to account for s390x |
169 |
if [ "$chdists" = 7 ]; then |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
170 |
background_wait chdist_pids |
171 |
chdists=0 |
|
172 |
fi
|
|
173 |
done
|
|
174 |
background_wait chdist_pids |
|
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
175 |
|
111
by Colin Watson
archive-reports: repeat "saucy" less often |
176 |
if release_changed "$DEVEL"; then |
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
177 |
background pids cron.NBS |
71
by Colin Watson
archive-reports: actually, no need to update transition tracker when raring changes, but do still sync across raring indices |
178 |
fi
|
60
by Ubuntu Archive
archive-reports: run proposed-migration whenever either the release or proposed pocket changes |
179 |
|
111
by Colin Watson
archive-reports: repeat "saucy" less often |
180 |
if release_changed "$DEVEL" || release_changed "$DEVEL-proposed"; then |
93
by Colin Watson
archive-reports, extra-germinate: do an extra germinate run for -proposed |
181 |
# Do an extra germinate run so that we can run component-mismatches
|
182 |
# against -proposed. (We can't do this as part of LP archive
|
|
183 |
# publishing because that would probably cause us to break our
|
|
184 |
# 30-minute window.)
|
|
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
185 |
background pids \
|
341
by Steve Langasek
Append to the python path when invoking extra-germinate, don't replace it. |
186 |
env PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}$HOME/ubuntu-archive-tools:$HOME/germinate" \ |
95
by Colin Watson
archive-reports: tell extra-germinate to process the "ubuntu" seed collection |
187 |
extra-germinate -o "$HOME/extra-germinate" ubuntu |
93
by Colin Watson
archive-reports, extra-germinate: do an extra germinate run for -proposed |
188 |
fi
|
189 |
||
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
190 |
background_wait pids |
62
by Ubuntu Archive
archive-reports: run proposed-migration more in parallel with some other reports |
191 |
|
112
by Colin Watson
archive-reports: quieten rsync |
192 |
rsync -aq \
|
35
by Ubuntu Archive
archive-reports: stop mirroring ALL and ALL.sources from ubuntu-germinate |
193 |
--include germinate.output \
|
128
by Colin Watson
archive-reports: exclude .new files in germinate output |
194 |
--exclude _\* --exclude \*.new --include "*_${DEVEL}_*" \ |
190
by Colin Watson
archive-reports: use rsync --delete-excluded where appropriate |
195 |
--exclude \* --delete --delete-excluded \ |
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
196 |
ftpmaster.internal::ubuntu-germinate/ "$GERMINATE/" |
197 |
||
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
198 |
collect_mtimes new |
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
199 |
|
65
by Colin Watson
archive-reports: refactor to allow us to update chdist directories much more efficiently and accurately |
200 |
if germinate_changed; then |
267
by Colin Watson
Improve strategy for telling when germinate has finished. |
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 |
|
31
by Ubuntu Archive
archive-reports: run process-component-mismatches-diff |
205 |
component_mismatches () { |
99
by Colin Watson
archive-reports: run component-mismatches over -proposed |
206 |
local name="$1" |
207 |
shift
|
|
209
by Colin Watson
Drop references to ubuntu-touch.bionic. |
208 |
component-mismatches \
|
99
by Colin Watson
archive-reports: run component-mismatches over -proposed |
209 |
-d "$OUT/$name.dot" -o "$OUT/$name.txt.new" \ |
137
by Colin Watson
archive-reports: Write HTML versions of *-mismatches. |
210 |
--html-output-file "$OUT/$name.html" \ |
138
by Colin Watson
archive-reports: Write CSV time series data from *-mismatches. |
211 |
--csv-file "$OUT/$name.csv" \ |
281.2.1
by Dimitri John Ledkov
archive-reports: exclude community-maas seed |
212 |
--exclude "community-maas" \ |
99
by Colin Watson
archive-reports: run component-mismatches over -proposed |
213 |
"$@" |
214 |
if [ "$name" = component-mismatches ]; then |
|
215 |
process-component-mismatches-diff \
|
|
216 |
"$OUT/$name.txt" "$OUT/$name.txt.new" |
|
217 |
fi
|
|
218 |
mv "$OUT/$name.txt.new" "$OUT/$name.txt" |
|
344
by Steve Langasek
Don't pass -Gdpi=55 to dot for svg generation. |
219 |
dot -Tsvg -o "$OUT/$name.svg" "$OUT/$name.dot" |
31
by Ubuntu Archive
archive-reports: run process-component-mismatches-diff |
220 |
}
|
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
221 |
background pids component_mismatches component-mismatches |
222 |
background pids component_mismatches component-mismatches-proposed \
|
|
111
by Colin Watson
archive-reports: repeat "saucy" less often |
223 |
-s "$DEVEL-proposed" \ |
99
by Colin Watson
archive-reports: run component-mismatches over -proposed |
224 |
--germinate-path "$HOME/extra-germinate" |
137
by Colin Watson
archive-reports: Write HTML versions of *-mismatches. |
225 |
background pids priority-mismatches \
|
226 |
-o "$OUT/priority-mismatches.txt" \ |
|
138
by Colin Watson
archive-reports: Write CSV time series data from *-mismatches. |
227 |
--html-output-file "$OUT/priority-mismatches.html" \ |
228 |
--csv-file "$OUT/priority-mismatches.csv" |
|
137
by Colin Watson
archive-reports: Write HTML versions of *-mismatches. |
229 |
background pids architecture-mismatches \
|
230 |
-o "$OUT/architecture-mismatches.txt" \ |
|
138
by Colin Watson
archive-reports: Write CSV time series data from *-mismatches. |
231 |
--html-output-file "$OUT/architecture-mismatches.html" \ |
232 |
--csv-file "$OUT/architecture-mismatches.csv" |
|
33
by Ubuntu Archive
archive-reports: ensure that chdist update is complete before starting run-britney |
233 |
|
110
by Colin Watson
archive-reports: reorder jobs to get proposed-migration started earlier |
234 |
background_wait pids |
56
by Ubuntu Archive
fix whitespace |
235 |
fi
|
29
by Ubuntu Archive
archive-reports: run *-mismatches when germinate output changes |
236 |
fi
|