From 1847db5a5f81b438a5bd5e0fb4376fb31d3696db Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Tue, 7 Oct 2008 19:41:26 +0000 Subject: [PATCH] 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 3e1620de..2ec5c511 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2008-10-05 Thomas Viehmann * daklib/database.py: added get_suites + * dak/dak.py, dak/show_deferred.py: add show-deferred to dak. 2008-09-23 Joerg Jaspert diff --git a/dak/dak.py b/dak/dak.py index 5a986d55..c987c1e7 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 6c811797..70468b5a 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) -- 2.39.5