]> git.decadent.org.uk Git - dak.git/blob - cameron
add s390 to arch list, autobuilding from accepted bits
[dak.git] / cameron
1 #!/usr/bin/env python
2
3 # Generate file list for unstable_accepted
4 # Copyright (C) 2002  James Troup <james@nocrew.org>
5 # $Id: cameron,v 1.1 2002-05-05 19:59:32 rmurray Exp $
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21 ################################################################################
22
23 import pg, string, os, sys
24 import apt_pkg
25 import db_access, utils, claire, logging
26
27 ################################################################################
28
29 projectB = None
30 Cnf = None
31 Logger = None;
32
33 ################################################################################
34
35 def main():
36     global Cnf, projectB;
37
38     Cnf = utils.get_conf()
39
40     Arguments = [('h',"help","Cameron::Options::Help")];
41                  
42     apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
43
44     projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
45     db_access.init(Cnf, projectB);
46     list = utils.open_file("%s/unstable_accepted.list" % (Cnf["Dir::ListsDir"]), "w")
47     q = projectB.query("SELECT filename FROM unstable_accepted WHERE in_accepted AND filename ~ '(u?deb|dsc)$'");
48     entries = q.getresult();
49     for entry in entries:
50         filename = os.path.dirname(entry[0])+'/incoming/'+os.path.basename(entry[0]);
51         list.write("%s\n" % (filename))
52     list.close()
53
54 #########################################################################################
55
56 if __name__ == '__main__':
57     main()