]> git.decadent.org.uk Git - dak.git/blobdiff - dak/show_deferred.py
move config to config
[dak.git] / dak / show_deferred.py
index 6c811797357fd49401ee3d723a6cd1b7bd72b7f9..81c117b148e64c3c9b9b1fee844188720c2a7d1e 100755 (executable)
@@ -98,7 +98,7 @@ def table_header():
     return res
 
 def table_footer():
-    return '</table><br/><p>non-NEW uploads are <a href="/deferred/">available</a>, use <tt>dcut reschedule foo.changes X-day</tt> to adjust delays.</p></center><br/>\n'
+    return '</table><br/><p>non-NEW uploads are <a href="/deferred/">available</a>, see the <a href="ftp://ftp-master.debian.org/pub/UploadQueue/README">UploadQueue-README</a> for more information.</p></center><br/>\n'
 
 def table_row(changesname, delay, changed_by, closes):
     global row_number
@@ -142,8 +142,9 @@ def get_upload_data(changesfn):
                 qfn = os.path.join(os.path.dirname(changesfn),afn)
                 if os.path.islink(lfn):
                     os.unlink(lfn)
-                os.symlink(qfn,lfn)
-                os.chmod(qfn, 0644)
+                if os.path.exists(qfn):
+                    os.symlink(qfn,lfn)
+                    os.chmod(qfn, 0644)
     return (delaydays*24*60*60+remainingtime, changesname, delay, uploader, achanges.get('closes').split())
 
 def list_uploads(filelist):
@@ -175,10 +176,8 @@ def init():
     Arguments = [('h',"help","Show-Deferred::Options::Help"),
                  ("p","link-path","Show-Deferred::LinkPath","HasArg")]
     for i in ["help"]:
-        if not Cnf.has_key("Show-Deferred::Options::LinkPath"):
-            Cnf["Show-Deferred::Options::LinkPath"] = "/org/ftp.debian.org/web/deferred/"
-    if not Cnf.has_key("Show-Deferred::Options::%s" % (i)):
-          Cnf["Show-Deferred::Options::%s" % (i)] = ""
+        if not Cnf.has_key("Show-Deferred::Options::%s" % (i)):
+            Cnf["Show-Deferred::Options::%s" % (i)] = ""
     args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
     Options = Cnf.SubTree("Show-Deferred::Options")
     if Options["help"]:
@@ -187,21 +186,22 @@ def init():
     projectB = Upload.projectB
     return args
 
-args = init()
-if len(args)!=1:
-    usage(1)
+def main():
+    args = init()
+    if len(args)!=1:
+        usage(1)
     
-filelist = []
-for r,d,f  in os.walk(args[0]):
-    filelist += map (lambda x: os.path.join(r,x),
-                     filter(lambda x: x.endswith('.changes'), f))
-list_uploads(filelist)
-
-if Cnf.has_key("Show-Deferred::LinkPath"):
-    # remove dead links
-    for r,d,f in os.walk(Cnf["Show-Deferred::LinkPath"]):
-        for af in f:
-            af = os.path.join(r,af)
-            if not os.path.exists(af):
-                print >> sys.stderr, "obsolete",af
-                os.unlink(af)
+    filelist = []
+    for r,d,f  in os.walk(args[0]):
+        filelist += map (lambda x: os.path.join(r,x),
+                         filter(lambda x: x.endswith('.changes'), f))
+    list_uploads(filelist)
+
+    if Cnf.has_key("Show-Deferred::LinkPath"):
+        # remove dead links
+        for r,d,f in os.walk(Cnf["Show-Deferred::LinkPath"]):
+            for af in f:
+                af = os.path.join(r,af)
+                if not os.path.exists(af):
+                    print >> sys.stderr, "obsolete",af
+                    os.unlink(af)