Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions scripts/suppack-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,22 @@ def md5sum_file(fname):
pkg_ver, _ = subprocess.Popen(['rpm', '--nosignature', '-q', '--qf', '%{VERSION}-%{RELEASE}',
'-p', p.filename], stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
if 'options' in p.__dict__:
install = '-i' in p.options
else:
install = (pkg_name in ['kernel-xen', 'kernel-kdump'])
s = subprocess.Popen(['rpm', '--nosignature', '-q', '--qf', '%{VERSION}-%{RELEASE}',
pkg_name], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
inst_ver, _ = s.communicate()

if 'options' in p.__dict__:
install = False
if '-i' in p.options:
install = True
elif '-m' in p.options:
# kernel module, if it exists upgrade, else install
if s.returncode != 0:
install = True
else:
install = (pkg_name in ['kernel-xen', 'kernel-kdump'])

if s.returncode != 0:
if install:
install_list.append(p)
Expand Down
5 changes: 4 additions & 1 deletion xcp/supplementalpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def __init__(self, fname):
if m:
self.label = m.group(1)
self.kernel = m.group(3) + m.group(2)
self.options = '-i'
# this is a kernel module. Multiple packages of this module
# can be installed for different kernel versions. But for
# the same kernel version, only upgrade should be done.
self.options = '-m'
else:
self.label = rpmname
self.kernel = 'any'
Expand Down