Commit 103eef1b authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve --skip-installed on x86_64 Fedora based: check for noarch too

parent 2855d1c3
...@@ -23,15 +23,32 @@ load_helper epm-assure ...@@ -23,15 +23,32 @@ load_helper epm-assure
load_helper epm-check_updated_repo load_helper epm-check_updated_repo
load_helper epm-sh-warmup load_helper epm-sh-warmup
__fast_hack_for_filter_out_installed_rpm()
{
LANG=C LC_ALL=C xargs -n1 rpm -q 2>&1 | grep 'is not installed' |
sed -e 's|^.*package \(.*\) is not installed.*|\1|g'
}
# TODO: use when run install with epm --skip-installed install # TODO: use when run install with epm --skip-installed install
filter_out_installed_packages() filter_out_installed_packages()
{ {
[ -z "$skip_installed" ] && cat && return [ -z "$skip_installed" ] && cat && return
case $PKGFORMAT in case $PMTYPE in
"rpm") yum-rpm|dnf-rpm)
LANG=C LC_ALL=C xargs -n1 rpm -q 2>&1 | grep 'is not installed' | if [ "$($DISTRVENDOR -a)" = "x86_64" ] ; then
sed -e 's|^.*package \(.*\) is not installed.*|\1|g' # shellcheck disable=SC2013
for i in $(cat) ; do
is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue
is_installed "$(__print_with_arch_suffix $i .noarch)" && continue
is_installed $i || echo $i
done
else
__fast_hack_for_filter_out_installed_rpm
fi
;;
*-rpm)
__fast_hack_for_filter_out_installed_rpm
;; ;;
# dpkg -l lists some non ii status (un, etc) # dpkg -l lists some non ii status (un, etc)
#"deb") #"deb")
......
...@@ -20,6 +20,18 @@ ...@@ -20,6 +20,18 @@
load_helper epm-packages load_helper epm-packages
load_helper epm-print load_helper epm-print
# pkg suffix
__print_with_arch_suffix()
{
local pkg="$1"
local suffix="$2"
# do not change if some suffix already exists
echo "$pkg" | grep -q "(x86-32)$" && echo "$pkg" | sed -e "s|(x86-32)$|.i686|" && return
echo "$pkg" | grep "\.x86_64$" && return
echo "$pkg" | grep "\.noarch$" && return
echo "$pkg" | grep "\.i[56]86$" && return
echo "$pkg$suffix"
}
# add suffix .x86_64 if we have 64 arch # add suffix .x86_64 if we have 64 arch
exp_with_arch_suffix() exp_with_arch_suffix()
...@@ -42,11 +54,7 @@ exp_with_arch_suffix() ...@@ -42,11 +54,7 @@ exp_with_arch_suffix()
# TODO: use estrlist or some function to do it # TODO: use estrlist or some function to do it
local pkg local pkg
for pkg in $(cat) ; do for pkg in $(cat) ; do
# do not change if some suffix already exists __print_with_arch_suffix $pkg $suffix
echo "$pkg" | grep -q "(x86-32)$" && echo "$pkg" | sed -e "s|(x86-32)$|.i686|" && continue
echo "$pkg" | grep "\.x86_64$" && continue
echo "$pkg" | grep "\.i[56]86$" && continue
echo "$pkg$suffix"
done done
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment