yum: support installroot in is_group_env_installed (#34182)
This commit is contained in:
parent
5496326c4d
commit
3681d0e3e0
1 changed files with 5 additions and 5 deletions
|
@ -330,10 +330,10 @@ def po_to_envra(po):
|
||||||
return '%s:%s-%s-%s.%s' % (po.epoch, po.name, po.version, po.release, po.arch)
|
return '%s:%s-%s-%s.%s' % (po.epoch, po.name, po.version, po.release, po.arch)
|
||||||
|
|
||||||
|
|
||||||
def is_group_env_installed(name):
|
def is_group_env_installed(name, conf_file, installroot='/'):
|
||||||
name_lower = name.lower()
|
name_lower = name.lower()
|
||||||
|
|
||||||
my = yum_base()
|
my = yum_base(conf_file, installroot)
|
||||||
if yum.__version__ >= '3.4':
|
if yum.__version__ >= '3.4':
|
||||||
groups_list = my.doGroupLists(return_evgrps=True)
|
groups_list = my.doGroupLists(return_evgrps=True)
|
||||||
else:
|
else:
|
||||||
|
@ -793,7 +793,7 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, i
|
||||||
|
|
||||||
# groups
|
# groups
|
||||||
elif spec.startswith('@'):
|
elif spec.startswith('@'):
|
||||||
if is_group_env_installed(spec):
|
if is_group_env_installed(spec, conf_file, installroot=installroot):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
pkg = spec
|
pkg = spec
|
||||||
|
@ -899,7 +899,7 @@ def remove(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, in
|
||||||
|
|
||||||
for pkg in items:
|
for pkg in items:
|
||||||
if pkg.startswith('@'):
|
if pkg.startswith('@'):
|
||||||
installed = is_group_env_installed(pkg)
|
installed = is_group_env_installed(pkg, conf_file, installroot=installroot)
|
||||||
else:
|
else:
|
||||||
installed = is_installed(module, repoq, pkg, conf_file, en_repos=en_repos, dis_repos=dis_repos, installroot=installroot)
|
installed = is_installed(module, repoq, pkg, conf_file, en_repos=en_repos, dis_repos=dis_repos, installroot=installroot)
|
||||||
|
|
||||||
|
@ -932,7 +932,7 @@ def remove(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, in
|
||||||
# at this point we check to see if the pkg is no longer present
|
# at this point we check to see if the pkg is no longer present
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
if pkg.startswith('@'):
|
if pkg.startswith('@'):
|
||||||
installed = is_group_env_installed(pkg)
|
installed = is_group_env_installed(pkg, conf_file, installroot=installroot)
|
||||||
else:
|
else:
|
||||||
installed = is_installed(module, repoq, pkg, conf_file, en_repos=en_repos, dis_repos=dis_repos, installroot=installroot)
|
installed = is_installed(module, repoq, pkg, conf_file, en_repos=en_repos, dis_repos=dis_repos, installroot=installroot)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue