qubes-anaconda-addon: fix checking for versioned whonix templates
Use '*' in package name. This require using rpm -qa (instead of rpm -q).
In this case, checking exit code doesn't work, we need to check if any
package was actually listed.
(cherry picked from commit b0fa5381c1
)
This commit is contained in:
parent
715aaae11b
commit
c030eba49a
@ -57,8 +57,8 @@ from pyanaconda.ui.common import FirstbootOnlySpokeMixIn
|
|||||||
__all__ = ["QubesOsSpoke"]
|
__all__ = ["QubesOsSpoke"]
|
||||||
|
|
||||||
def is_package_installed(pkgname):
|
def is_package_installed(pkgname):
|
||||||
return not subprocess.call(['rpm', '-q', pkgname],
|
pkglist = subprocess.check_output(['rpm', '-qa', pkgname])
|
||||||
stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
|
return bool(pkglist)
|
||||||
|
|
||||||
def usb_keyboard_present():
|
def usb_keyboard_present():
|
||||||
context = pyudev.Context()
|
context = pyudev.Context()
|
||||||
@ -245,8 +245,8 @@ class QubesOsSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
|
|||||||
('qvm.personal', 'qvm.work', 'qvm.untrusted', 'qvm.vault'),
|
('qvm.personal', 'qvm.work', 'qvm.untrusted', 'qvm.vault'),
|
||||||
depend=self.choice_network)
|
depend=self.choice_network)
|
||||||
|
|
||||||
if (is_package_installed('qubes-template-whonix-gw') and
|
if (is_package_installed('qubes-template-whonix-gw*') and
|
||||||
is_package_installed('qubes-template-whonix-ws')):
|
is_package_installed('qubes-template-whonix-ws*')):
|
||||||
self.choice_whonix = QubesChoice(
|
self.choice_whonix = QubesChoice(
|
||||||
_('Create Whonix Gateway and Workstation qubes '
|
_('Create Whonix Gateway and Workstation qubes '
|
||||||
'(sys-whonix, anon-whonix)'),
|
'(sys-whonix, anon-whonix)'),
|
||||||
|
Loading…
Reference in New Issue
Block a user