~launchpad-pqm/launchpad/devel

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
#!/bin/sh
#
# Copyright 2009 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

# LPCONFIG will come from the environment so this script can run unaltered
# on dogfood.
if [ -z $LPCONFIG ]; then
    echo LPCONFIG must be set to run this script.
    exit 1
fi

set -e
set -u

#
# This script publishes the COPY (rebuild) archvies *only*.
#


# Informational -- this *MUST* match the database.
ARCHIVEROOT=/srv/launchpad.net/rebuild-test/ubuntu
DISTSROOT=$ARCHIVEROOT/dists
OVERRIDEROOT=$ARCHIVEROOT/../ubuntu-overrides
INDICES=$ARCHIVEROOT/indices
PRODUCTION_CONFIG=ftpmaster-publish

if [ "$LPCONFIG" = "$PRODUCTION_CONFIG" ]; then
    GNUPGHOME=/srv/launchpad.net/rebuild-test/gnupg-home
else
    echo GPG keys will come from ~/.gnupg
    # GNUPGHOME does not need to be set, keys can come from ~/.gnupg.
fi

# Configuration options.
LAUNCHPADROOT=/srv/launchpad.net/production/launchpad
LOCKFILE=/srv/launchpad.net/rebuild-test/cron.daily.lock
DISTRONAME=ubuntu

# Manipulate the environment.
export GNUPGHOME
PATH=$PATH:$LAUNCHPADROOT/scripts:$LAUNCHPADROOT/cronscripts:$LAUNCHPADROOT/cronscripts/publishing:$LAUNCHPADROOT/scripts/ftpmaster-tools

# Claim the lock.
if ! lockfile -r1 $LOCKFILE; then
  echo "Could not claim lock file."
  exit 1
fi

# Lock claimed.

cleanup () {
  echo "Cleaning up lockfile."
  rm -f $LOCKFILE
}

trap cleanup EXIT

# Process the accepted queue into the publishing records.
process-accepted.py --copy-archive -v -v -v $DISTRONAME

# Publish the packages to disk.
publish-distro.py -v -v --copy-archive -d $DISTRONAME

echo Removing uncompressed Packages and Sources files
find ${DISTSROOT} \( -name "Packages" -o -name "Sources" \) -exec rm "{}" \;