--- /dev/null
+config/acl.conf
+config/builder.conf
+config/rsync-passwords
+config/*.tar
+*.pyc
+lock
+log
+spool
+www
-PACKAGE := pld-builder
-VERSION := 0.5
+PACKAGE := tld-builder
+VERSION := 0.6
SNAP := $(shell date +%Y%m%d)
-# for make dist
-CVSROOT := :pserver:cvs@cvs.pld-linux.org:/cvsroot
-CVSMODULE := pld-builder.new
-CVSTAG := HEAD
+all: compile
-all:
+compile:
python -c "import compileall; compileall.compile_dir('.')"
clean:
find -name '*.pyc' | xargs rm -f
+ rm -f *.tar.bz2
-dist:
- rm -rf $(PACKAGE)-$(VERSION).$(SNAP)
- mkdir -p $(PACKAGE)-$(VERSION).$(SNAP)
- cvs -d $(CVSROOT) export -d $(PACKAGE)-$(VERSION).$(SNAP) -r $(CVSTAG) $(CVSMODULE)
- tar -cjf $(PACKAGE)-$(VERSION).$(SNAP).tar.bz2 $(PACKAGE)-$(VERSION).$(SNAP)
- rm -rf $(PACKAGE)-$(VERSION).$(SNAP)
- test -x ./dropin && ./dropin $(PACKAGE)-$(VERSION).$(SNAP).tar.bz2
+dist: $(PACKAGE)-$(VERSION).$(SNAP).tar.bz2
+ test ! -x ./dropin || ./dropin $<
+
+%.tar.bz2: %.tar
+ bzip2 -9 $<
+
+%.tar:
+ git archive --prefix=$(patsubst %.tar,%,$@)/ HEAD -o $@
+++ /dev/null
-#!/usr/bin/python
-
-import socket
-import string
-import cgi
-import time
-import log
-import sys
-import traceback
-import os
-from config import config, init_conf
-
-from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
-
-import request_handler
-import path
-
-class MyHandler(BaseHTTPRequestHandler):
-
- def do_GET(self):
- self.send_error(401);
-
- def do_POST(self):
- global rootnode
- try:
- length = int(self.headers.getheader('content-length'))
- ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
- if ctype != 'application/x-www-form-urlencoded':
- log.error("request_handler_server: [%s]: 401 Unauthorized" % self.client_address[0])
- self.send_error(401)
- self.end_headers()
- return
-
- query = self.rfile.read(length)
-
- filename = self.headers.getheader('x-filename')
-
- if not request_handler.handle_request_main(query, filename = filename):
- error = log.last_log();
- log.error("request_handler_server: [%s]: handle_request_main(..., %s) failed" % (self.client_address[0], filename))
- self.send_error(500, "%s: request failed. %s" % (filename, error))
- self.end_headers()
- return
-
- self.send_response(200)
- self.end_headers()
-
- except Exception, e:
- self.send_error(500, "%s: %s" % (filename, e))
- self.end_headers()
- log.error("request_handler_server: [%s]: exception: %s\n%s" % (self.client_address[0], e, traceback.format_exc()))
- raise
- pass
-
-def write_css():
- css_file = path.www_dir + "/style.css"
- # skip if file exists and code is not newer
- if os.path.exists(css_file) and os.stat(__file__).st_mtime < os.stat(css_file).st_mtime:
- return
-
- # css from www.pld-linux.org wiki theme, using css usage firebug plugin to cleanup
- css = """
-html {
- background-color: white;
- color: #5e5e5e;
- font-family: Tahoma, Arial, Lucida Grande, sans-serif;
- font-size: 0.75em;
- line-height: 1.25em;
-}
-
-a {
- text-decoration: underline;
- color: #006;
-}
-
-a:hover {
- color: #006;
-}
-
-pre {
- background: #FFF8EB;
- border: 1pt solid #FFE2AB;
- font-family: courier, monospace;
- padding: 0.5em;
- white-space: pre-wrap;
- word-wrap: break-word;
-}
-
-@media screen, projection {
- html {
- background-color: #f3efe3;
- }
-
- body {
- position: relative;
- }
-
- div {
- background-color: white;
- margin: 10px 0px;
- padding: 2px;
- }
- div > a {
- font-weight: bold;
- color: #5e5e5e;
- }
- div > a:hover {
- color: #5e5e5e;
- }
- div.upgrade {
- background-color: #e4f1cf;
- }
- div:target {
- background-color: #ffffcc;
- color: black;
- }
-}
-@media print {
- a {
- background-color: inherit;
- color: inherit;
- }
-}
-
-@media projection {
- html { line-height: 1.8em; }
- body, b, a, p { font-size: 22pt; }
-}
-"""
- old_umask = os.umask(0022)
- f = open(css_file, "w")
- f.write(css)
- f.close()
- os.umask(old_umask)
-
-def write_js():
- js_file = path.www_dir + "/script.js"
- # skip if file exists and code is not newer
- if os.path.exists(js_file) and os.stat(__file__).st_mtime < os.stat(js_file).st_mtime:
- return
-
- js = """
-// update date stamps to reflect viewers timezone
-function update_tz(t) {
- var el, off, dt,
- collection = document.getElementsByTagName('span');
- for (off in collection) {
- el = collection[off];
- if (el.id == 'tz') {
- dt = new Date(el.innerHTML).toString();
- // strip timezone name, it is usually wrong when not initialized
- // from TZ env, but reverse calculated from os data
- dt = dt.replace(/\s+\(.+\)/, "");
- // strip "GMT"
- dt = dt.replace(/GMT/, "");
- el.innerHTML = dt;
- }
- }
-}
-window.onload = update_tz;
-"""
- old_umask = os.umask(0022)
- f = open(js_file, "w")
- f.write(js)
- f.close()
- os.umask(old_umask)
-
-def main():
- write_css();
- write_js();
- socket.setdefaulttimeout(30)
- try:
- init_conf()
- host = ""
- port = config.request_handler_server_port
-
- try:
- server = HTTPServer((host, port), MyHandler)
- except Exception, e:
- log.notice("request_handler_server: can't start server on [%s:%d]: %s" % (host, port, e))
- print >> sys.stderr, "ERROR: Can't start server on [%s:%d]: %s" % (host, port, e)
- sys.exit(1)
-
- log.notice('request_handler_server: started on [%s:%d]...' % (host, port))
- server.serve_forever()
- except KeyboardInterrupt:
- log.notice('request_handler_server: ^C received, shutting down server')
- server.socket.close()
-
-if __name__ == '__main__':
- main()
-
self.privs = []
self.gpg_emails = []
self.mailto = ""
+ self.change_requester = False
if p.has_option(login, "gpg_emails"):
self.gpg_emails = string.split(p.get(login, "gpg_emails"))
if len(self.gpg_emails) > 0:
self.mailto = self.gpg_emails[0]
+ if p.has_option(login, "change_requester"):
+ self.change_requester = True
+
if p.has_option(login, "privs"):
for p in string.split(p.get(login, "privs")):
l = string.split(p, ":")
return self.users[e]
return None
+ def user_by_login(self, l):
+ return self.users[l]
+
def user(self, l):
if not self.users.has_key(l):
log.panic("no such user: %s" % l)
import string
import tempfile
-# PLD_Builder:
+# TLD_Builder:
import gpg
import request
import util
f.write("""
<html>
<head>
- <link rel="Shortcut Icon" href="http://www.tld-linux.org/favicon.ico"/>
+ <link rel="Shortcut Icon" href="//www.tld-linux.org/favicon.ico"/>
<title>TLD builder queue</title>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="style.css">
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.3/jquery.timeago.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
-<body>\n"""
+<body>
+<div id="header">
+ <div id="requesters-filter">Filter by requesters:<br></div>
+</div>
+<div id="content">
+"""
)
self.requests.reverse()
for r in self.requests:
r.dump_html(f)
self.requests.reverse()
- f.write("</body></html>\n")
+ f.write("</div></body></html>\n")
f.flush()
os.fsync(f.fileno())
f.close()
else:
user = "root"
if "as-builder" in batch.command_flags:
- user = "builder"
+ user = None
return chroot.run(command, logfile = batch.logfile, user = user)
def build_all(r, build_fnc):
log.notice("running %s OK" % batch.command)
notify.add_batch(batch, "OK")
batch.build_time = stopwatch.stop()
- report.add_pld_builder_info(batch)
+ report.add_tld_builder_info(batch)
buildlogs.add(batch.logfile, failed = batch.build_failed, id=r.id)
else:
log.notice("not running command, not for me.")
log.notice("building %s OK" % (batch.spec))
notify.add_batch(batch, "OK")
batch.build_time = stopwatch.stop()
- report.add_pld_builder_info(batch)
+ report.add_tld_builder_info(batch)
buildlogs.add(batch.logfile, failed = batch.build_failed, id=r.id)
else:
batch.build_failed = 1
<generator>
<name>TLD Linux Builder client for CIA</name>
<version>0.001</version>
- <url>http://git.tld-linux.org/?p=pld-builder.new.git;a=blob;f=PLD_Builder/report.py</url>
+ <url>http://git.tld-linux.org/?p=tld-builder.new.git;a=blob;f=TLD_Builder/report.py</url>
</generator>
<source>
<project>tld</project>
def read(self, builder):
p = ConfigParser.ConfigParser()
- def get(o, d = None):
- if p.has_option(builder, o):
+ def get(o, d = None, sec=None):
+ if p.has_option(sec, o):
+ return string.strip(p.get(sec, o))
+ elif p.has_option(builder, o):
return string.strip(p.get(builder, o))
elif p.has_option("all", o):
return string.strip(p.get("all", o))
self.max_keep_time = int(get("max_keep_time", 168))*60*60
self.bot_email = get("bot_email", "")
self.control_url = get("control_url")
- self.request_handler_server_port = int(get("request_handler_server_port", 1234))
+ self.request_handler_server_port = int(get("port", d=1234, sec="request-server"))
+ self.request_handler_server_ssl = get("ssl", d="False", sec="request-server")
+ if self.request_handler_server_ssl:
+ self.request_handler_server_ssl_port = int(get("port", d=1235, sec="request-server"))
+ self.request_handler_server_ssl_key = get("ssl_key", d="", sec="request-server")
+ self.request_handler_server_ssl_cert = get("ssl_cert", d="", sec="request-server")
self.builder_list = get("builder_list", "")
self.gen_upinfo = get("gen_upinfo", "yes")
if self.gen_upinfo == 'no':
self.arch = get("arch")
self.chroot = get("chroot")
self.buildlogs_url = get("buildlogs_url", "/dev/null")
+ self.buildlogs = get("buildlogs", "http://buildlogs.tld-linux.org/")
self.ftp_url = get("ftp_url")
self.notify_url = get("notify_url")
self.test_ftp_url = get("test_ftp_url", "/dev/null")
m = re.match('ssh\+rsync://([^@:]+@[^/:]+)(:|)(.*)', target)
if m:
return not rsync_ssh_file(src, m.group(1) + ":" + m.group(3))
- m = re.match('http://.*', target)
+ m = re.match('(http|https)://.*', target)
if m:
return not post_file(src, target)
log.alert("unsupported protocol: %s" % target)
d_stdout = None
d_stderr = None
cmd = ['/usr/bin/gpg', '--batch', '--no-tty', '--clearsign']
+ # TODO: check for gpg return code!
gpg_run = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
try:
d_stdout, d_stderr = gpg_run.communicate(buf.encode('utf-8'))
log.error("gnupg signing failed, does gpg binary exist? : %s" % e)
raise
+ if len(d_stderr):
+ log.error("gpg: %s" % d_stderr)
+
return d_stdout
'poldek',
'rpm-build',
'pdksh',
+ 'mksh',
'coreutils'
]
def uninstall_self_conflict(b):
b.log_line("checking BuildConflict-ing packages")
- packagename = b.spec[:-5]
- tmpdir = os.environ.get('HOME') + "/rpm/BUILD/%s/tmp" % packagename
- f = chroot.popen("set -e; TMPDIR=%(tmpdir)s rpmbuild -bp --nobuild --short-circuit --define 'prep exit 0' %(rpmdefs)s rpm/packages/%(package)s/%(spec)s 2>&1" % {
- 'tmpdir': tmpdir,
+ f = chroot.popen("set -e; TMPDIR=%(tmpdir)s " \
+ "rpmbuild -bp --nobuild --short-circuit --define 'prep exit 0' %(rpmdefs)s %(topdir)s/%(spec)s 2>&1" % {
+ 'tmpdir': b.tmpdir(),
'rpmdefs' : b.rpmbuild_opts(),
- 'package' : packagename,
+ 'topdir' : b.get_topdir(),
'spec': b.spec,
})
# java-sun >= 1.5 conflicts with soprano-2.1.67-1.src
# ignore internal rpm dependencies, see lib/rpmns.c for list
ignore_br = re.compile(r'^\s*(rpmlib|cpuinfo|getconf|uname|soname|user|group|mounted|diskspace|digest|gnupg|macro|envvar|running|sanitycheck|vcheck|signature|verify|exists|executable|readable|writable)\(.*')
- packagename = b.spec[:-5]
- tmpdir = os.environ.get('HOME') + "/rpm/BUILD/%s/tmp" % packagename
- chroot.run("install -m 700 -d %s" % tmpdir)
- cmd = "set -e; TMPDIR=%(tmpdir)s rpmbuild --nobuild %(rpmdefs)s rpm/packages/%(package)s/%(spec)s 2>&1" % {
+ tmpdir = b.tmpdir()
+ cmd = "set -e; TMPDIR=%(tmpdir)s rpmbuild --nobuild %(rpmdefs)s %(topdir)s/%(spec)s 2>&1" % {
'tmpdir': tmpdir,
+ 'topdir' : b.get_topdir(),
'rpmdefs' : b.rpmbuild_opts(),
- 'package' : packagename,
'spec': b.spec,
}
f = chroot.popen(cmd)
chroot.run("poldek --up --upa", user = "root", logfile = b.logfile)
# check conflicts in BRed packages
b.log_line("checking conflicting packages in BRed packages")
- f = chroot.popen("poldek --test --test --noask --caplookup -Q -v --upgrade %s" % br, user = "root")
+ f = chroot.popen("poldek --test --test --noask --caplookup -Q -v %s --upgrade %s" % (b.ignores(), br), user = "root")
# phonon-devel-4.3.1-1.i686 conflicts with qt4-phonon-devel-4.5.0-6.i686
# jdbc-stdext >= 2.0 is required by installed java-struts-1.3.10-1.noarch
# jmx is needed by (installed) java-commons-modeler-2.0-1.noarch
br = string.strip(nbr)
b.log_line("installing BR: %s" % br)
- res = chroot.run("poldek --noask --caplookup -Q -v --upgrade %s" % br,
+ res = chroot.run("set -x; poldek --noask --caplookup -Q -v %s --upgrade %s" % (b.ignores(), br),
user = "root",
logfile = b.logfile)
if res != 0:
took = time.time() - last
if took < secs:
time.sleep(secs - took)
-
if subject != None:
self.set_header("Subject", subject)
+ def remove_header(self, n):
+ if n in self.headers:
+ del self.headers[n]
+
def write_line(self, l):
self.body.write(recode("%s\n" % l))
def set_std_headers(self):
self.headers["Date"] = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime())
- self.headers["Message-ID"] = "<pld-builder.%f.%d@%s>" \
+ self.headers["Message-ID"] = "<tld-builder.%f.%d@%s>" \
% (time.time(), os.getpid(), os.uname()[1])
- self.headers["From"] = "PLD %s builder <%s>" \
+ self.headers["From"] = "TLD %s builder <%s>" \
% (config.builder, config.email)
- self.headers["X-PLD-Builder"] = config.builder
+ self.headers["X-TLD-Builder"] = config.builder
def write_to(self, f):
for k, v in self.headers.items():
continue
else:
handle_bin()
-
root_dir = os.getenv('BUILDERPATH')
if root_dir is None:
- root_dir = os.path.expanduser('~/pld-builder.new')
+ root_dir = os.path.expanduser('~/tld-builder.new')
conf_dir = root_dir + "/config"
spool_dir = root_dir + "/spool"
lock_dir = root_dir + "/lock"
acl_conf = conf_dir + "/acl.conf"
builder_conf = conf_dir + "/builder.conf"
rsync_password_file = conf_dir + "/rsync-passwords"
+blacklist_file = conf_dir + "/package-blacklist"
# spool/
queue_file = spool_dir + "/queue"
copy_mode = 1
out.append(l)
elif copy_mode:
- if l[0] != ' ':
+ if l[0] != ' ' and l[0] != '\t':
copy_mode = 0
else:
out.append(l)
return out
-def add_pld_builder_info(b):
+def add_tld_builder_info(b):
l = open(b.logfile, "a")
- l.write("Begin-PLD-Builder-Info\n")
+ l.write("Begin-TLD-Builder-Info\n")
l.write("Build-Time: %s\n\n" % b.build_time)
st = ftp.status()
if st != "":
l.write("Files queued for ftp:\n%s\n" % st)
ftp.clear_status()
l.writelines(unpackaged_files(b))
- l.write("End-PLD-Builder-Info\n")
+ l.write("End-TLD-Builder-Info\n")
def info_from_log(b, target):
- beg = "Begin-PLD-Builder-Info\n"
- end = "End-PLD-Builder-Info\n"
+ beg = "Begin-TLD-Builder-Info\n"
+ end = "End-TLD-Builder-Info\n"
f = open(b.logfile)
copy_mode = 0
need_header = 1
subject += ' '.join((s_failed, s_ok)).strip()
m = mailer.Message()
- m.set_headers(to = r.requester_email,
- cc = config.builder_list,
- subject = subject[0:100])
- if is_src:
- m.set_header("Message-ID", "<%s@pld.src.builder>" % r.id)
- else:
- m.set_header("References", "<%s@pld.src.builder>" % r.id)
- m.set_header("In-Reply-To", "<%s@pld.src.builder>" % r.id)
+ m.write("Request by: %s\n\n" % r.requester_email)
for b in r.batches:
if b.build_failed and b.logfile == None:
info = b.skip_reason
m.append_log(b.logfile)
m.write("\n\n")
+ m.set_headers(to = r.requester_email,
+ subject = subject[0:100])
+ if is_src:
+ m.set_header("Message-ID", "<req-%s@tld.src.builder>" % r.id)
+ else:
+ m.set_header("References", "<req-%s@tld.src.builder>" % r.id)
+ m.set_header("In-Reply-To", "<req-%s@tld.src.builder>" % r.id)
+ m.send()
+
+ m.remove_header("To")
+ m.remove_header("Cc")
+ m.set_header("To", config.builder_list)
+ # reset Message-ID
+ m.set_std_headers()
+ if is_src:
+ m.set_header("Message-ID", "<%s@tld.src.builder>" % r.id)
+ else:
+ m.set_header("References", "<%s@tld.src.builder>" % r.id)
+ m.set_header("In-Reply-To", "<%s@tld.src.builder>" % r.id)
m.send()
def send_cia_report(r, is_src = False):
m.set_headers(to = config.bot_email,
subject = subject)
- m.set_header("Message-ID", "<%s@pld.src.builder>" % r.id)
+ m.set_header("Message-ID", "<%s@tld.src.builder>" % r.id)
m.set_header("X-mailer", "$Id$")
- m.set_header("X-builder", "PLD")
+ m.set_header("X-builder", "TLD")
# get header of xml message from file
- f = open(path.root_dir + '/PLD_Builder/cia-head.xml')
+ f = open(path.root_dir + '/TLD_Builder/cia-head.xml')
m.write(f.read())
f.close()
m.write('</package>\n')
# get footer of xml message from file
- f = open(path.root_dir + '/PLD_Builder/cia-foot.xml')
+ f = open(path.root_dir + '/TLD_Builder/cia-foot.xml')
m.write(f.read())
f.close()
# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
from xml.dom.minidom import *
+from datetime import datetime
import string
import time
import xml.sax.saxutils
import os
import urllib
import cgi
+import pytz
+import tempfile
import util
import log
def escape(s):
return xml.sax.saxutils.escape(s)
+# return date in iso8601 format
+def iso8601(ts, timezone='UTC'):
+ tz = pytz.timezone(timezone)
+ dt = datetime.fromtimestamp(ts, tz)
+ return dt.isoformat()
+
def is_blank(e):
return e.nodeType == Element.TEXT_NODE and string.strip(e.nodeValue) == ""
def dump_html(self, f):
f.write(
- "<div id=\"%(no)d\" class=\"%(flags)s\">\n"
- "<a href=\"#%(no)d\">%(no)d</a>. <span id=\"tz\">%(time)s</span> from <b>%(requester)s</b> "
+ "<div id=\"%(no)d\" class=\"request %(flags)s\">\n"
+ "<a href=\"#%(no)d\">%(no)d</a>. "
+ "<time class=\"timeago\" datetime=\"%(datetime)s\">%(time)s</time> "
+ "from <b class=requester>%(requester)s</b> "
"<small>%(id)s, prio=%(priority)d, jobs=%(max_jobs)d, %(flags)s</small>\n"
% {
'no': self.no,
'id': '<a href="srpms/%(id)s">%(id)s</a>' % {'id': self.id},
'time': escape(time.strftime("%a %b %d %Y %H:%M:%S %z", time.localtime(self.time))),
+ 'datetime': escape(iso8601(self.time)),
'requester': escape(self.requester),
'priority': self.priority,
'max_jobs': self.max_jobs,
'flags': string.join(self.flags)
})
- f.write("<ul>\n")
+ f.write("<ol>\n")
for b in self.batches:
b.dump_html(f, self.id)
- f.write("</ul>\n")
+ f.write("</ol>\n")
f.write("</div>\n")
def write_to(self, f):
self.builders_status_time = {}
self.builders_status_buildtime = {}
self.kernel = ""
+ self.defines = {}
self.target = []
self.branch = ""
self.src_rpm = ""
self.b_id = attr(e, "id")
self.depends_on = string.split(attr(e, "depends-on"))
self.upgraded = True
+
+ self.parse_xml(e)
+
+ self.__topdir = None
+
+ def get_topdir(self):
+ if not self.__topdir:
+ self.__topdir = tempfile.mkdtemp(prefix='B.', dir='/tmp')
+ return self.__topdir
+
+ def parse_xml(self, e):
for c in e.childNodes:
if is_blank(c): continue
self.info = text(c)
elif c.nodeName == "kernel":
self.kernel = text(c)
+ elif c.nodeName == "define":
+ define = attr(c, "name")
+ self.defines[define] = text(c)
elif c.nodeName == "target":
self.target.append(text(c))
elif c.nodeName == "skip":
else:
log.panic("xml: evil batch child (%s)" % c.nodeName)
+ def get_package_name(self):
+ if len(self.spec) <= 5:
+ return None
+ return self.spec[:-5]
+
+ def tmpdir(self):
+ """
+ return tmpdir for this batch job building
+ """
+ # it's better to have TMPDIR and BUILD dir on same partition:
+ # + /usr/bin/bzip2 -dc /home/services/builder/rpm/packages/kernel/patch-2.6.27.61.bz2
+ # patch: **** Can't rename file /tmp/B.a1b1d3/poKWwRlp to drivers/scsi/hosts.c : No such file or directory
+ path = os.path.join(self.get_topdir(), 'BUILD', 'tmp')
+ return path
+
def is_done(self):
ok = 1
for b in self.builders:
f.write(" batch: %s/%s\n" % (self.src_rpm, self.spec))
f.write(" info: %s\n" % self.info)
f.write(" kernel: %s\n" % self.kernel)
+ f.write(" defines: %s\n" % self.defines_string())
f.write(" target: %s\n" % self.target_string())
f.write(" branch: %s\n" % self.branch)
f.write(" bconds: %s\n" % self.bconds_string())
if self.is_command():
desc = "SH: <pre>%s</pre> flags: [%s]" % (self.command, ' '.join(self.command_flags))
else:
- cmd = "/usr/bin/git ls-remote --heads git://git.tld-linux.org/packages/%s 1>/dev/null 2>&1" % (self.spec[:-5])
- r = call(cmd, shell=True)
- if r == 0:
- dist = "tld"
- else:
- dist = "pld"
- package_url = "http://git.%(dist)s-linux.org/?p=packages/%(package)s.git;a=blob;f=%(spec)s;hb=%(branch)s" % {
- 'dist': dist,
- 'spec': self.spec,
- 'branch': self.branch,
- 'package': self.spec[:-5],
+ cmd = "/usr/bin/git ls-remote --heads git://git.tld-linux.org/packages/%s 1>/dev/null 2>&1" % (self.spec[:-5])
+ r = call(cmd, shell=True)
+ if r == 0:
+ dist = "tld"
+ else:
+ dist = "pld"
+ package_url = "http://git.%(dist)s-linux.org/?p=packages/%(package)s.git;a=blob;f=%(spec)s;hb=%(branch)s" % {
+ 'dist': dist,
+ 'spec': urllib.quote(self.spec),
+ 'branch': urllib.quote(self.branch),
+ 'package': urllib.quote(self.spec[:-5]),
}
- desc = "%(src_rpm)s (<a href=\"%(package_url)s\">%(spec)s -r %(branch)s</a>%(bconds)s)" % {
+ desc = "%(src_rpm)s (<a href=\"%(package_url)s\">%(spec)s -r %(branch)s</a>%(rpmopts)s)" % {
'src_rpm': self.src_rpm,
'spec': self.spec,
'branch': self.branch,
- 'bconds': self.bconds_string() + self.kernel_string() + self.target_string(),
+ 'rpmopts': self.bconds_string() + self.kernel_string() + self.target_string() + self.defines_string(),
'package_url': package_url,
}
f.write("%s <small>[" % desc)
bld = lin_ar.split('-')
tree_name = '-'.join(bld[:-1])
tree_arch = '-'.join(bld[-1:])
- link_pre = "<a href=\"http://buildlogs.tld-linux.org/index.php?dist=%s&arch=%s&name=%s&id=%s&action=download\">" \
- % (urllib.quote(tree_name), urllib.quote(tree_arch), urllib.quote(bl_name), urllib.quote(rid))
+ link_pre = "<a href=\"http://buildlogs.tld-linux.org/index.php?dist=%s&arch=%s&name=%s&id=%s&action=download\">" \
+ % (urllib.quote(tree_name), urllib.quote(tree_arch), urllib.quote(bl_name), urllib.quote(rid))
link_post = "</a>"
def ftime(s):
"""
return all rpmbuild options related to this build
"""
- bconds = self.bconds_string() + self.kernel_string() + self.target_string()
+ rpmopts = self.bconds_string() + self.kernel_string() + self.target_string() + self.defines_string()
rpmdefs = \
- "--define '_topdir %(echo $HOME/rpm)' " \
- "--define '_specdir %{_topdir}/packages/%{name}' " \
+ "--define '_topdir %s' " % self.get_topdir() + \
+ "--define '_specdir %{_topdir}' " \
"--define '_sourcedir %{_specdir}' " \
- "--define '_builddir %{_topdir}/BUILD/%{name}' "
- return rpmdefs + bconds
+ "--define '_rpmdir %{_topdir}/RPMS' " \
+ "--define '_builddir %{_topdir}/BUILD' "
+ return rpmdefs + rpmopts
+
+ def php_ignores(self):
+ # transform php package name (52) to version (5.2)
+ def php_name_to_ver(v):
+ return '.'.join(list(v))
+
+ # transform php version (5.2) to package name (52)
+ def php_ver_to_name(v):
+ return v.replace('.', '')
+
+ # available php versions in distro
+ php_versions = ['4', '5.2', '5.3', '5.4', '5.5', '5.6', '7.0']
+
+ # current version if -D php_suffix is present
+ php_version = php_name_to_ver(self.defines['php_suffix'])
+
+ # remove current php version
+ try:
+ php_versions.remove(php_version)
+ except ValueError:
+ log.notice("Attempt to remove inexistent key '%s' from %s" % (php_version, php_versions))
+ pass
+
+ # map them to poldek ignores
+ # always ignore hhvm
+ res = ['hhvm-*']
+ for v in map(php_ver_to_name, php_versions):
+ res.append("php%s-*" % v)
+
+ return res
+
+ # build ignore package list
+ # currently only php ignore is filled based on build context
+ def ignores(self):
+ ignores = []
+
+ # add php version based ignores
+ if self.defines.has_key('php_suffix'):
+ ignores.extend(self.php_ignores())
+
+ # return empty string if the list is empty
+ if len(ignores) == 0:
+ return ""
+
+ def add_ignore(s):
+ return "--ignore=%s" % s
+
+ return " ".join(map(add_ignore, ignores))
def kernel_string(self):
r = ""
r = r + " --without " + b
return r
+ def defines_string(self):
+ r = ""
+ for key,value in self.defines.items():
+ r += " --define '%s %s'" % (key, value)
+ return r
+
+ def defines_xml(self):
+ r = ""
+ for key,value in self.defines.items():
+ r += "<define name='%s'>%s</define>\n" % (escape(key), escape(value))
+ return r
+
def default_target(self, arch):
self.target.append("%s-tld-linux" % arch)
f.write(" <target>%s</target>\n" % escape(b))
for b in self.bconds_without:
f.write(" <without>%s</without>\n" % escape(b))
+ if self.defines:
+ f.write(" %s\n" % self.defines_xml())
for b in self.builders:
if self.builders_status_buildtime.has_key(b):
t = self.builders_status_buildtime[b]
import request
import loop
import socket
+import struct
from acl import acl
from bqueue import B_Queue
from config import config, init_conf
f.close()
sio.seek(0)
f = gzip.GzipFile(fileobj = sio)
- (signers, body) = gpg.verify_sig(f.read())
+ try:
+ fdata = f.read()
+ except struct.error, e:
+ log.alert("corrupted fetched queue.gz file")
+ sys.exit(1)
+ (signers, body) = gpg.verify_sig(fdata)
u = acl.user_by_email(signers)
if u == None:
log.alert("queue.gz not signed with signature of valid user: %s" % signers)
import wrap
import status
from acl import acl
+from blacklist import blacklist
from lock import lock
from bqueue import B_Queue
from config import config, init_conf
+from mailer import Message
def check_double_id(id):
id_nl = id + "\n"
else:
spec = "None.spec"
log.error("%s: %s" % (spec, msg))
- m = user.message_to()
+ m = Message()
+ m.set_headers(to = r.requester_email, cc = config.builder_list)
m.set_headers(subject = "building %s failed" % spec)
m.write_line(msg)
m.send()
lockf.close()
return
+ try:
+ if (user.change_requester and r.requester):
+ user = acl.user_by_login(r.requester)
+ except KeyError:
+ r.requester += '/' + user.get_login()
+ else:
+ r.requester = user.get_login()
+ r.requester_email = user.mail_to()
+
for batch in r.batches:
if not user.can_do("src", config.builder, batch.branch):
% (user.get_login(), pkg, bld, batch.branch))
lockf.close()
return
+ if not "test-build" in r.flags and not user.can_do("ready", bld, batch.branch):
+ fail_mail("user %s is not allowed to send ready builds (ready:%s:%s)" \
+ % (user.get_login(), bld, batch.branch))
+ lockf.close()
+ return
+
+ pkg = batch.spec
+ if pkg.endswith(".spec"):
+ pkg = pkg[:-5]
+ if not "test-build" in r.flags and blacklist.package(pkg):
+ fail_mail("package '%s' is blacklisted, only test-builds allowed" % pkg)
+ lockf.close()
+ return
r.priority = user.check_priority(r.priority,config.builder)
- r.requester = user.get_login()
- r.requester_email = user.mail_to()
r.time = time.time()
log.notice("queued %s from %s" % (r.id, user.get_login()))
q = B_Queue(path.queue_file)
def handle_request_main(req, filename = None):
acl.try_reload()
+ blacklist.try_reload()
init_conf("src")
status.push("handling email request")
ret = handle_request(req, filename = filename)
fi
if [ "$daemon" = 1 ]; then
- echo "Starting request_handler_server"
+ echo "Starting request_handler_server(s)"
rm -f $sock
cd $(dirname $sock)
- exec dtach -n $(basename $sock) -r none python request_handler_server.py
+ tmux -S $sock new-session -d -s "request_handler_server" -n "http" "python request_handler_server.py" && \
+ exec tmux -S $sock new-window -d -t "request_handler_server" -n "https" "python request_handler_server.py ssl"
exit 1
fi
# attach to session
if [ "$attach" = 1 ]; then
- echo "Attaching to request_handler_server"
- exec dtach -a $sock
+ echo "Attaching to request_handler_server(s)"
+ exec tmux -S $sock attach
exit 1
fi
--- /dev/null
+#!/usr/bin/python
+
+import socket
+import string
+import cgi
+import time
+import log
+import ssl
+import sys
+import traceback
+import os
+from config import config, init_conf
+
+from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
+
+import request_handler
+import path
+
+class MyHandler(BaseHTTPRequestHandler):
+
+ def do_GET(self):
+ self.send_error(401);
+
+ def do_POST(self):
+ global rootnode
+ try:
+ length = int(self.headers.getheader('content-length'))
+ filename = self.headers.getheader('x-filename')
+ if not length:
+ log.error("request_handler_server: [%s]: 401 Unauthorized" % self.client_address[0])
+ self.send_error(401)
+ self.end_headers()
+ return
+
+ query = self.rfile.read(length)
+
+ if not request_handler.handle_request_main(query, filename = filename):
+ error = log.last_log();
+ log.error("request_handler_server: [%s]: handle_request_main(..., %s) failed" % (self.client_address[0], filename))
+ self.send_error(500, "%s: request failed. %s" % (filename, error))
+ self.end_headers()
+ return
+
+ self.send_response(200)
+ self.end_headers()
+
+ except Exception, e:
+ self.send_error(500, "%s: %s" % (filename, e))
+ self.end_headers()
+ log.error("request_handler_server: [%s]: exception: %s\n%s" % (self.client_address[0], e, traceback.format_exc()))
+ raise
+ pass
+
+def write_css():
+ css_src = os.path.join(os.path.dirname(__file__), 'style.css')
+ css_file = path.www_dir + "/style.css"
+ # skip if file exists and code is not newer
+ if os.path.exists(css_file) and os.stat(css_src).st_mtime < os.stat(css_file).st_mtime:
+ return
+
+ old_umask = os.umask(0022)
+ r = open(css_src, 'r')
+ f = open(css_file, "w")
+ f.write(r.read())
+ f.close()
+ r.close()
+ os.umask(old_umask)
+
+def write_js():
+ js_src = os.path.join(os.path.dirname(__file__), 'script.js')
+ js_file = path.www_dir + '/script.js'
+ # skip if file exists and code is not newer
+ if os.path.exists(js_file) and os.stat(js_src).st_mtime < os.stat(js_file).st_mtime:
+ return
+
+ old_umask = os.umask(0022)
+ r = open(js_src, 'r')
+ f = open(js_file, 'w')
+ f.write(r.read())
+ f.close()
+ r.close()
+ os.umask(old_umask)
+
+def main(srv_ssl=False):
+ write_css();
+ write_js();
+ socket.setdefaulttimeout(30)
+ try:
+ init_conf()
+ host = ""
+ port = config.request_handler_server_port
+ if srv_ssl:
+ port = config.request_handler_server_ssl_port
+
+ try:
+ server = HTTPServer((host, port), MyHandler)
+ if srv_ssl:
+ server.socket = ssl.wrap_socket (server.socket,
+ keyfile = config.request_handler_server_ssl_key,
+ certfile = config.request_handler_server_ssl_cert,
+ ca_certs = "/etc/certs/ca-certificates.crt",
+ server_side=True)
+ except Exception, e:
+ log.notice("request_handler_server: can't start server on [%s:%d], ssl=%s: %s" % (host, port, str(srv_ssl), e))
+ print >> sys.stderr, "ERROR: Can't start server on [%s:%d], ssl=%s: %s" % (host, port, str(srv_ssl), e)
+ sys.exit(1)
+
+ log.notice('request_handler_server: started on [%s:%d], ssl=%s...' % (host, port, str(srv_ssl)))
+ server.serve_forever()
+ except KeyboardInterrupt:
+ log.notice('request_handler_server: ^C received, shutting down server')
+ server.socket.close()
+
+if __name__ == '__main__':
+ srv_ssl = False
+ if len(sys.argv) == 2 and sys.argv[1] == "ssl":
+ srv_ssl = True
+
+ main(srv_ssl)
b.log_line(msg)
return False
except urllib2.URLError, error:
- # see errno.h
- try:
- errno = error.errno
- except AttributeError:
- # python 2.4
- errno = error.reason[0]
+ errno = 0
+ if isinstance(error.args[0], IOError):
+ errno = error.args[0].errno
if errno in [-3, 60, 61, 110, 111]:
b.log_line("unable to connect to %s... trying again" % (src_url))
continue
else:
+ try:
+ print "error.errno: %s" % str(error.errno)
+ except Exception, e:
+ print "error.errno: exception %s" % e
+ try:
+ print "error.reason %s" % str(error.reason)
+ except Exception, e:
+ print "error.reason exception %s" % e
raise
o = chroot.popen("cat > %s" % b.src_rpm, mode = "w")
else:
b.log_line("fetched %d bytes, %.1f K/s" % (bytes, bytes / 1024.0 / t))
-def prepare_env():
+def prepare_env(logfile = None):
chroot.run("""
test ! -f /proc/uptime && mount /proc 2>/dev/null
test ! -c /dev/full && rm -f /dev/full && mknod -m 666 /dev/full c 1 7
test ! -c /dev/zero && rm -f /dev/zero && mknod -m 666 /dev/zero c 1 5
# need entry for "/" in mtab, for diskspace() to work in rpm
- [ -z $(awk '$2 == "/" {print $1}' /etc/mtab) ] && mount -f -t rootfs rootfs /
+ [ -z $(awk '$2 == "/" {print $1; exit}' /etc/mtab) ] && mount -f -t rootfs rootfs /
# make neccessary files readable for builder user
# TODO: see if they really aren't readable for builder
# try to limit network access for builder account
/bin/setfacl -m u:builder:--- /etc/resolv.conf
- """, 'root')
+ """, 'root', logfile = logfile)
def build_rpm(r, b):
- if len(b.spec) <= 5:
+ packagename = b.get_package_name()
+ if not packagename:
# should not really get here
b.log_line("error: No .spec not given of malformed: '%s'" % b.spec)
res = "FAIL_INTERNAL"
return res
- packagename = b.spec[:-5]
status.push("building %s (%s)" % (b.spec, packagename))
b.log_line("request from: %s" % r.requester)
fetch_src(r, b)
b.log_line("installing srpm: %s" % b.src_rpm)
res = chroot.run("""
- # b.id %(bid)s
set -ex;
- install -d rpm/packages/%(package)s rpm/BUILD/%(package)s;
- rpm -Uhv %(rpmdefs)s %(src_rpm)s;
+ install -d %(topdir)s/{BUILD,RPMS};
+ LC_ALL=en_US.UTF-8 rpm -qp --changelog %(src_rpm)s;
+ rpm -Uhv --nodeps %(rpmdefs)s %(src_rpm)s;
rm -f %(src_rpm)s;
""" % {
- 'bid' : b.b_id,
- 'package' : packagename,
+ 'topdir' : b.get_topdir(),
'rpmdefs' : b.rpmbuild_opts(),
'src_rpm' : b.src_rpm
}, logfile = b.logfile)
b.files = []
- # it's better to have TMPDIR and BUILD dir on same partition:
- # + /usr/bin/bzip2 -dc /home/services/builder/rpm/packages/kernel/patch-2.6.27.61.bz2
- # patch: **** Can't rename file /tmp/B.a1b1d3/poKWwRlp to drivers/scsi/hosts.c : No such file or directory
- tmpdir = os.environ.get('HOME') + "/rpm/BUILD/%s/tmp" % packagename
+ tmpdir = b.tmpdir()
if res:
b.log_line("error: installing src rpm failed")
res = "FAIL_SRPM_INSTALL"
else:
prepare_env()
- chroot.run("install -m 700 -d %s" % tmpdir)
-
+ chroot.run("set -x; install -m 700 -d %s" % tmpdir, logfile=b.logfile)
b.default_target(config.arch)
# check for build arch before filling BR
cmd = "set -ex; TMPDIR=%(tmpdir)s exec nice -n %(nice)s " \
- "rpmbuild -bp --short-circuit --nodeps %(rpmdefs)s --define 'prep exit 0' rpm/packages/%(package)s/%(spec)s" % {
+ "rpmbuild -bp --short-circuit --nodeps %(rpmdefs)s --define 'prep exit 0' %(topdir)s/%(spec)s" % {
'tmpdir': tmpdir,
'nice' : config.nice,
+ 'topdir' : b.get_topdir(),
'rpmdefs' : b.rpmbuild_opts(),
- 'package' : packagename,
'spec': b.spec,
}
res = chroot.run(cmd, logfile = b.logfile)
if r.max_jobs > 0:
max_jobs = max(min(config.max_jobs, r.max_jobs), 1)
cmd = "set -ex; : build-id: %(r_id)s; TMPDIR=%(tmpdir)s exec nice -n %(nice)s " \
- "rpmbuild -bb --define '_smp_mflags -j%(max_jobs)d' %(rpmdefs)s rpm/packages/%(package)s/%(spec)s" % {
+ "rpmbuild -bb --define '_smp_mflags -j%(max_jobs)d' --define '_make_opts -Otarget' --define '_tld_builder 1' %(rpmdefs)s %(topdir)s/%(spec)s" % {
'r_id' : r.id,
'tmpdir': tmpdir,
'nice' : config.nice,
'rpmdefs' : b.rpmbuild_opts(),
- 'package' : packagename,
+ 'topdir' : b.get_topdir(),
'max_jobs' : max_jobs,
'spec': b.spec,
}
b.log_line("ended at: %s, done in %s" % (time.asctime(), datetime.timedelta(0, end_time - begin_time)))
if res:
res = "FAIL"
- files = util.collect_files(b.logfile)
+ files = util.collect_files(b.logfile, basedir = b.get_topdir())
if len(files) > 0:
r.chroot_files.extend(files)
else:
res = "FAIL_%s" % last_section.upper()
b.files = files
+ # cleanup tmp and build files
chroot.run("""
set -ex;
- rpmbuild %(rpmdefs)s --nodeps --nobuild --clean --rmspec --rmsource rpm/packages/%(package)s/%(spec)s
- rm -rf %(tmpdir)s;
- chmod -R u+rwX rpm/BUILD/%(package)s;
- rm -rf rpm/BUILD/%(package)s;
- """ %
- {'tmpdir' : tmpdir, 'spec': b.spec, 'package' : packagename, 'rpmdefs' : b.rpmbuild_opts()}, logfile = b.logfile)
+ chmod -R u+rwX %(topdir)s/BUILD;
+ rm -rf %(topdir)s/{tmp,BUILD}
+ """ % {
+ 'topdir' : b.get_topdir(),
+ }, logfile = b.logfile)
def ll(l):
util.append_to(b.logfile, l)
)
else:
ll("test-build: not copying to " + rpm_cache_dir)
- ll("Begin-PLD-Builder-Info")
+ ll("Begin-TLD-Builder-Info")
if "upgrade" in r.flags:
b.upgraded = install.upgrade_from_batch(r, b)
else:
ll("not upgrading")
- ll("End-PLD-Builder-Info")
+ ll("End-TLD-Builder-Info")
for f in b.files:
local = r.tmp_dir + os.path.basename(f)
chroot.cp(f, outfile = local, rm = True)
ftp.add(local)
+ # cleanup all remains from this build
+ chroot.run("""
+ set -ex;
+ rm -rf %(topdir)s;
+ """ % {
+ 'topdir' : b.get_topdir(),
+ }, logfile = b.logfile)
+
def uploadinfo(b):
c="file:SRPMS:%s\n" % b.src_rpm
for f in b.files:
f.close()
l.close()
else:
+ # be able to avoid locking with very low priority
+ if req.priority > -1000:
+ # don't kill server
+ check_load()
+ # allow only one build in given builder at once
+ if not lock.lock("building-high-priority-rpm-for-%s" % config.builder, non_block = 1):
+ return
+
msg = "HIGH PRIORITY: "
msg += "handling request %s (%d) for %s from %s, priority %s" \
ftp.add(fname, "uploadinfo")
def build_srpm(r, b):
- if len(b.spec) == 0:
+ if len(b.spec) <= len('.spec'):
# should not really get here
util.append_to(b.logfile, "error: No .spec given but build src.rpm wanted")
return "FAIL"
status.push("building %s" % b.spec)
b.src_rpm = ""
- builder_opts = "-nu -nm --nodeps --http"
- if ("test-build" in r.flags) or b.branch and b.branch.startswith(config.tag_prefixes[0]):
- tag_test=""
+ builder_opts = "-nu -nm --nodeps --http --define \'_tld_builder 1\'"
+ if ("test-build" in r.flags):
+ tag_test=""
else:
- tag_test=" -Tp %s -tt" % (config.tag_prefixes[0],)
- cmd = ("cd rpm/packages; nice -n %s ./builder %s -bs %s -r %s %s %s %s 2>&1" %
+ tag_test=" -Tp %s -tt" % (config.tag_prefixes[0],)
+ cmd = ("cd rpm/packages; nice -n %s ./builder %s -bs %s -r %s %s %s %s %s 2>&1" %
(config.nice, builder_opts, b.bconds_string(), b.branch,
- tag_test, b.kernel_string(), b.spec))
+ tag_test, b.kernel_string(), b.defines_string(), b.spec))
util.append_to(b.logfile, "request from: %s" % r.requester)
util.append_to(b.logfile, "started at: %s" % time.asctime())
util.append_to(b.logfile, "building SRPM using: %s\n" % cmd)
if res == 0 and not "test-build" in r.flags:
for pref in config.tag_prefixes:
util.append_to(b.logfile, "Tagging with prefix: %s" % pref)
- res = chroot.run("cd rpm/packages; ./builder -r %s -Tp %s -Tv --pkgrev %s" % \
- (b.branch, pref, b.spec), logfile = b.logfile)
+ res = chroot.run("cd rpm/packages; ./builder -bs -r %s -Tp %s -Tv --pkgrev %s" % \
+ (b.bconds_string(), b.branch, pref, b.defines_string(), b.spec), logfile = b.logfile)
if res == 0:
transfer_file(r, b)
# FIXME: use python
os.system("rm -f %s/* 2>/dev/null; rmdir %s 2>/dev/null" % (dir, dir))
-def collect_files(log):
+def collect_files(log, basedir = "/home"):
f = open(log, 'r')
- rx = re.compile(r"^Wrote: (/home.*\.rpm)$")
+ rx = re.compile(r"^Wrote: (%s.*\.rpm)$" % basedir)
+ proc = re.compile(r"^Processing (files):.*$")
files = []
- for l in f.xreadlines():
+ for l in reversed(list(f.xreadlines())):
+ if proc.match(l):
+ break
m = rx.search(l)
if m:
files.append(m.group(1))
To: %s
Cc: %s, %s
Date: %s
-X-PLD-Builder: fatal error report
+X-TLD-Builder: fatal error report
%s
umask 077
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/tld-builder.new/"
export BUILDERPATH
if [ -d "$BUILDERPATH" ]; then
#!/bin/sh
-DIST="th"
-DISTTAG="PLD 3.0 (Th)"
+DIST="ti"
+DISTTAG="TLD Linux"
die () {
echo "$0: $*" 1>&2
}
default_config () {
- builder_pkgs="rpm-build poldek pwdutils net-tools which rpm-perlprov rpm-php-pearprov rpm-pythonprov bash vim"
+ builder_pkgs="rpm-build poldek pwdutils net-tools which rpm-perlprov rpm-php-pearprov rpm-pythonprov bash vim util-linux"
builder_uid=`id -u`
- dist_url="ftp://ftp.$DIST.pld-linux.org"
+ dist_url="ftp://ftp.tld-linux.org"
case "$chroot_type" in
src )
[source]
name=main
type=pndir
-path=$dist_url/dists/$DIST/PLD/$arch/RPMS/
+path=$dist_url/TLD/stable/main/$arch/RPMS/
pri=6
[source]
name=main
type=pndir
-path=$dist_url/dists/$DIST/PLD/noarch/RPMS/
+path=$dist_url/TLD/stable/main/noarch/RPMS/
pri=6
EOF
rm -rf rpm
mkdir rpm
cd rpm
-git clone $git_server/rpm-build-tools rpm-build-tools
+git clone $git_server/packages/rpm-build-tools rpm-build-tools
./rpm-build-tools/builder.sh --init-rpm-dir
-echo "%packager PLD bug tracking system ( http://bugs.pld-linux.org/ )">~/.rpmmacros
-echo "%vendor PLD">>~/.rpmmacros
+echo "%packager TLD bug tracking system ( http://bugs.tld-linux.org/ )">~/.rpmmacros
+echo "%vendor TLD">>~/.rpmmacros
echo "%distribution $DISTTAG">>~/.rpmmacros
git config --global user.name $git_user
-git config --global user.email ${git_user}@pld-linux.org
+git config --global user.email ${git_user}@tld-linux.org
EOF
chb "sh" < install-specs
rm install-specs
mkdir rpm
cd rpm
mkdir SPECS SOURCES SRPMS RPMS BUILD
-echo "%packager PLD bug tracking system ( http://bugs.pld-linux.org/ )">~/.rpmmacros
-echo "%vendor PLD">>~/.rpmmacros
+echo "%packager TLD bug tracking system ( http://bugs.tld-linux.org/ )">~/.rpmmacros
+echo "%vendor TLD">>~/.rpmmacros
echo "%distribution $DISTTAG">>~/.rpmmacros
EOF
chb "sh" < install-bt
keep_downloads = no
EOF
-cat > install-$chroot_name.sh <<EOF
+cat > install-$chroot_type.sh <<EOF
#!/bin/sh
set -x
cd $PWD
mkdir -p $chroot_dir/spools/poldek
mkdir $chroot_dir/dev
mknod $chroot_dir/dev/null -m 666 c 1 3
-rpm --root $chroot_dir --initdb
+rpm --root $chroot_dir -qa
poldek --conf poldek.conf --root $chroot_dir --ask -i\
$builder_pkgs $builder_arch_pkgs
EOF
-chmod 755 install-$chroot_name.sh
+chmod 755 install-$chroot_type.sh
echo "About to remove '$chroot_dir' and install it again, using"
-echo "install-$chroot_name.sh:"
+echo "install-$chroot_type.sh:"
echo
-cat install-$chroot_name.sh
+cat install-$chroot_type.sh
echo
cat <<EOF
what to do?
r )
;;
s )
- sudo ./install-$chroot_name.sh
+ sudo ./install-$chroot_type.sh
;;
* )
echo "bye"
keep_downloads = no
EOF
-chr "useradd -u "$builder_uid" -c 'PLD $chroot_name builder' -d /home/users/builder -m -g users -s /bin/sh builder"
+chr "useradd -u "$builder_uid" -c 'TLD $chroot_type builder' -d /home/users/builder -m -g users -s /bin/sh builder"
chr "cat > /etc/resolv.conf" < /etc/resolv.conf
chr "cat > /etc/mtab" < /dev/null
chr "mkdir -p /spools/ready/" < /dev/null
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
cd $BUILDERPATH
-exec python PLD_Builder/file_sender.py
+exec python TLD_Builder/file_sender.py
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
cd $BUILDERPATH
-exec python PLD_Builder/load_balancer.py
+exec python TLD_Builder/load_balancer.py
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
cd $BUILDERPATH
-exec python PLD_Builder/maintainer.py
+exec python TLD_Builder/maintainer.py
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
cd $BUILDERPATH
-exec python PLD_Builder/request_fetcher.py
+exec python TLD_Builder/request_fetcher.py
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
if lockfile -r3 $HOME/.builder_request_handler.lock 2>/dev/null; then
trap "rm -f $HOME/.builder_request_handler.lock" 1 2 3 13 15
cd $BUILDERPATH
- python PLD_Builder/request_handler.py
+ python TLD_Builder/request_handler.py
rm -f $HOME/.builder_request_handler.lock
else
return 1
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
cd $BUILDERPATH
-exec python PLD_Builder/rpm_builder.py $1
+exec python TLD_Builder/rpm_builder.py $1
umask 022
export LC_CTYPE=en_US.iso-8859-1
-CONFIG=$HOME/.pldbuilderrc
+CONFIG=$HOME/.tldbuilderrc
[ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+ dir=$(dirname "$0")
+ BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
export BUILDERPATH
cd $BUILDERPATH
-exec python PLD_Builder/srpm_builder.py
+exec python TLD_Builder/srpm_builder.py
#!/bin/sh
+# vim:noet:ts=4:sw=4
+VERSION=1.89
# prevent "*" from being expanded in builders var
set -f
no_depend=no
verbose=no
autotag=no
+requester_override=
+relup=no
if [ -x /usr/bin/python ]; then
send_mode="python"
echo "Creating config file $USER_CFG. You *must* edit it."
cat > $USER_CFG <<EOF
priority=2
-requester=deviloper@pld-linux.org
-default_key=deviloper@pld-linux.org
+requester=deviloper@tld-linux.org
+default_key=deviloper@tld-linux.org
send_mode="$send_mode"
url="$url"
-mailer="/usr/sbin/sendmail -t"
+mailer="/usr/lib/sendmail -t"
gpg_opts=""
-dist=th
-url="http://src.th.pld-linux.org:1234/"
+dist=ti
+url="http://kraz.tld-linux.org:1231/"
# defaults:
f_upgrade=yes
specs=
df_fetch=no
upgrade_macros=no
+upgrade_scripts=no
+cr=$(printf "\r")
# Set colors
c_star=$(tput setaf 2)
# switch to mail mode, if no url set
[ -z "$url" ] && send_mode="mail"
+ if [ -n "$wait" ]; then
+ msg "Waiting $wait seconds before sending request"
+ sleep $wait
+ msg "Wait has ended, proceeding!"
+ fi
+
case "$send_mode" in
"mail")
msg "Sending using mail mode"
cat - | $mailer
;;
*)
- msg "Sending using http mode to $url"
+ msg "Sending using HTTP mode to $url"
cat - | python -c '
import sys, socket, urllib2
try:
data = sys.stdin.read()
url = sys.argv[1]
- socket.setdefaulttimeout(10)
+ socket.setdefaulttimeout(30)
req = urllib2.Request(url, data)
f = urllib2.urlopen(req)
f.close()
esac
}
+# htmlspecialchars: escape <, > and &
+hsc() {
+ local input=$1
+ echo -E "$input" | sed -e 's,&,\&,g;s,<,\<,g;s,>,\>,g'
+}
+
# simple df_fetcher, based on packages/fetchsrc_request
# TODO: tcp (smtp) mode
# TODO: adjust for ~/.requestrc config
local specs="$@"
# Sending by
- local MAILER='/usr/sbin/sendmail'
+ local MAILER='/usr/lib/sendmail'
# MAILER='/usr/bin/msmtp'
# Sending via
local VIA="SENDMAIL"
# VIA_ARGS='-a gmail'
#
# DISTFILES EMAIL
- local DMAIL="distfiles@pld-linux.org"
+ local DMAIL="df@tld-linux.org"
local HOST=$(hostname -f)
local LOGIN=${requester%@*}
+ local SPEC BRANCH
for spec in $specs; do
- local SPEC=$(echo "$spec" | sed -e 's|:.*||')
- local BRANCH=$(echo "$spec" | sed -e 's|.*:||')
+ SPEC=$(echo "$spec" | sed -e 's|:.*||')
+ SPEC=${SPEC%.spec}
+ BRANCH=$(echo "$spec" | sed -e 's|.*:||')
echo >&2 "Distfiles Request: $SPEC:$BRANCH via $MAILER ${VIA_ARGS:+ ($VIA_ARGS)}"
cat <<-EOF | "$MAILER" -t -i $VIA_ARGS
To: $DMAIL
From: $LOGIN <$LOGIN@$HOST>
Subject: fetchsrc_request notify
- X-CVS-Module: SPECS
X-distfiles-request: yes
X-Login: $LOGIN
- X-Spec: $SPEC
+ X-Package: $SPEC
X-Branch: $BRANCH
X-Flags: force-reply
s=${s%:*}
# ensure package ends with .spec
s=${s%.spec}.spec
- out=$(cvs status -v $s | awk "!/Sticky/&&/auto-$dist-/{if (!a++) print \$1}")
+ git fetch --tags
+ out=$(git for-each-ref --count=1 --sort=-authordate refs/tags/auto/$dist \
+ --format='%(refname:short)')
echo "$s:$out"
done
}
# get autotag for specs
-# WARNING: This may checkout some files from CVS
+# WARNING: This may checkout some files from VCS
get_autotag() {
local pkg spec rpmdir
rpmdir=$(rpm -E %_topdir)
- cd $rpmdir
for pkg in "$@"; do
+ cd $rpmdir
# strip branches
pkg=${pkg%:*}
# strip .spec extension
# just print it out, to fallback to base pkg name
echo "$pkg"
else
- autotag $pkg/$pkg.spec
+ cd $pkg
+ autotag $pkg.spec
fi
done
}
+relup() {
+ local script=$(dirname $(rpm -E %_topdir))/rpm-build-tools/relup.sh
+ $script -u -i "$@"
+}
+
usage() {
cat <<EOF
Usage: make-request.sh [OPTION] ... [SPECFILE] ....
set alt_kernel to VALUE
--target VALUE
set --target to VALUE
+ -D "NAME VALUE"|--define "NAME VALUE"
+ define macro named NAME with value VALUE
-s BUILD_ID, --skip BUILD_ID[,BUILD_ID][,BUILD_ID]
- mark build ids on src builder to be skipped
+ mark build ids on src builder to be skipped (instructs srcbuilder to create 'skipme' file)
--branch VALUE
specify default branch for specs in request
-t, --test-build
(and later moved by release manager staff to ready/ and main ftp tree)
-u, --upgrade
Forces package upgrade (for use with -c or -q, not -t)
+ --relup
+ Bump package release, see also --relup
+ -m, --message
+ Set commit message for relup
-n, --no-upgrade
Disables package upgrade (for use with -r)
-ni, --no-install-br
Updates builders infrastructure (outside chroot)
--update-macros
Updates rpm-build-macros on src builder
+ --update-scripts
+ Updates ~/rpm/rpm-build-tools on builder
+ --requester username
+ Override the requester
-q
shortcut for --command rpm -q ARGS
-g, --gpg-opts "opts"
Pass additional options to gpg binary
-p, --priority VALUE
sets request priority (default 2)
+ -w SECONDS
+ Wait SECONDS before sending actual request. Note: gpg passphrase is still asked immediately.
+ This may be useful if you just commited package and want to send it
+ for test build after distfiles has fetched the file.
-h, --help
Displays this help message
+ -v
+ Verbose. Print some more debug on screen
EOF
exit 0
}
# validate distro, set $dist
set_dist() {
case "$1" in
- ac)
- ;;
- ac-java|ac-xen)
- ;;
ti)
;;
ti-dev)
;;
- th)
- ;;
- th-java)
- ;;
- aidath)
- ;;
*)
die "dist \`$1' not known"
;;
dist=$1
}
-while [ $# -gt 0 ] ; do
+while [ $# -gt 0 ]; do
case "$1" in
-d | --dist | --distro)
set_dist $2
autotag=yes
;;
+ -m)
+ shift
+ message=$1
+ ;;
+
+ --relup)
+ relup=yes
+ ;;
+
--with)
with="$with $(echo "$2" | tr ',' ' ')"
shift
shift
;;
+ -D|--define)
+ value=${2#* }
+ name=${2%% *}
+ define="$define$cr$name=$value"
+ shift
+ ;;
+
-s|--skip)
skip="$2"
shift
jobs="${1#-j}"
;;
+ -w)
+ wait="$2"
+ shift
+ ;;
+
-v)
verbose=yes
;;
upgrade_macros="yes"
;;
+ --update-scripts)
+ upgrade_scripts='yes'
+ ;;
+
-df | --distfiles-fetch | --distfiles-fetch-request)
df_fetch=yes
;;
usage
;;
+ --requester)
+ requester_override="$2"
+ shift
+ ;;
+
-*)
die "unknown knob: $1"
;;
done
case "$dist" in
-ac)
- builder_email="builder-ac@pld-linux.org"
- default_builders="ac-*"
- default_branch="AC-branch"
- url="http://ep09.pld-linux.org:1289/"
- control_url="http://ep09.pld-linux.org/~buildsrc"
- ;;
-ac-java) # fake "dist" for java available ac architectures
- builder_email="builder-ac@pld-linux.org"
- default_builders="ac-i586 ac-i686 ac-athlon ac-amd64"
- default_branch="AC-branch"
- url="http://ep09.pld-linux.org:1289/"
- ;;
-ac-xen) # fake "dist" for xen-enabled architectures
- builder_email="builder-ac@pld-linux.org"
- default_builders="ac-i686 ac-athlon ac-amd64"
- default_branch="AC-branch"
- ;;
ti)
builder_email="builderti@kraz.tld-linux.org"
default_builders="ti-*"
url="http://kraz.tld-linux.org:1232/"
control_url="http://kraz.tld-linux.org/~buildertidev"
;;
-th)
- builder_email="builderth@pld-linux.org"
- default_builders="th-*"
- url="http://src.th.pld-linux.org:1234/"
- control_url="http://src.th.pld-linux.org"
- ;;
-th-java) # fake "dist" for java available th architectures
- builder_email="builderth@pld-linux.org"
- default_builders="th-x86_64 th-athlon th-i686"
- url="http://src.th.pld-linux.org:1234/"
- ;;
-aidath)
- builder_email="builderaidath@ep09.pld-linux.org"
- default_builders="aidath-*"
- ;;
*)
die "dist \`$dist' not known"
;;
# skip marker - pass it along
echo $s
;;
- *.spec:*) # spec with branch
- echo $s
- ;;
- *.spec) # spec without branch
- echo $(basename $s):$branch
- ;;
*:*) # package name with branch
- echo $s | sed -e 's/:/.spec:/'
+ _specfile=$(basename ${s%:*})
+ echo ${_specfile%.spec}.spec:${s##*:}
;;
*) # just package name
- echo $(basename $s).spec:$branch
+ echo $(basename ${s%.spec}).spec:$branch
;;
esac
done`
+if [ "$relup" = "yes" ]; then
+ msg "Auto relup enabled"
+ relup ${message:+-m "$message"} $specs
+fi
+
if [ "$autotag" = "yes" ]; then
msg "Auto autotag build enabled"
specs=$(get_autotag $specs)
build_mode=test
fi
+if [ "$upgrade_scripts" = "yes" ]; then
+ command="cd ~/rpm/rpm-build-tools && git pull"
+ command_flags=as-builder
+ builders="$dist-src"
+ f_upgrade=no
+ build_mode=test
+fi
+
if [[ "$requester" != *@* ]] ; then
- requester="$requester@pld-linux.org"
+ requester="$requester@tld-linux.org"
fi
if [ -z "$builders" ] ; then
msg "Build mode: $(tput setaf 3)$build_mode$c_norm"
fi
+ if [ -n "$requester_override" ] ; then
+ echo " <requester>$requester_override</requester>"
+ fi
+
msg "Queue-ID: $id"
echo
# job to depend on
local depend=
- local b i=1
+ local b i=1 val
local name branch builders_xml
for b in $builders; do
echo -E >&2 "* Command: $command"
echo " <batch id='$bid' depends-on=''>"
echo " <command flags='$command_flags'>"
- echo -E "$command" | sed -e 's,&,\&,g;s,<,\<,g;s,>,\>,g'
+ hsc "$command"
echo "</command>"
echo " <info></info>"
echo "$builders_xml"
echo " <branch>$branch</branch>"
echo " ${kernel:+<kernel>$kernel</kernel>}"
echo " ${target:+<target>$target</target>}"
+
+ oIFS=$IFS; IFS=$cr
+ for b in $define; do
+ [ -z "$b" ] && continue
+ value=${b#*=}
+ b=${b%%=*}
+ echo " <define name='$(hsc $b)'>$(hsc "$value")</define>"
+ msg "- define $b=$value"
+ done
+ IFS=$oIFS
+
echo " <info></info>"
echo
for b in $with; do
echo -E >&2 "* Post-Command: $post_command"
echo " <batch id='$bid' depends-on='$depend'>"
echo " <command flags='$command_flags'>"
- echo -E "$post_command" | sed -e 's,&,\&,g;s,<,\<,g;s,>,\>,g'
+ hsc "$post_command"
echo "</command>"
echo " <info></info>"
echo "$builders_xml"
To: $builder_email
Subject: build request
Message-Id: <$id@$(hostname)>
- X-New-PLD-Builder: request
- X-Requester-Version: \$Id$
+ X-New-TLD-Builder: request
+ X-Requester-Version: $VERSION
EOF
server = smtplib.SMTP(smtp_host)
# server.set_debuglevel(1)
-server.sendmail("matkor@pld-linux.org","builder-ac@pld-linux.org", msg) # Adresses should be taken from .requestrc
+server.sendmail("ti-admins@tld-linux.org","builder-src@tld-linux.org", msg) # Adresses should be taken from .requestrc
server.quit()
#
-# Access Control Lists for PLD builder
+# Access Control Lists for TLD builder
#
# Format:
#
# sense). Lowest priority allowe will be 3.
#
# [foo]
-# gpg_emails = foo@pld-linux.org Foo.Bar@blah.com
+# gpg_emails = foo@tld-linux.org Foo.Bar@blah.com
# mailto foo-builder@blah.com
# privs = src:src !binary:security-* binary:* 3:*
#
privs = sign_queue:* notify:*
[malekith]
-gpg_emails = malekith@pld-linux.org
+gpg_emails = malekith@tld-linux.org
mailto = malekith@roke.freak
privs = src:roke-src binary:roke-*:AC-branch
[all]
# Builder email (put in From: field when this builder is sending mails).
-email = builder-th@pld-linux.org
+email = builder-src@tld-linux.org
# Admin's email (she gets mails about errors and such).
-admin_email = th-admin@pld-linux.org
+admin_email = ti-admins@tld-linux.org
# To be placed in Cc: of status and error reports (a mailing list usually).
builder_list =
# List of binary builders. This thing must be present on both src and bin
# builders.
-binary_builders = th-athlon
+binary_builders = ti-i686 ti-x86_64
# Name of the src builder (this field is ignored on binary builders).
-src_builder = th-src
+src_builder = ti-src
# Logs always go to spool/log, if you want syslog in addition,
# specify facility here (user or local0-7 is the best choice probably).
max_keep_time = 168
# TCP port number for request_handler_server.py. ignored on bin builders
-request_handler_server_port = 1234
+request_handler_server_port = 1231
-# Send '*.uploadinfo' files along with built rpms (used by pld-ftp-admin), but
+# Send '*.uploadinfo' files along with built rpms (used by tld-ftp-admin), but
# probably not usefull for small, 'personal' builders. [yes/no]
gen_upinfo = yes
# CIA bot (see cia.navi.cx).
-#bot_email = cia@pld-linux.org
+#bot_email = cia@tld-linux.org
# ------ Binary builders config:
# How many jobs can be run at once (how many concurrent builds).
#nice = 0
# Where to look for queue.gz and counter (published through www by src builder).
-control_url = http://src.th.pld-linux.org/
+control_url = http://kraz.tld-linux.org/~builderti/
# Src builder's email for sending status notifications (build ok/failed).
-#notify_email = builder-th-src@pld-linux.org
+#notify_email = builder-src@tld-linux.org
# Where to cache rpm's from binary builders locally
rpm_cache_dir = /spools/ready
# ------ SRC builder config:
# List of name-version-release tag prefixes.
-#tag_prefixes = auto- auto-ac- auto-th-
-tag_prefixes = auto-th-
+tag_prefixes = auto/ti/
# ------ Configs for particular builders:
-[th-src]
+[ti-src]
arch = i686
-chroot = /home/pld/builderth/chroots/chroot-src/
-buildlogs_url = rsync://blogs-th@buildlogs.pld-linux.org/pld-buildlogs-th-SRPMS/
-ftp_url = scp://pldth@ep09.pld-linux.org:ftp/.incoming/SRPMS/
-notify_url = http://src.th.pld-linux.org:1234/
-test_ftp_url = scp://pldth@ep09.pld-linux.org:ftp/.test-builds/SRPMS/
-rpmqa_url = scp://pldth@ep09.pld-linux.org:ftp/.stat/builder/th/
+chroot = /home/tld/builderti/chroots/chroot-src/
+buildlogs_url = rsync://buildlogs-ti@buildlogs.tld-linux.org/buildlogs-ti-src/
+ftp_url = scp://ftpti@kraz.tld-linux.org:ftp/.incoming/SRPMS/
+notify_url = http://kraz.tld-linux.org:1231/
+test_ftp_url = scp://ftpti@kraz.tld-linux.org:ftp/.test-builds/SRPMS/RPMS/
+rpmqa_url = scp://ftpti@kraz.tld-linux.org:ftp/.stat/builder/ti/
rpmqa_filename = rpmqa-SRPMS.txt
-
-[th-athlon]
-arch = athlon
-chroot = /home/users/builderth/chroot-athlon/
-buildlogs_url = /dev/null
-notify_url = http://src.th.pld-linux.org:1234/
-ftp_url = scp://pldth@ep09.pld-linux.org:ftp/.incoming/athlon/
-test_ftp_url = /dev/null
-rpmqa_url = /dev/null
-rpmqa_filename = nothing
-
-
Makefile -- nothing interesting.
- PLD_Builder/ -- all python stuff live here.
+ TLD_Builder/ -- all python stuff live here.
admin/ -- scripts for chroot admin.
packages and chroot
~~~~~~~~~~~~~~~~~~~
-1. install pld-builder from th repoeistory on target host
+1. install pld-builder from th repoistory on target host
2. create chroot /srv/chroot
(you can symlink to real dest for the sake of copy-paste from here)
1. import src builder key to bin builder so it can download queue.gz
src-builder$ gpg --export builder-th-src@pld-linux.org --armor > th-src.asc
+bin-builder$ su - builder
bin-builder$ gpg --import < th-src.asc
2. generate new key for bin builder and import it to src builder so it can
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
-#* * * * * builder exec nice -n 19 /usr/share/pld-builder/bin/request-fetcher.sh
-#* * * * * builder exec nice -n 19 /usr/share/pld-builder/bin/load-balancer.sh
-#* * * * * builder exec nice -n 19 /usr/share/pld-builder/bin/file-sender.sh
+#* * * * * builder exec nice -n 19 /usr/share/tld-builder/bin/request-fetcher.sh
+#* * * * * builder exec nice -n 19 /usr/share/tld-builder/bin/load-balancer.sh
+#* * * * * builder exec nice -n 19 /usr/share/tld-builder/bin/file-sender.sh
-#0 0 * * * root chroot /srv/chroot nice -n 19 tmpwatch -m 240 /var/cache/pld-builder/ready
+#0 0 * * * root chroot /srv/chroot nice -n 19 tmpwatch -m 240 /var/cache/tld-builder/ready
+++ /dev/null
-# define chroots whose /proc to mount on startup
-
-#CHROOTS=/srv/builders/pld/{ac/{athlon,i586},actw/{athlon,i586},th/{athlon,i486}}
name = ready
pri = -1
type = dir
-path = /var/cache/pld-builder/ready/
+path = /var/cache/tld-builder/ready/
autoup = no
#mail.copy
:0
-* ^X-New-PLD-Builder:
-| /usr/share/pld-builder/bin/request-handler.sh
+* ^X-New-TLD-Builder:
+| /usr/share/tld-builder/bin/request-handler.sh
:0
* ^FROM_MAILER
-# rpm macros for pld builder chroot
+# rpm macros for tld builder chroot
# A colon separated list of desired locales to be installed;
# "all" means install all locale specific files.
#!/bin/sh
#
-# pld-builder perform adminstrator's tasks for PLD Linux Builder
+# tld-builder perform adminstrator's tasks for TLD Linux Builder
#
# chkconfig: 345 99 01
#
-# description: perform adminstrator's tasks for PLD Linux Builder
+# description: perform adminstrator's tasks for TLD Linux Builder
#
# $Id$
CHROOTS=
# Get service config - may override defaults
-[ -f /etc/sysconfig/pld-builder ] && . /etc/sysconfig/pld-builder
+[ -f /etc/sysconfig/tld-builder ] && . /etc/sysconfig/tld-builder
mount_chroots() {
# mount /proc in chroots
start() {
# Check if the service is already running?
- if [ -f /var/lock/subsys/pld-builder ]; then
- msg_already_running "PLD Linux Builder"
+ if [ -f /var/lock/subsys/tld-builder ]; then
+ msg_already_running "TLD Linux Builder"
return
fi
# no chroots configured. return and be silent
return
fi
- msg_starting "PLD Linux Builder"
+ msg_starting "TLD Linux Builder"
busy; echo
mount_chroots
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pld-builder
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tld-builder
}
stop() {
- if [ ! -f /var/lock/subsys/pld-builder ]; then
- msg_not_running "PLD Linux Builder"
+ if [ ! -f /var/lock/subsys/tld-builder ]; then
+ msg_not_running "TLD Linux Builder"
return
fi
# Stop daemons.
- msg_stopping "PLD Linux Builder"
+ msg_stopping "TLD Linux Builder"
busy; echo
umount_chroots
- rm -f /var/lock/subsys/pld-builder >/dev/null 2>&1
+ rm -f /var/lock/subsys/tld-builder >/dev/null 2>&1
RETVAL=0
}
condrestart() {
- if [ ! -f /var/lock/subsys/pld-builder ]; then
- msg_not_running "PLD Linux Builder"
+ if [ ! -f /var/lock/subsys/tld-builder ]; then
+ msg_not_running "TLD Linux Builder"
RETVAL=$1
return
fi
2) proper dates with http://www.djkaty.com/drupal/xsl-date-time -->
<xsl:template match="/queue">
-<html><head><title>PLD builder queue</title></head><body>
+<html><head><title>TLD builder queue</title></head><body>
<xsl:for-each select="group">
<xsl:sort select="@no" order="descending"/>
<p><b><xsl:value-of select="@no"/></b>. <xsl:value-of select="time"/> from <xsl:value-of select="requester"/><xsl:text> </xsl:text><small><xsl:value-of select="@id"/>, <xsl:value-of select="priority"/>, <xsl:value-of select="@flags"/></small><br/>