]> TLD Linux GIT Repositories - tld-builder.git/commitdiff
- TLDize
authorMarcin Krol <hawk@tld-linux.org>
Tue, 10 Jul 2012 14:57:00 +0000 (16:57 +0200)
committerMarcin Krol <hawk@tld-linux.org>
Tue, 10 Jul 2012 14:57:00 +0000 (16:57 +0200)
PLD_Builder/bqueue.py
PLD_Builder/cia-head.xml
PLD_Builder/request.py
xml/queue.xsd

index aff32e90b50b042eae8f02a044cb990ce477d6d2..2a4d759aeba3bf4c950ff2b73562a5662facd6dc 100644 (file)
@@ -40,8 +40,8 @@ class B_Queue:
         f.write("""
 <html>
     <head>
-    <link rel="Shortcut Icon" href="http://www.pld-linux.org/favicon.ico"/>
-        <title>PLD builder queue</title>
+    <link rel="Shortcut Icon" href="http://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 type="text/javascript" src="script.js"></script>
     </head>
index 2bf3ac0c10fcb6c0ef9e8131af4e03122b9e901e..fefeda5d74120cee5f5343a42c12f5d9700503c7 100644 (file)
@@ -1,12 +1,12 @@
 <message>
     <generator>
-        <name>PLD Linux Builder client for CIA</name>
+        <name>TLD Linux Builder client for CIA</name>
        <version>0.001</version>
-       <url>http://cvs.pld-linux.org/pld-builder.new/PLD_Builder/report.py</url>
+       <url>http://git.tld-linux.org/?p=pld-builder.new.git;a=blob;f=PLD_Builder/report.py</url>
     </generator>
     <source>
-        <project>pld</project>
-       <branch>Ac</branch>
+        <project>tld</project>
+       <branch>master</branch>
     </source>
     <body>
         <builder>
index 0731df8e8694b9297cc98a9ec6dde5d8e19586da..d4a35dd839dcd1c9d46874325fe7d39ade620fc7 100644 (file)
@@ -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': '<a href="srpms/%(id)s">%(id)s</a>' % {'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: <pre>%s</pre> 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 = "<a href=\"http://buildlogs.pld-linux.org/index.php?dist=%s&arch=%s&ok=%d&name=%s&id=%s&action=tail\">" \
-                        % (urllib.quote(tree_name), urllib.quote(tree_arch), is_ok, 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):
@@ -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("""
index cfeeb53322fe7e99c8cc62261b1aaf4f26de67ce..bdad8f295e0dfd59f355ed896b2474b047580a8d 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-targetNamespace="http://pld-linux.org"
-xmlns="http://pld-linux.org"
+targetNamespace="http://tld-linux.org"
+xmlns="http://tld-linux.org"
 elementFormDefault="qualified">
 
 <xs:element name="queue">