]> git.decadent.org.uk Git - dak.git/commitdiff
move show-deferred to dak
authorThomas Viehmann <tv@beamnet.de>
Tue, 7 Oct 2008 19:41:26 +0000 (19:41 +0000)
committerThomas Viehmann <tv@beamnet.de>
Tue, 7 Oct 2008 19:41:26 +0000 (19:41 +0000)
ChangeLog
dak/dak.py
dak/show_deferred.py

index 3e1620de363e2a6cc4918dd8c44945a07ba83ac7..2ec5c511f767b6381e715031b6699d4fd4211004 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-10-05  Thomas Viehmann <tv@beamnet.de>
 
         * daklib/database.py: added get_suites
+       * dak/dak.py, dak/show_deferred.py: add show-deferred to dak.
        
 2008-09-23  Joerg Jaspert  <joerg@debian.org>
 
index 5a986d55ef39cb11b20bef0246c97a36d9d43967..c987c1e708601db9442b8ac9d1ba240915bc9f05 100755 (executable)
@@ -88,6 +88,8 @@ def init():
          "Produce a report on NEW and BYHAND packages"),
         ("show-new",
          "Output html for packages in NEW"),
+        ("show-deferred",
+         "Output html and symlinks for packages in DEFERRED"),
 
         ("rm",
          "Remove packages from suites"),
index 6c811797357fd49401ee3d723a6cd1b7bd72b7f9..70468b5a9a6a31efaa143599679c68813e433c9f 100755 (executable)
@@ -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):
@@ -187,21 +188,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)