3
# Copyright 2009 Canonical Ltd. This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
8
archtag = os.popen("dpkg --print-architecture").read().strip()
10
from optparse import OptionParser
12
parser = OptionParser()
13
parser.add_option("-n", "--name", dest="NAME",
14
help="the name for this buildd",
18
parser.add_option("-H", "--host", dest="BINDHOST",
19
help="the IP/host this buildd binds to",
23
parser.add_option("-p", "--port", dest="BINDPORT",
24
help="the port this buildd binds to",
28
parser.add_option("-a", "--arch", dest="ARCHTAG",
29
help="the arch tag this buildd claims",
33
parser.add_option("-t", "--template", dest="TEMPLATE",
34
help="the template file to use",
36
default="/usr/share/launchpad-buildd/template-buildd-slave.conf")
38
(options, args) = parser.parse_args()
40
template = open(options.TEMPLATE, "r").read()
43
"@NAME@": options.NAME,
44
"@BINDHOST@": options.BINDHOST,
45
"@ARCHTAG@": options.ARCHTAG,
46
"@BINDPORT@": options.BINDPORT,
49
for replacement_key in replacements:
50
template = template.replace(replacement_key,
51
replacements[replacement_key])