mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-10-21 19:33:20 +03:00
Compare commits
1 Commits
0.10.6-alt
...
fix_check_
Author | SHA1 | Date | |
---|---|---|---|
527c4f8172 |
@@ -87,9 +87,6 @@ class firefox_applier(applier_frontend):
|
|||||||
if json_data:
|
if json_data:
|
||||||
it_data.data = json_data
|
it_data.data = json_data
|
||||||
it_data.type = 7
|
it_data.type = 7
|
||||||
else:
|
|
||||||
if it_data.type == 1:
|
|
||||||
it_data.data = clean_data_firefox(it_data.data)
|
|
||||||
#Cases when it is necessary to create nested dictionaries
|
#Cases when it is necessary to create nested dictionaries
|
||||||
if it_data.valuename != it_data.data:
|
if it_data.valuename != it_data.data:
|
||||||
parts = self.get_parts(it_data.hive_key)
|
parts = self.get_parts(it_data.hive_key)
|
||||||
@@ -183,6 +180,3 @@ def dict_item_to_list(dictionary:dict) -> dict:
|
|||||||
else:
|
else:
|
||||||
dict_item_to_list(dictionary[key])
|
dict_item_to_list(dictionary[key])
|
||||||
return dictionary
|
return dictionary
|
||||||
|
|
||||||
def clean_data_firefox(data):
|
|
||||||
return data.replace("'", '\"')
|
|
||||||
|
@@ -20,13 +20,15 @@
|
|||||||
import rpm
|
import rpm
|
||||||
import subprocess
|
import subprocess
|
||||||
from gpoa.storage import registry_factory
|
from gpoa.storage import registry_factory
|
||||||
from util.gpoa_ini_parsing import GpoaConfigObj
|
|
||||||
from util.util import get_uid_by_username, string_to_literal_eval
|
|
||||||
import logging
|
import logging
|
||||||
from util.logging import log
|
from util.logging import log
|
||||||
import argparse
|
import argparse
|
||||||
import gettext
|
import gettext
|
||||||
import locale
|
import locale
|
||||||
|
from messages import message_with_code
|
||||||
|
from util.arguments import (
|
||||||
|
set_loglevel
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def is_rpm_installed(rpm_name):
|
def is_rpm_installed(rpm_name):
|
||||||
@@ -51,32 +53,20 @@ class Pkcon_applier:
|
|||||||
self.__reinstall_command = ['/usr/bin/pkcon', '-y', 'reinstall']
|
self.__reinstall_command = ['/usr/bin/pkcon', '-y', 'reinstall']
|
||||||
self.install_packages = set()
|
self.install_packages = set()
|
||||||
self.remove_packages = set()
|
self.remove_packages = set()
|
||||||
if user:
|
self.storage = registry_factory(username=user)
|
||||||
pid = get_uid_by_username(user)
|
self.storage.filling_storage_from_dconf()
|
||||||
#TODO: It is necessary to redo reading from the GVariant database file policy{pid}
|
install_branch = '{}/{}'.format(self.__hklm_branch, self.__install_key_name)
|
||||||
try:
|
remove_branch = '{}/{}'.format(self.__hklm_branch, self.__remove_key_name)
|
||||||
packages_dict = GpoaConfigObj(f'/etc/dconf/db/policy{pid}.d/policy{pid}.ini')
|
self.install_packages_setting = self.storage.filter_hklm_entries(install_branch)
|
||||||
except:
|
self.remove_packages_setting = self.storage.filter_hklm_entries(remove_branch)
|
||||||
packages_dict = {}
|
|
||||||
|
|
||||||
self.install_packages_setting = string_to_literal_eval(
|
|
||||||
packages_dict.get(self.__hklm_branch[1:], {}).get(self.__install_key_name, {}))
|
|
||||||
self.remove_packages_setting = string_to_literal_eval(
|
|
||||||
packages_dict.get(self.__hklm_branch[1:], {}).get(self.__remove_key_name, {}))
|
|
||||||
else:
|
|
||||||
storage = registry_factory(username=user)
|
|
||||||
install_branch = '{}/{}'.format(self.__hklm_branch, self.__install_key_name)
|
|
||||||
remove_branch = '{}/{}'.format(self.__hklm_branch, self.__remove_key_name)
|
|
||||||
self.install_packages_setting = storage.get_key_value(install_branch)
|
|
||||||
self.remove_packages_setting = storage.get_key_value(remove_branch)
|
|
||||||
for package in self.install_packages_setting:
|
for package in self.install_packages_setting:
|
||||||
if not is_rpm_installed(package):
|
if not is_rpm_installed(package.data):
|
||||||
self.install_packages.add(package)
|
self.install_packages.add(package.data)
|
||||||
for package in self.remove_packages_setting:
|
for package in self.remove_packages_setting:
|
||||||
if package in self.install_packages:
|
if package.data in self.install_packages:
|
||||||
self.install_packages.remove(package)
|
self.install_packages.remove(package.data)
|
||||||
if is_rpm_installed(package):
|
if is_rpm_installed(package.data):
|
||||||
self.remove_packages.add(package)
|
self.remove_packages.add(package.data)
|
||||||
|
|
||||||
def apply(self):
|
def apply(self):
|
||||||
log('D142')
|
log('D142')
|
||||||
|
@@ -206,7 +206,7 @@ class Dconf_registry():
|
|||||||
dconf_dict = self.get_key_values(self.get_matching_keys(startswith))
|
dconf_dict = self.get_key_values(self.get_matching_keys(startswith))
|
||||||
for key, value in dconf_dict.items():
|
for key, value in dconf_dict.items():
|
||||||
keys_tmp = key.split('/')
|
keys_tmp = key.split('/')
|
||||||
update_dict(output_dict.setdefault('/'.join(keys_tmp[:-1])[1:], {}), {keys_tmp[-1]: str(value)})
|
update_dict(output_dict.setdefault('/'.join(keys_tmp[:-1])[1:], {}), {keys_tmp[-1]: value})
|
||||||
|
|
||||||
log('D207')
|
log('D207')
|
||||||
return output_dict
|
return output_dict
|
||||||
@@ -234,7 +234,7 @@ class Dconf_registry():
|
|||||||
elif isinstance(value, list):
|
elif isinstance(value, list):
|
||||||
for data in value:
|
for data in value:
|
||||||
list_entiers.append(PregDconf(
|
list_entiers.append(PregDconf(
|
||||||
keyname, data, find_preg_type(data), data))
|
keyname, convert_string_dconf(data), find_preg_type(data), data))
|
||||||
else:
|
else:
|
||||||
list_entiers.append(PregDconf(
|
list_entiers.append(PregDconf(
|
||||||
'/'.join(keyname.split('/')[:-1]), convert_string_dconf(keyname.split('/')[-1]), find_preg_type(value), value))
|
'/'.join(keyname.split('/')[:-1]), convert_string_dconf(keyname.split('/')[-1]), find_preg_type(value), value))
|
||||||
@@ -371,13 +371,13 @@ class Dconf_registry():
|
|||||||
def get_scripts(cls, sid, action):
|
def get_scripts(cls, sid, action):
|
||||||
action_scripts = list()
|
action_scripts = list()
|
||||||
for part in cls.scripts:
|
for part in cls.scripts:
|
||||||
if action == 'LOGON' and part.action == 'LOGON':
|
if action == 'LOGON':
|
||||||
action_scripts.append(part)
|
action_scripts.append(part)
|
||||||
elif action == 'LOGOFF' and part.action == 'LOGOFF':
|
elif action == 'LOGOFF':
|
||||||
action_scripts.append(part)
|
action_scripts.append(part)
|
||||||
elif action == 'STARTUP' and part.action == 'STARTUP':
|
elif action == 'STARTUP':
|
||||||
action_scripts.append(part)
|
action_scripts.append(part)
|
||||||
elif action == 'SHUTDOWN' and part.action == 'SHUTDOWN':
|
elif action == 'SHUTDOWN':
|
||||||
action_scripts.append(part)
|
action_scripts.append(part)
|
||||||
return action_scripts
|
return action_scripts
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ def load_preg_dconf(pregfile, pathfile, policy_name, username, version=None):
|
|||||||
dd = dict()
|
dd = dict()
|
||||||
for i in pregfile.entries:
|
for i in pregfile.entries:
|
||||||
# Skip this entry if the valuename starts with '**del'
|
# Skip this entry if the valuename starts with '**del'
|
||||||
if i.valuename.lower().startswith('**del'):
|
if i.valuename.startswith('**del'):
|
||||||
continue
|
continue
|
||||||
valuename = convert_string_dconf(i.valuename)
|
valuename = convert_string_dconf(i.valuename)
|
||||||
data = check_data(i.data, i.type)
|
data = check_data(i.data, i.type)
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
%add_python3_req_skip util.gpoa_ini_parsing
|
%add_python3_req_skip util.gpoa_ini_parsing
|
||||||
|
|
||||||
Name: gpupdate
|
Name: gpupdate
|
||||||
Version: 0.10.6
|
Version: 0.10.3
|
||||||
Release: alt1
|
Release: alt1
|
||||||
|
|
||||||
Summary: GPT applier
|
Summary: GPT applier
|
||||||
@@ -191,20 +191,6 @@ fi
|
|||||||
%exclude %python3_sitelibdir/gpoa/test
|
%exclude %python3_sitelibdir/gpoa/test
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Jul 08 2024 Valery Sinelnikov <greh@altlinux.org> 0.10.6-alt1
|
|
||||||
- Fixed firefox_applier errors
|
|
||||||
|
|
||||||
* Fri Jun 28 2024 Valery Sinelnikov <greh@altlinux.org> 0.10.5-alt1
|
|
||||||
- Correction of missing entries with a upper case
|
|
||||||
- Fixed string processing in date (closes: 50782)
|
|
||||||
- Fixed getting correct data for the user for pkcon_runner
|
|
||||||
|
|
||||||
* Thu Jun 27 2024 Valery Sinelnikov <greh@altlinux.org> 0.10.4-alt1
|
|
||||||
- Fixed the definition of the module activation check (closes: 50755)
|
|
||||||
- Fixed sorting of scripts (closes: 50756)
|
|
||||||
- Fixed reading key values from dconf
|
|
||||||
- Changed the method for getting the list of packages for pkcon_runner
|
|
||||||
|
|
||||||
* Wed Jun 19 2024 Valery Sinelnikov <greh@altlinux.org> 0.10.3-alt1
|
* Wed Jun 19 2024 Valery Sinelnikov <greh@altlinux.org> 0.10.3-alt1
|
||||||
- Added autocompletion for gpoa, gpupdate, gpupdate-setup
|
- Added autocompletion for gpoa, gpupdate, gpupdate-setup
|
||||||
- Added correct work with json data in keys for the Firefox browser
|
- Added correct work with json data in keys for the Firefox browser
|
||||||
|
Reference in New Issue
Block a user