3 """ Generate Packages/Sources files
5 @contact: Debian FTPMaster <ftpmaster@debian.org>
6 @copyright: 2000, 2001, 2002, 2006 James Troup <james@nocrew.org>
7 @copyright: 2009 Mark Hymers <mhy@debian.org>
8 @copyright: 2010 Joerg Jaspert <joerg@debian.org>
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ################################################################################
32 from datetime import datetime
35 from daklib import daklog
36 from daklib.dbconn import *
37 from daklib.config import Config
39 ################################################################################
44 ################################################################################
46 def usage (exit_code=0):
47 print """Usage: dak generate-packages-sources [OPTIONS]
48 Generate the Packages/Sources files
50 -s, --suite=SUITE(s) process this suite
51 Default: All suites not marked 'untouchable'
52 -f, --force Allow processing of untouchable suites
53 CAREFUL: Only to be used at point release time!
54 -h, --help show this help and exit
56 SUITE can be a space seperated list, e.g.
57 --suite=unstable testing
62 ################################################################################
65 global Options, Logger
69 for i in ["Help", "Suite", "Force"]:
70 if not cnf.has_key("Generate-Packages-Sources::Options::%s" % (i)):
71 cnf["Generate-Packages-Sources::Options::%s" % (i)] = ""
73 Arguments = [('h',"help","Generate-Packages-Sources::Options::Help"),
74 ('s',"suite","Generate-Packages-Sources::Options::Suite"),
75 ('f',"force","Generate-Packages-Sources::Options::Force")]
77 suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
78 Options = cnf.SubTree("Generate-Packages-Sources::Options")
83 # Logger = daklog.Logger(cnf, 'generate-packages-sources')
85 session = DBConn().session()
91 suite = get_suite(s.lower(), session)
95 print "cannot find suite %s" % s
96 # Logger.log(['cannot find suite %s' % s])
98 suites=session.query(Suite).filter(Suite.untouchable == 'false').all()
101 print "Working on: %s" % (s.suite_name)
103 # For each given suite, look up object and call generate-filelist
105 Logger.log(['generating filelist for %s' % (s.suite_name)])
106 s.generate_filelist(Logger)
110 #######################################################################################
112 if __name__ == '__main__':