Fix __package_yum explorer
Why: In case when name contains package name with exact version specified (e.g. rpm-build-4.11.3) ``` rpm -q --whatprovides "$pkg_name" ``` will tell you that no package could provide you with 'rpm-build-4.11.3', because it's not virtual or file-provide, but exact package name. This will lead to the installation of the package which was already installed. It slows down manifest execution a lot. My change will keep previous behaviour which relies on --whatprovides and will fix wrong behaviour when argument is full package name with version.
This commit is contained in:
parent
ab696a8cb8
commit
b3a4152e00
2 changed files with 9 additions and 4 deletions
|
@ -27,4 +27,4 @@ else
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rpm -q --whatprovides "$name" 2>/dev/null || true
|
rpm -q "$name" 2>/dev/null || rpm -q --whatprovides "$name" 2>/dev/null || true
|
||||||
|
|
|
@ -43,13 +43,18 @@ else
|
||||||
opts="--assumeyes --quiet"
|
opts="--assumeyes --quiet"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
not_installed="^no package provides"
|
not_provided="^no package provides"
|
||||||
|
not_installed='is not installed$'
|
||||||
|
|
||||||
|
if grep -q "$not_provided" "$__object/explorer/pkg_version"; then
|
||||||
if grep -q "$not_installed" "$__object/explorer/pkg_version"; then
|
if grep -q "$not_installed" "$__object/explorer/pkg_version"; then
|
||||||
state_is="absent"
|
state_is="absent"
|
||||||
else
|
else
|
||||||
state_is="present"
|
state_is="present"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
state_is="present"
|
||||||
|
fi
|
||||||
|
|
||||||
[ "$state_is" = "$state_should" ] && exit 0
|
[ "$state_is" = "$state_should" ] && exit 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue