1 |
commit: 8293c7223f748dab6a1fd1faade3b3ea6183ce86 |
2 |
Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 28 17:43:22 2014 +0000 |
4 |
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 28 21:59:45 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=8293c722 |
7 |
|
8 |
updater.py: Adds repos.conf module plug-in |
9 |
|
10 |
In order to allow users to migrate/incorporate their config file to |
11 |
a repos.conf config file, the repos.conf plug-in has been added when |
12 |
creating the repos.conf to write all overlays to the config file. |
13 |
|
14 |
--- |
15 |
layman/updater.py | 14 ++++++++++---- |
16 |
1 file changed, 10 insertions(+), 4 deletions(-) |
17 |
|
18 |
diff --git a/layman/updater.py b/layman/updater.py |
19 |
index aa5f82e..874e3c3 100644 |
20 |
--- a/layman/updater.py |
21 |
+++ b/layman/updater.py |
22 |
@@ -175,7 +175,13 @@ class Main(object): |
23 |
|
24 |
def create_repos_conf(self): |
25 |
self.output.info(" Creating layman's repos.conf file") |
26 |
- # create layman's %(repos_conf) |
27 |
- # so layman won't error. |
28 |
- with fileopen(self.config['repos_conf'], 'w') as repos_conf: |
29 |
- repos_conf.write('') |
30 |
+ layman_inst = LaymanAPI(config=self.config) |
31 |
+ overlays = {} |
32 |
+ for ovl in layman_inst.get_installed(): |
33 |
+ overlays[ovl] = layman_inst._get_installed_db().select(ovl) |
34 |
+ # create layman's %(repos_conf) so layman |
35 |
+ # can write the overlays to it. |
36 |
+ open(self.config['repos_conf'], 'w').close() |
37 |
+ from layman.config_modules.reposconf.reposconf import ConfigHandler |
38 |
+ repos_conf = ConfigHandler(self.config, overlays) |
39 |
+ repos_conf.write() |