Merge branch 'backend_manual' of gitlab2.kylin.com:kylin-desktop/update-manager-group/kylin-system-updater into backend_manual

This commit is contained in:
Xueyi Luo 2022-05-06 16:45:38 +08:00
commit 6dbe9112a4
3 changed files with 22 additions and 34 deletions

View File

@ -57,7 +57,7 @@ class UpdateManager():
self.sqlite3_server = Sqlite3Server(self)
#是否重启apt
self.set_restart_aptdeamon = False
self.init_config_aptdeamon = False
#数据采集器
self.collector = UpdateMsgCollector(self)
@ -148,12 +148,9 @@ class UpdateManager():
#检查是否需要重新启动aptdeamon 目前需要重启的有限速功能
def check_restart_aptdeamon(self):
if self.set_restart_aptdeamon == True:
logging.warning("aptdeamon will be restart...")
self.set_restart_aptdeamon = False
self.dbusController.make_aptdeamon_restart()
#重启的话等待重启完成
time.sleep(0.5)
if self.init_config_aptdeamon == True:
self.init_config_aptdeamon = False
self.dbusController.set_aptdeamon_environ("init","config")
def run(self):
"""Start the daemon and listen for calls."""

View File

@ -17,7 +17,7 @@ from SystemUpdater.Core.utils import (
from SystemUpdater.Core.DataAcquisition import get_east_8_time
from apt import Cache
import subprocess
from SystemUpdater.Core.UpdateList import LocalUpgradeDataList,UpdateList
from SystemUpdater.Core.UpdateList import LocalUpgradeDataList
class NowUpgradePara:
"""
@ -252,25 +252,25 @@ class InstallBackend():
#卸载包
elif self.action == self.ACTION_REMOVE_PACKAGES:
try:
remove_pkgs = []
for pkg in partial_upgrade_list:
if pkg in self.cache:
pkg_cache = self.cache[pkg]
pkg_cache.mark_delete(True, True)
else:
#没有在cache中就认为不需要升级
logging.error("Check: (%s) The reomve package is not in Cache...",pkg)
# remove_pkgs = []
# for pkg in partial_upgrade_list:
# if pkg in self.cache:
# pkg_cache = self.cache[pkg]
# pkg_cache.mark_delete(True, True)
# else:
# #没有在cache中就认为不需要升级
# logging.error("Check: (%s) The reomve package is not in Cache...",pkg)
for pkg_obj in self.cache.get_changes():
if pkg_obj.marked_delete:
remove_pkgs.append(pkg_obj.name)
# for pkg_obj in self.cache.get_changes():
# if pkg_obj.marked_delete:
# remove_pkgs.append(pkg_obj.name)
success,header,desc = self.check_essential_pkgs(remove_pkgs)
if success == False:
self._action_done(self.action,False,False,header,desc)
return
else:
self.purge_packages(partial_upgrade_list)
# success,header,desc = self.check_essential_pkgs(remove_pkgs)
# if success == False:
# self._action_done(self.action,False,False,header,desc)
# return
# else:
self.purge_packages(partial_upgrade_list)
except Exception as e:
logging.error(desc)

View File

@ -1,9 +0,0 @@
DOMAIN=kylin-system-updater
DESKTOP_IN_FILES := $(wildcard *.desktop.in)
DESKTOP_FILES := $(patsubst %.desktop.in,%.desktop,$(wildcard *.desktop.in))
all: $(DESKTOP_FILES)
%.desktop: %.desktop.in ../po/$(DOMAIN).pot
intltool-merge -d ../po $< $@