Skip to content

Commit 0b31287

Browse files
author
Koi-foo
committed
Improved recalculation of kernels versions and switching to another branch
1 parent b5cea11 commit 0b31287

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

kernel_manager.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ def search_kernel(self):
9595
for x in search_version.splitlines():
9696
act = self.search_re(kernel_num=x).split(".")
9797

98-
if act[0] > new_version.split(".")[0]:
98+
if int(act[0]) > int(new_version.split(".")[0]):
9999
new_version = ".".join(act)
100-
break
101100

102-
if act[1] > new_version.split(".")[1]:
101+
if int(act[1]) > int(new_version.split(".")[1]):
103102
new_version = ".".join(act)
104103

105104
if int(act[2]) > int(new_version.split(".")[2]):
@@ -313,15 +312,21 @@ def sisyphus_flavour(self):
313312

314313
def distribution_up(self):
315314
"""Обновить дистрибутив"""
316-
self.branches()
317-
318315
command = "/bin/sh -c" + " " \
319316
+ "apt-get\" \"dist-upgrade"
320317

321318
combobox_text = self.comboBox_ChangeRepo.currentText()
319+
current_repo = run('apt-repo', shell=True, stdout=PIPE, \
320+
encoding='utf-8').stdout.splitlines()[1]
322321

323322
if combobox_text == 'Sisyphus':
324323
command = self.upgrade_sisyphus()
324+
elif combobox_text not in current_repo:
325+
command = "/bin/sh -c" + " " \
326+
+ "apt-get\" \"update" + ";" \
327+
+ "apt-get\" \"dist-upgrade"
328+
329+
self.branches()
325330

326331
self.proc_win.show()
327332
self.proc_win.setWindowTitle(_('Distribution update'))

0 commit comments

Comments
 (0)