~launchpad-pqm/launchpad/devel

4162.4.1 by Celso Providelo
Fix bug #110351 (lost doffiles in archive breaks dsync/mirroring). Adding a temporary directory in the archive-tree for storing files while they are downloaded from librarian.
1
#!/usr/bin/python2.4
8687.15.25 by Karl Fogel
Fix formatting around new license block.
2
#
8687.15.8 by Karl Fogel
Add the copyright header block to more files.
3
# Copyright 2009 Canonical Ltd.  This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
2865.2.4 by Celso Providelo
Dogfood tweaks, fix poppy, handy --log-file to logger, waiting between uploads test and other minor fixes.
6
import sys
7
import logging
8
import optparse
9
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
10
from canonical.poppy.server import run_server
8426.7.4 by Julian Edwards
mop up some top level scripts with bad imports.
11
from lp.archiveuploader.poppyinterface import PoppyInterface
2865.2.4 by Celso Providelo
Dogfood tweaks, fix poppy, handy --log-file to logger, waiting between uploads test and other minor fixes.
12
from canonical.launchpad.scripts import logger, logger_options
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
13
14
15
def main():
2865.2.4 by Celso Providelo
Dogfood tweaks, fix poppy, handy --log-file to logger, waiting between uploads test and other minor fixes.
16
17
    parser = optparse.OptionParser()
18
    logger_options(parser)
19
2865.6.8 by Gustavo Niemeyer
The Soyuz upload mechanism was changed to avoid the potential
20
    parser.add_option("--cmd", action="store", metavar="CMD",
21
                      help="Run CMD after each upload completion")
2865.3.1 by Gustavo Niemeyer
- Added ftpmaster@canonical.com gpg key into ftests/gpgkeys/
22
3023.2.20 by Celso Providelo
Fix soyuz-upload.txt test and behaviour of right ANY archhintlist builds.
23
    parser.add_option("--allow-user", action="store", metavar="USER",
24
                      default='ubuntu',
25
                      help="Username allowed to log in.")
26
3023.3.37 by Daniel Silverstone
workaround for annoying permissions on poppy directories
27
    parser.add_option("--permissions", action="store", metavar="PERMS",
28
                      default='g+rwxs',
29
                      help="Permissions to chmod the targetfsroot with "
30
                      "before letting go of the directory.")
31
2865.2.4 by Celso Providelo
Dogfood tweaks, fix poppy, handy --log-file to logger, waiting between uploads test and other minor fixes.
32
    options, args = parser.parse_args()
33
34
    log = logger(options, "poppy-upload")
35
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
36
    if len(args) != 2:
37
        print "usage: poppy-upload.py rootuploaddirectory port"
38
        return 1
2865.2.7 by Celso Providelo
Integrating DB tweaks required for upload-and-queue and breezy-autotest, renaming and fixing tests.
39
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
40
    root, port = args
3048.6.18 by Daniel Silverstone
Make poppy listen on external IP
41
    # host = "127.0.0.1"
3048.6.25 by Daniel Silverstone
o Add an ftests module to canonical.archivepublisher for
42
    # host = "82.211.81.167" # Drescher's public IP
43
    host = "0.0.0.0"
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
44
    ident = "lucille upload server"
45
    numthreads = 4
3023.2.20 by Celso Providelo
Fix soyuz-upload.txt test and behaviour of right ANY archhintlist builds.
46
47
    iface = PoppyInterface(root, log, allow_user=options.allow_user,
3023.3.37 by Daniel Silverstone
workaround for annoying permissions on poppy directories
48
                           cmd=options.cmd,
49
                           perms=options.permissions)
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
50
2865.6.8 by Gustavo Niemeyer
The Soyuz upload mechanism was changed to avoid the potential
51
    run_server(host, int(port), ident, numthreads,
1474 by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon
52
               iface.new_client_hook, iface.client_done_hook,
53
               iface.auth_verify_hook)
54
    return 0
55
56
if __name__ == '__main__':
57
    sys.exit(main())