def _register_installed_apps_in_ucr(self):
		installed_codes = []
		for app in Apps().get_all_apps():
			if app.is_installed():
				installed_codes.append(app.code)
		with catch_stdout(self.logger):
			ucr_save({
				'appcenter/installed': '-'.join(installed_codes),
				'repository/app_center/installed': '-'.join(installed_codes),  # to be deprecated
			})
	def _register_component_for_apps(self, apps, args):
		if not self._shall_register(args, 'component'):
			return
		updates = {}
		for app in apps:
			if self._do_register(app, args):
				updates.update(self._register_component(app, delay=True))
			else:
				updates.update(self._unregister_component_dict(app))
		with catch_stdout(self.logger):
			ucr_save(updates)
Exemplo n.º 3
0
	def _register_component(self, app, delay=False):
		if app.docker and not container_mode():
			self.log('Component needs to be registered in the container')
			return {}
		if app.without_repository:
			self.log('No repository to register')
			return {}
		updates = {}
		self.log('Registering component for %s' % app.id)
		for _app in Apps().get_all_apps_with_id(app.id):
			if _app == app:
				updates.update(self._register_component_dict(_app))
			else:
				updates.update(self._unregister_component_dict(_app))
		if not delay:
			with catch_stdout(self.logger):
				ucr_save(updates)
		return updates
 def _update_conffiles(self):
     conffiles = self._get_conffiles()
     if conffiles:
         with catch_stdout(self.logger):
             handler_commit(conffiles)