]> git.decadent.org.uk Git - dak.git/blob - cameron
sync
[dak.git] / cameron
1 #!/usr/bin/env python
2
3 # Generate file list for unstable_accepted
4 # Copyright (C) 2002  Ryan Murray <rmurray@debian.org>
5 # $Id: cameron,v 1.2 2002-05-10 00:24:07 troup 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, os, sys;
24 import apt_pkg;
25 import db_access, utils;
26
27 ################################################################################
28
29 def main():
30     Cnf = utils.get_conf();
31
32     apt_pkg.ParseCommandLine(Cnf,[],sys.argv);
33
34     projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
35     db_access.init(Cnf, projectB);
36     list = utils.open_file("%s/unstable_accepted.list" % (Cnf["Dir::Lists"]), "w");
37     q = projectB.query("SELECT filename FROM unstable_accepted WHERE in_accepted AND filename ~ '(u?deb|dsc)$'");
38     for entry in q.getresult():
39         filename = os.path.join(os.path.dirname(entry[0]),'/incoming/',os.path.basename(entry[0]));
40         list.write("%s\n" % (filename));
41     list.close();
42
43 ################################################################################
44
45 if __name__ == '__main__':
46     main();