~ubuntu-archive/ubuntu-archive-scripts/trunk

59 by Ubuntu Archive
add run-proposed-migration and hook into archive-reports
1
#! /bin/sh
2
set -e
3
4
# We need promote-to-release.
5
case :$PATH: in
6
    *:/home/ubuntu-archive/ubuntu-archive-tools:*)
7
	;;
8
    *)
9
	PATH="/home/ubuntu-archive/ubuntu-archive-tools:$PATH"
10
	;;
11
esac
12
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
13
DEFAULT_DISTRIBUTION=ubuntu
359 by Steve Langasek
mantic->noble
14
DEFAULT_SERIES=noble
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
15
16
export DISTRIBUTION="${DISTRIBUTION:-$DEFAULT_DISTRIBUTION}"
17
export SERIES="${SERIES:-$DEFAULT_SERIES}"
162 by Colin Watson
run-proposed-migration: revert previous commit; britney1 handles prefixing a bit differently now
18
if [ "$DISTRIBUTION" = ubuntu ]; then
142 by Colin Watson
run-proposed-migration: Export DISTRIBUTION, defaulting to "ubuntu"; include distribution name in log file path if it is not "ubuntu".
19
	full_series="$SERIES"
20
else
21
	full_series="$DISTRIBUTION/$SERIES"
22
fi
136 by Colin Watson
run-proposed-migration: Write logs to series-specific locations.
23
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
24
case $DISTRIBUTION/$SERIES in
265 by Colin Watson
Stop running reports on ubuntu-rtm or the stable phone overlay.
25
    ubuntu/$DEFAULT_SERIES)
320 by Steve Langasek
Omit the 'summary' action for britney
26
	actions='hints_git blocks excuse_bugs pkglists run save stats'
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
27
	;;
28
    ubuntu/*)
320 by Steve Langasek
Omit the 'summary' action for britney
29
	actions='hints_git blocks excuse_bugs pkglists run stats'
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
30
	;;
31
    *)
32
	echo "Don't know what actions to run for $DISTRIBUTION/$SERIES!" >&2
33
	exit 1
34
	;;
35
esac
36
59 by Ubuntu Archive
add run-proposed-migration and hook into archive-reports
37
cd "$HOME/proposed-migration"
100 by Colin Watson
run-proposed-migration: honour a STOP file
38
[ -e STOP ] && exit 0
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
39
if ! lockfile -r0 ".run-proposed-migration-$DISTRIBUTION-$SERIES.lock"; then
59 by Ubuntu Archive
add run-proposed-migration and hook into archive-reports
40
	exit 1
41
fi
242 by Steve Langasek
Merge the multiple traps rather than overwriting
42
43
cleanup () {
44
    rm -f $HOME/proposed-migration/.run-proposed-migration-$DISTRIBUTION-$SERIES.lock
243 by Steve Langasek
safe variable quoting of mktemp output
45
    [ -n "$tmpdir" ] && rm -rf "$tmpdir"
242 by Steve Langasek
Merge the multiple traps rather than overwriting
46
}
47
trap cleanup EXIT HUP INT QUIT TERM
340 by Steve Langasek
Unset http_proxy before calling bzr
48
http_proxy= bzr pull -q -d "$HOME/proposed-migration/code/b1"
198 by Martin Pitt
Fix previous commit
49
(cd "$HOME/proposed-migration/code/b2"; git fetch origin; git reset --hard --quiet origin/master)
142 by Colin Watson
run-proposed-migration: Export DISTRIBUTION, defaulting to "ubuntu"; include distribution name in log file path if it is not "ubuntu".
50
logfile="log/$full_series/$(date -u +%F/%T).log"
61 by Ubuntu Archive
run-proposed-migration: store logs in directories by day
51
mkdir -p "${logfile%/*}"
163 by Colin Watson
run-proposed-migration: allow running for stable Ubuntu series
52
53
code/b1/britney $actions >"$logfile" 2>&1
225.1.3 by Michael Hudson-Doyle
review feedback
54
if [ "$SERIES" = "$DEFAULT_SERIES" ]; then
227 by Steve Langasek
run generate-team-p-m from the right directory
55
    cd ~/public_html/proposed-migration/
282.1.1 by Iain Lane
generate-team-p-m, run-proposed-migration: More updates for .xz excuses
56
    generate-team-p-m --excuses-yaml $SERIES/update_excuses.yaml.xz \
225.1.3 by Michael Hudson-Doyle
review feedback
57
                      --subscribers-json ~/public_html/package-team-mapping.json \
234.1.1 by Michael Hudson-Doyle
yaml output for generate-team-p-m
58
                      $SERIES/update_excuses_by_team.html $SERIES/update_excuses_by_team.yaml
243 by Steve Langasek
safe variable quoting of mktemp output
59
    tmpdir="$(mktemp -d)"
250 by Adam Conrad
Call wget with -q when fetching debian-excuses.yaml
60
    wget -q -O "$tmpdir/debian-excuses.yaml" https://release.debian.org/britney/excuses.yaml
288 by Iain Lane
Fix find-rcbuggy-problem-packages for .xz excuses
61
    find-rcbuggy-problem-packages --ubuntu-excuses $SERIES/update_excuses.yaml.xz \
238.1.6 by Michael Hudson-Doyle
integrate into run-proposed-migration
62
                                  --ubuntu-update_output $SERIES/update_output.txt \
243 by Steve Langasek
safe variable quoting of mktemp output
63
                                  --debian-excuses "$tmpdir/debian-excuses.yaml" \
238.1.15 by Michael Hudson-Doyle
update run-proposed-migration
64
                                  --output $SERIES/rcbuggy-problem-packages.html
225.1.3 by Michael Hudson-Doyle
review feedback
65
fi
266 by Colin Watson
run-proposed-migration: Explicitly exit 0 at the end.
66
67
exit 0