Fix: cl-update-profile migrate repo condition

update: new check cache for variables/update.py -
	ClUpdateProfileCheckSyncAllowed
master 3.7.2.48
root 1 year ago
parent 61d86149ff
commit c7744229ef

@ -51,7 +51,7 @@ class ClUpdateProfileAction(Action):
'condition': lambda Get: not (
Get('cl_update_profile_storage').is_local(
Get('cl_update_profile_url'),
Get('cl_update_profile_branch'))) or Get('cl_update_profile_check_sync_allowed')
Get('cl_update_profile_branch'))) and Get('cl_update_profile_check_sync_allowed')
},
{'name': 'reconfigure_vars1',
'method': 'Update.invalidateVariables("cl_update_profile_storage")',
@ -73,7 +73,7 @@ class ClUpdateProfileAction(Action):
'tasks': [
{'name': 'sync_reps',
'foreach': 'cl_update_profile_sync_rep',
'message': __("Syncing the {eachvar:capitalize} repository"),
'message': __("Checking {eachvar:capitalize} updates"),
'method': 'Update.syncRepositories(eachvar)',
'condition': lambda Get: Get('cl_update_profile_check_sync_allowed')
},

@ -936,6 +936,7 @@ class VariableClUpdateProfileCheckSyncAllowed(Variable):
urls = 'cl_update_rep_url'
names = 'cl_update_rep_name'
path = 'cl_update_profile_path'
cache_path = 'cl_update_package_cache'
def get(self):
if not self.Get(self.urls) or not self.Get(self.names):
@ -946,6 +947,10 @@ class VariableClUpdateProfileCheckSyncAllowed(Variable):
with open(f'{rep}/test', 'w') as inf:
inf.write("test")
quite_unlink(f"{rep}/test")
path = self.Get(self.cache_path)
with open(f'{rep}/test', 'w') as inf:
inf.write("test")
quite_unlink(f"{rep}/test")
except OSError:
return False
return True

Loading…
Cancel
Save