]> git.decadent.org.uk Git - dak.git/commitdiff
dak/generate_releases.py: add archive option
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 11 Aug 2012 11:41:52 +0000 (13:41 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 11 Aug 2012 11:43:48 +0000 (13:43 +0200)
dak/generate_releases.py

index a57c5fc22143047628dd87dd1c1d440064899c6e..fe843efa73831e1c5eecdc3651b0d4ef8acde087 100755 (executable)
@@ -60,6 +60,7 @@ def usage (exit_code=0):
     print """Usage: dak generate-releases [OPTIONS]
 Generate the Release files
 
+  -a, --archive=ARCHIVE      process suites in ARCHIVE
   -s, --suite=SUITE(s)       process this suite
                              Default: All suites not marked 'untouchable'
   -f, --force                Allow processing of untouchable suites
@@ -297,6 +298,7 @@ def main ():
             cnf["Generate-Releases::Options::%s" % (i)] = ""
 
     Arguments = [('h',"help","Generate-Releases::Options::Help"),
+                 ('a','archive','Generate-Releases::Options::Archive','HasArg'),
                  ('s',"suite","Generate-Releases::Options::Suite"),
                  ('f',"force","Generate-Releases::Options::Force"),
                  ('o','option','','ArbItem')]
@@ -321,7 +323,10 @@ def main ():
                 print "cannot find suite %s" % s
                 Logger.log(['cannot find suite %s' % s])
     else:
-        suites = session.query(Suite).filter(Suite.untouchable == False).all()
+        query = session.query(Suite).filter(Suite.untouchable == False)
+        if 'Archive' in Options:
+            query = query.join(Suite.archive).filter(Archive.archive_name==Options['Archive'])
+        suites = query.all()
 
     broken=[]