Commit f946d27d authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm install: expand package names with arch before isinstall checking and install (eterbug #12332)

parent e951094d
......@@ -608,7 +608,7 @@ epm_install()
# to be filter happy
warmup_lowbase
local names="$(echo $pkg_names | filter_out_installed_packages)"
local names="$(echo $pkg_names | exp_with_arch_suffix | filter_out_installed_packages)"
local files="$(echo $pkg_files | filter_out_installed_packages)"
# can be empty only after skip installed
......
#!/bin/sh
#
# Copyright (C) 2012, 2013, 2015, 2016 Etersoft
# Copyright (C) 2012, 2013, 2015, 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2013, 2015-2017 Etersoft
# Copyright (C) 2012, 2013, 2015-2017 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -21,6 +21,33 @@ load_helper epm-packages
load_helper epm-print
# add suffix .x86_64 if we have 64 arch
exp_with_arch_suffix()
{
local suffix
[ "$($DISTRVENDOR -a)" = "x86_64" ] || { cat ; return ; }
# TODO: it is ok for ALT rpm to remove with this suffix
# TODO: separate install and remove?
case $PMTYPE in
yum-rpm|dnf-rpm)
suffix=".x86_64"
;;
*)
cat
return
;;
esac
# TODO: use estrlist or some function to do it
local str
while read -r str ; do
echo "$str" | grep "$suffix$" && continue
echo "$str$suffix"
done
}
_get_grep_exp()
{
local def="^$1$"
......
......@@ -250,10 +250,13 @@ epm_remove()
return
fi
# TODO: fix pkg_names override
# get full package name(s) from the package file(s)
[ -n "$pkg_files" ] && pkg_names="$pkg_names $(epm query $pkg_files)"
pkg_files=''
[ -n "$pkg_names" ] || fatal "Remove: missing package(s) name."
pkg_names="$(echo $pkg_names | exp_with_arch_suffix)"
if [ -n "$dryrun" ] ; then
info "Packages for removing:"
......
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