| Trees | Indices | Help |
|---|
|
|
1 #!/usr/bin/env python
2 #
3 # $Id: $
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Library General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 """ Bodhi Initialization """
19
20 from os.path import isfile
21 from turbogears import config, update_config
22 from turbogears.database import PackageHub
23
24 hub = PackageHub("bodhi")
25 __connection__ = hub
26
27 releases = (
28 {
29 'name' : 'F7',
30 'long_name' : 'Fedora 7',
31 'dist_tag' : 'dist-fc7',
32 'id_prefix' : 'FEDORA'
33 },
34 )
35
37 """ Import the releases """
38 from bodhi.model import Release
39 print "\nInitializing Release table..."
40
41 for release in releases:
42 rel = Release(name=release['name'], long_name=release['long_name'],
43 id_prefix=release['id_prefix'],
44 dist_tag=release['dist_tag'])
45 print rel
46
48 """
49 Add packages that should suggest a reboot. Other than these packages, we
50 add a package to the database when its first update is added to the system
51 """
52 from bodhi.model import Package
53 for pkg in config.get('reboot_pkgs').split():
54 Package(name=pkg, suggest_reboot=True)
55
64
71
72 ##
73 ## Initialize the package/release/multilib tables
74 ##
75 if __name__ == '__main__':
76 print "Initializing Bodhi\n"
77 load_config()
78 hub.begin()
79 clean_tables()
80 import_releases()
81 import_rebootpkgs()
82 hub.commit()
83
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Sun Sep 23 14:46:39 2007 | http://epydoc.sourceforge.net |