[entropy.core] SystemSettings._repositories_parser(): always try to properly setup permissions and cache

This commit is contained in:
Fabio Erculiani
2010-01-02 11:53:04 +01:00
parent 82bebbfaf8
commit 77d66c2e26

View File

@@ -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