From 77d66c2e263c100f06e6182ed63fd35a97ffcd8c Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 2 Jan 2010 11:53:04 +0100 Subject: [PATCH] [entropy.core] SystemSettings._repositories_parser(): always try to properly setup permissions and cache --- libraries/entropy/core/settings/base.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libraries/entropy/core/settings/base.py b/libraries/entropy/core/settings/base.py index 1f6ec7bee..2c7e9e2ec 100644 --- a/libraries/entropy/core/settings/base.py +++ b/libraries/entropy/core/settings/base.py @@ -1003,11 +1003,11 @@ class SystemSettings(Singleton, EntropyPluginStore): branch = split_line[1].strip() data['branch'] = branch - if not os.path.isdir(etpConst['packagesbindir']+"/"+branch) \ - and (etpConst['uid'] == 0): - + branch_dir = os.path.join(etpConst['packagesbindir'], branch) + if not os.path.isdir(branch_dir): try: - os.makedirs(etpConst['packagesbindir']+"/"+branch) + os.makedirs(branch_dir, 0o775) + const_setup_perms(branch_dir, etpConst['entropygid']) except (OSError, IOError,): continue @@ -1103,6 +1103,10 @@ class SystemSettings(Singleton, EntropyPluginStore): if tx_limit is not None: data['transfer_limit'] = tx_limit + # validate using mtime + for repoid in data['order']: + + return data def _clear_repository_cache(self, repoid = None): @@ -1247,11 +1251,6 @@ class SystemSettings(Singleton, EntropyPluginStore): @rtype: None """ - # can't validate if running as user, moreover - # users can't make changes, so... - if os.getuid() != 0: - return - # handle on-disk cache validation # in this case, repositories cache # if file is changed, we must destroy cache