1 |
--- |
2 |
# |
3 |
# This will be followed by a series of patches to ignore repos with sync-type |
4 |
# unset, as per the man page, fail when sync-uri is not specified and an update |
5 |
# to the emerge.1 man page to reflect the change in behavior. |
6 |
# |
7 |
pym/_emerge/actions.py | 8 +++++-- |
8 |
pym/portage/emaint/modules/sync/sync.py | 40 ++++----------------------------- |
9 |
2 files changed, 10 insertions(+), 38 deletions(-) |
10 |
|
11 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
12 |
index 71e362e..cc0269d 100644 |
13 |
--- a/pym/_emerge/actions.py |
14 |
+++ b/pym/_emerge/actions.py |
15 |
@@ -1999,9 +1999,13 @@ def action_sync(emerge_config, trees=DeprecationWarning, |
16 |
action=action, args=[], trees=trees, opts=opts) |
17 |
|
18 |
syncer = SyncRepos(emerge_config) |
19 |
- |
20 |
return_messages = "--quiet" not in emerge_config.opts |
21 |
- success, msgs = syncer.auto_sync(options={'return-messages': return_messages}) |
22 |
+ options = {'return-messages' : return_messages} |
23 |
+ if emerge_config.args: |
24 |
+ options['repo'] = emerge_config.args |
25 |
+ success, msgs = syncer.repo(options=options) |
26 |
+ else: |
27 |
+ success, msgs = syncer.auto_sync(options=options) |
28 |
if return_messages: |
29 |
print_results(msgs) |
30 |
|
31 |
diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py |
32 |
index 08a92a7..0aeccb3 100644 |
33 |
--- a/pym/portage/emaint/modules/sync/sync.py |
34 |
+++ b/pym/portage/emaint/modules/sync/sync.py |
35 |
@@ -148,43 +148,11 @@ class SyncRepos(object): |
36 |
|
37 |
|
38 |
def _get_repos(self, auto_sync_only=True): |
39 |
- selected_repos = [] |
40 |
- unknown_repo_names = [] |
41 |
- missing_sync_type = [] |
42 |
- if self.emerge_config.args: |
43 |
- for repo_name in self.emerge_config.args: |
44 |
- #print("_get_repos(): repo_name =", repo_name) |
45 |
- try: |
46 |
- repo = self.emerge_config.target_config.settings.repositories[repo_name] |
47 |
- except KeyError: |
48 |
- unknown_repo_names.append(repo_name) |
49 |
- else: |
50 |
- selected_repos.append(repo) |
51 |
- if repo.sync_type is None: |
52 |
- missing_sync_type.append(repo) |
53 |
- |
54 |
- if unknown_repo_names: |
55 |
- writemsg_level("!!! %s\n" % _("Unknown repo(s): %s") % |
56 |
- " ".join(unknown_repo_names), |
57 |
- level=logging.ERROR, noiselevel=-1) |
58 |
- |
59 |
- if missing_sync_type: |
60 |
- writemsg_level("!!! %s\n" % |
61 |
- _("Missing sync-type for repo(s): %s") % |
62 |
- " ".join(repo.name for repo in missing_sync_type), |
63 |
- level=logging.ERROR, noiselevel=-1) |
64 |
- |
65 |
- if unknown_repo_names or missing_sync_type: |
66 |
- writemsg_level("Missing or unknown repos... returning", |
67 |
- level=logging.INFO, noiselevel=2) |
68 |
- return [] |
69 |
- |
70 |
- else: |
71 |
- selected_repos.extend(self.emerge_config.target_config.settings.repositories) |
72 |
- #print("_get_repos(), selected =", selected_repos) |
73 |
+ repos = self.emerge_config.target_config.settings.repositories |
74 |
+ #print("_get_repos(), repos =", repos) |
75 |
if auto_sync_only: |
76 |
- return self._filter_auto(selected_repos) |
77 |
- return selected_repos |
78 |
+ return self._filter_auto(repos) |
79 |
+ return repos |
80 |
|
81 |
|
82 |
def _filter_auto(self, repos): |
83 |
-- |
84 |
2.10.2 |