~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/publishing/cron.germinate

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-22 04:55:30 UTC
  • mfrom: (14577.1.1 testfix)
  • Revision ID: launchpad@pqm.canonical.com-20111222045530-wki9iu6c0ysqqwkx
[r=wgrant][no-qa] Fix test_publisherconfig lpstorm import. Probably a
        silent conflict between megalint and apocalypse.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
4
# GNU Affero General Public License version 3 (see the file LICENSE).
 
5
 
 
6
set -e
 
7
set -u
 
8
 
 
9
ARCHIVEROOT=${TEST_ARCHIVEROOT:-/srv/launchpad.net/ubuntu-archive/ubuntu}
 
10
MISCROOT=$ARCHIVEROOT/../ubuntu-misc
 
11
LOCKROOT=$ARCHIVEROOT/..
 
12
GERMINATEROOT=$ARCHIVEROOT/../ubuntu-germinate
 
13
 
 
14
LAUNCHPADROOT=${TEST_LAUNCHPADROOT:-/srv/launchpad.net/codelines/current}
 
15
GENERATE=$LAUNCHPADROOT/cronscripts/generate-extra-overrides.py
 
16
MAINTAINCE_CHECK=$LAUNCHPADROOT/cronscripts/publishing/maintenance-check.py
 
17
 
 
18
FLAVOURS="ubuntu kubuntu kubuntu-mobile edubuntu xubuntu mythbuntu lubuntu"
 
19
FLAVOURS="$FLAVOURS ubuntustudio"
 
20
 
 
21
## Check to see if another germinate run is in progress
 
22
 
 
23
LOCKFILE=$LOCKROOT/cron.germinate.lock
 
24
if lockfile -! -l 43200 -r 0 "${LOCKFILE}"; then
 
25
  echo Another cron.germinate appears to be running
 
26
  exit 1
 
27
fi
 
28
 
 
29
cleanup () {
 
30
  rm -f "$LOCKFILE"
 
31
}
 
32
 
 
33
trap cleanup EXIT
 
34
 
 
35
cd $GERMINATEROOT
 
36
 
 
37
$GENERATE -d ubuntu $FLAVOURS
 
38
 
 
39
# Now generate the Supported extra overrides for all supported distros.
 
40
SUITES=`$LAUNCHPADROOT/scripts/ftpmaster-tools/lp-query-distro.py supported`
 
41
for supported_suite in $SUITES; do
 
42
    echo -n "Running maintenance-check for $supported_suite... "
 
43
    # The support timeframe information is stored here
 
44
    SUPPORTED="$MISCROOT/more-extra.override.$supported_suite.main.supported"
 
45
    # This is the target override file that contains germinate plus
 
46
    # support info.
 
47
    TARGET="$MISCROOT/more-extra.override.$supported_suite.main"
 
48
    # Debug/Log information
 
49
    LOG="_maintenance-check.$supported_suite.stderr"
 
50
    if $MAINTAINCE_CHECK $supported_suite > $SUPPORTED 2> $LOG; then
 
51
        # The target file may be missing on the server and the script should
 
52
        # not fail if that is the case.
 
53
        touch $TARGET
 
54
        # Remove old "Supported" info from extra-overrides as it may be
 
55
        # stale now and we replace it with fresh content below.
 
56
        sed /"^.* Supported"/d $TARGET > ${TARGET}.new
 
57
        cat $SUPPORTED >> ${TARGET}.new
 
58
        mv ${TARGET}.new $TARGET
 
59
    fi
 
60
    echo " done"
 
61
done