[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] move show-deferred to dak



---
 ChangeLog            |    1 +
 dak/dak.py           |    2 ++
 dak/show_deferred.py |   40 +++++++++++++++++++++-------------------
 3 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3e1620d..2ec5c51 100644
--- 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>
 
diff --git a/dak/dak.py b/dak/dak.py
index 5a986d5..c987c1e 100755
--- a/dak/dak.py
+++ b/dak/dak.py
@@ -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"),
diff --git a/dak/show_deferred.py b/dak/show_deferred.py
index 6c81179..70468b5 100755
--- a/dak/show_deferred.py
+++ b/dak/show_deferred.py
@@ -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)
-- 
1.5.6.5



Reply to: