From d1e8206ce62c7e996cc8bfd32ef63df2abc24c42 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Tue, 10 Jul 2012 16:57:00 +0200 Subject: [PATCH] - TLDize --- PLD_Builder/bqueue.py | 4 ++-- PLD_Builder/cia-head.xml | 8 ++++---- PLD_Builder/request.py | 33 +++++++++++++-------------------- xml/queue.xsd | 4 ++-- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/PLD_Builder/bqueue.py b/PLD_Builder/bqueue.py index aff32e9..2a4d759 100644 --- a/PLD_Builder/bqueue.py +++ b/PLD_Builder/bqueue.py @@ -40,8 +40,8 @@ class B_Queue: f.write(""" - - PLD builder queue + + TLD builder queue diff --git a/PLD_Builder/cia-head.xml b/PLD_Builder/cia-head.xml index 2bf3ac0..fefeda5 100644 --- a/PLD_Builder/cia-head.xml +++ b/PLD_Builder/cia-head.xml @@ -1,12 +1,12 @@ - PLD Linux Builder client for CIA + TLD Linux Builder client for CIA 0.001 - http://cvs.pld-linux.org/pld-builder.new/PLD_Builder/report.py + http://git.tld-linux.org/?p=pld-builder.new.git;a=blob;f=PLD_Builder/report.py - pld - Ac + tld + master diff --git a/PLD_Builder/request.py b/PLD_Builder/request.py index 0731df8..d4a35dd 100644 --- a/PLD_Builder/request.py +++ b/PLD_Builder/request.py @@ -13,6 +13,7 @@ import util import log from acl import acl from config import config +from subprocess import call __all__ = ['parse_request', 'parse_requests'] @@ -35,21 +36,6 @@ def attr(e, a, default = None): def escape(s): return xml.sax.saxutils.escape(s) -# return timestamp with timezone information -# so we could parse it in javascript -def tzdate(t): - # as strftime %z is unofficial, and does not work, need to make it numeric ourselves -# date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t)) - date = time.strftime("%a %b %d %Y %H:%M:%S", time.localtime(t)) - # NOTE: the altzone is showing CURRENT timezone, not what the "t" reflects - # NOTE: when DST is off timezone gets it right, altzone not - if time.daylight: - tzoffset = time.altzone - else: - tzoffset = time.timezone - tz = '%+05d' % (-tzoffset / 3600 * 100) - return date + ' ' + tz - def is_blank(e): return e.nodeType == Element.TEXT_NODE and string.strip(e.nodeValue) == "" @@ -116,7 +102,7 @@ class Group: % { 'no': self.no, 'id': '%(id)s' % {'id': self.id}, - 'time': escape(tzdate(self.time)), + 'time': escape(time.strftime("%a %b %d %Y %H:%M:%S %z", time.localtime(self.time))), 'requester': escape(self.requester), 'priority': self.priority, 'max_jobs': self.max_jobs, @@ -235,7 +221,14 @@ class Batch: if self.is_command(): desc = "SH:
%s
flags: [%s]" % (self.command, ' '.join(self.command_flags)) else: - package_url = "http://git.pld-linux.org/gitweb.cgi?p=packages/%(package)s.git;f=%(spec)s;h=%(branch)s;a=shortlog" % { + cmd = "/usr/bin/git ls-remote --heads git://git.tld-linux.org/packages/%s" % (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], @@ -276,8 +269,8 @@ class Batch: bld = lin_ar.split('-') tree_name = '-'.join(bld[:-1]) tree_arch = '-'.join(bld[-1:]) - link_pre = "" \ - % (urllib.quote(tree_name), urllib.quote(tree_arch), is_ok, urllib.quote(bl_name), urllib.quote(rid)) + link_pre = "" \ + % (urllib.quote(tree_name), urllib.quote(tree_arch), urllib.quote(bl_name), urllib.quote(rid)) link_post = "" def ftime(s): @@ -334,7 +327,7 @@ class Batch: return r def default_target(self, arch): - self.target.append("%s-pld-linux" % arch) + self.target.append("%s-tld-linux" % arch) def write_to(self, f): f.write(""" diff --git a/xml/queue.xsd b/xml/queue.xsd index cfeeb53..bdad8f2 100644 --- a/xml/queue.xsd +++ b/xml/queue.xsd @@ -1,7 +1,7 @@ -- 2.46.0