修改锁进度 以及禁用磁盘检查

This commit is contained in:
wangsong 2021-11-06 16:11:31 +08:00
parent 88f8d2aa70
commit b07dab2f2b
2 changed files with 11 additions and 12 deletions

View File

@ -81,7 +81,6 @@ class InstallBackendAptdaemon(InstallBackend):
try: try:
trans = yield self.client.update_cache(defer=True) trans = yield self.client.update_cache(defer=True)
self.window_main.dbusController.transaction = trans self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态 # 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_UPDATE, yield self._show_transaction(trans, self.ACTION_UPDATE,
_("Checking for updates…"), False) _("Checking for updates…"), False)
@ -104,7 +103,6 @@ class InstallBackendAptdaemon(InstallBackend):
pkgs_install, reinstall, pkgs_remove, purge = pkgs_purge, upgrade = pkgs_upgrade, pkgs_install, reinstall, pkgs_remove, purge = pkgs_purge, upgrade = pkgs_upgrade,
downgrade = downgrade, defer=True) downgrade = downgrade, defer=True)
self.window_main.dbusController.transaction = trans self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
yield self._show_transaction(trans, self.ACTION_INSTALL, yield self._show_transaction(trans, self.ACTION_INSTALL,
_("Installing updates…"), True) _("Installing updates…"), True)
@ -131,7 +129,6 @@ class InstallBackendAptdaemon(InstallBackend):
"""安装deb包 """ """安装deb包 """
try: try:
trans = yield self.client.install_file(path = install_path,force = install_force,defer=True) trans = yield self.client.install_file(path = install_path,force = install_force,defer=True)
self.window_main.is_working = True
# 注册回调函数 接收更新的状态 # 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_INSTALL_DEB, yield self._show_transaction(trans, self.ACTION_INSTALL_DEB,
_("Installing deb packages…"), False) _("Installing deb packages…"), False)
@ -151,7 +148,6 @@ class InstallBackendAptdaemon(InstallBackend):
try: try:
trans = yield self.client.fix_broken_depends(defer=True) trans = yield self.client.fix_broken_depends(defer=True)
self.window_main.dbusController.transaction = trans self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态 # 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_FIX_BROKEN, yield self._show_transaction(trans, self.ACTION_FIX_BROKEN,
_("Installing deb packages…"), False) _("Installing deb packages…"), False)
@ -171,7 +167,6 @@ class InstallBackendAptdaemon(InstallBackend):
try: try:
trans = yield self.client.download_packages(pkg_names = pkg_lists, defer=True) trans = yield self.client.download_packages(pkg_names = pkg_lists, defer=True)
self.window_main.dbusController.transaction = trans self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态 # 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_DOWNLOADONLY, yield self._show_transaction(trans, self.ACTION_DOWNLOADONLY,
_("Downloading deb packages…"), False) _("Downloading deb packages…"), False)
@ -191,7 +186,6 @@ class InstallBackendAptdaemon(InstallBackend):
try: try:
trans = yield self.client.remove_packages(package_names = pkgs_purge,defer=True) trans = yield self.client.remove_packages(package_names = pkgs_purge,defer=True)
self.window_main.dbusController.transaction = trans self.window_main.dbusController.transaction = trans
self.window_main.is_working = True
# 注册回调函数 接收更新的状态 # 注册回调函数 接收更新的状态
yield self._show_transaction(trans, self.ACTION_REMOVE_PACKAGES, yield self._show_transaction(trans, self.ACTION_REMOVE_PACKAGES,
_("Installing deb packages…"), False) _("Installing deb packages…"), False)

View File

@ -58,6 +58,9 @@ class InstallBackend():
def start(self,_upgrade_mode = MODE_DEFAULT_STATUS,partial_upgrade_list = []): def start(self,_upgrade_mode = MODE_DEFAULT_STATUS,partial_upgrade_list = []):
#对所有的操作进行枷锁 当执行完毕后返回到_action_done 进行解锁,除了计算依赖模式 不进入_action_done 单独解锁
self.window_main.is_working = True
#安装升级包 首先必须调用ACTION_CHECK_RESOLVER 计算依赖解决方便 标记cache 进行升级 #安装升级包 首先必须调用ACTION_CHECK_RESOLVER 计算依赖解决方便 标记cache 进行升级
if self.action == self.ACTION_INSTALL: if self.action == self.ACTION_INSTALL:
self.now_upgrade.upgrade_mode = _upgrade_mode self.now_upgrade.upgrade_mode = _upgrade_mode
@ -78,11 +81,11 @@ class InstallBackend():
return return
#检查磁盘的状态 #检查磁盘的状态
_success,desc = check_free_space(self.cache) # _success,desc = check_free_space(self.cache)
if _success == False and desc != None: # if _success == False and desc != None:
header = _("Can not upgrade") # header = _("Can not upgrade")
self._action_done(self.action,True,False,header,desc) # self._action_done(self.action,True,False,header,desc)
return # return
logging.info("Disk Check finished...") logging.info("Disk Check finished...")
try: try:
self.commit(pkgs_install, pkgs_upgrade, pkgs_remove) self.commit(pkgs_install, pkgs_upgrade, pkgs_remove)
@ -127,6 +130,8 @@ class InstallBackend():
raw_description.append(app.get_display_name()) raw_description.append(app.get_display_name())
else: else:
raw_description.append(getattr(pkg_obj.candidate, "summary", '')) raw_description.append(getattr(pkg_obj.candidate, "summary", ''))
#解锁忙碌
self.window_main.is_working = False
if _upgrade_mode != MODE_UPGRADE_SYSTEM: if _upgrade_mode != MODE_UPGRADE_SYSTEM:
self.window_main.dbusController.UpdateDependResloveStatus(_success,is_remove_pkgs,pkgs_remove,raw_description,delete_desc,header,desc) self.window_main.dbusController.UpdateDependResloveStatus(_success,is_remove_pkgs,pkgs_remove,raw_description,delete_desc,header,desc)
else: else: