1 |
--- |
2 |
pym/portage/repository/config.py | 16 ++++++++++++---- |
3 |
pym/portage/sync/controller.py | 3 +++ |
4 |
2 files changed, 15 insertions(+), 4 deletions(-) |
5 |
|
6 |
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py |
7 |
index d37ce6a..678cc68 100644 |
8 |
--- a/pym/portage/repository/config.py |
9 |
+++ b/pym/portage/repository/config.py |
10 |
@@ -85,8 +85,9 @@ class RepoConfig(object): |
11 |
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name', |
12 |
'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority', |
13 |
'profile_formats', 'sign_commit', 'sign_manifest', 'sync_cvs_repo', |
14 |
- 'sync_type', 'sync_uri', 'thin_manifest', 'update_changelog', |
15 |
- 'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig') |
16 |
+ 'sync_type', 'sync_umask', 'sync_uri', 'thin_manifest', |
17 |
+ 'update_changelog', 'user_location', '_eapis_banned', |
18 |
+ '_eapis_deprecated', '_masters_orig') |
19 |
|
20 |
def __init__(self, name, repo_opts, local_config=True): |
21 |
"""Build a RepoConfig with options in repo_opts |
22 |
@@ -154,6 +155,11 @@ class RepoConfig(object): |
23 |
sync_type = sync_type.strip() |
24 |
self.sync_type = sync_type or None |
25 |
|
26 |
+ sync_umask = repo_opts.get('sync-umask') |
27 |
+ if sync_umask is not None: |
28 |
+ sync_umask = sync_umask.strip() |
29 |
+ self.sync_umask = sync_umask or None |
30 |
+ |
31 |
sync_uri = repo_opts.get('sync-uri') |
32 |
if sync_uri is not None: |
33 |
sync_uri = sync_uri.strip() |
34 |
@@ -375,6 +381,8 @@ class RepoConfig(object): |
35 |
repo_msg.append(indent + "sync-cvs-repo: " + self.sync_cvs_repo) |
36 |
if self.sync_type: |
37 |
repo_msg.append(indent + "sync-type: " + self.sync_type) |
38 |
+ if self.sync_umask: |
39 |
+ repo_msg.append(indent + "sync-umask: " + self.sync_umask) |
40 |
if self.sync_uri: |
41 |
repo_msg.append(indent + "sync-uri: " + self.sync_uri) |
42 |
if self.masters: |
43 |
@@ -464,7 +472,7 @@ class RepoConfigLoader(object): |
44 |
# repos.conf is allowed to override. |
45 |
for k in ('aliases', 'auto_sync', 'eclass_overrides', |
46 |
'force', 'masters', 'priority', 'sync_cvs_repo', |
47 |
- 'sync_type', 'sync_uri', |
48 |
+ 'sync_type', 'sync_umask', 'sync_uri', |
49 |
): |
50 |
v = getattr(repos_conf_opts, k, None) |
51 |
if v is not None: |
52 |
@@ -915,7 +923,7 @@ class RepoConfigLoader(object): |
53 |
def config_string(self): |
54 |
str_or_int_keys = ("auto_sync", "format", "location", |
55 |
"main_repo", "priority", "sync_cvs_repo", |
56 |
- "sync_type", "sync_uri") |
57 |
+ "sync_type", "sync_umask", "sync_uri") |
58 |
str_tuple_keys = ("aliases", "eclass_overrides", "force") |
59 |
repo_config_tuple_keys = ("masters",) |
60 |
keys = str_or_int_keys + str_tuple_keys + repo_config_tuple_keys |
61 |
diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py |
62 |
index 21aa7a7..0e5efb6 100644 |
63 |
--- a/pym/portage/sync/controller.py |
64 |
+++ b/pym/portage/sync/controller.py |
65 |
@@ -213,6 +213,9 @@ class SyncManager(object): |
66 |
if not st.st_mode & 0o020: |
67 |
umask = umask | 0o020 |
68 |
spawn_kwargs["umask"] = umask |
69 |
+ # override the defaults when sync_umask is set |
70 |
+ if repo.sync_umask is not None: |
71 |
+ spawn_kwargs["umask"] = int(repo.sync_umask, 8) |
72 |
self.spawn_kwargs = spawn_kwargs |
73 |
|
74 |
if self.usersync_uid is not None: |
75 |
-- |
76 |
2.2.0 |