Commit e0bc024b authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve __check_check_vendor and use it in remove too

parent 7e1f5073
......@@ -290,15 +290,7 @@ __epm_check_if_src_rpm()
done
}
__epm_check_vendor()
{
local i
for i in $* ; do
local vendor="$(epm print field Vendor for "$i")"
[ "$vendor" = "ALT Linux Team" ] && continue
warning "You are about install package $i from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages."
noscripts="--noscripts"
done
}
epm_install_files()
......@@ -317,8 +309,7 @@ epm_install_files()
# do not using low-level for install by file path (FIXME: reasons?)
if ! is_dirpath "$@" || [ "$(get_package_type "$@")" = "rpm" ] ; then
# don't check vendor if need run scripts if forced disabled it
[ -n "$scripts$noscripts" ] || __epm_check_vendor $@
__epm_check_vendor $@
sudocmd rpm -Uvh $force $noscripts $nodeps $@ && save_installed_packages $@ && return
local RES=$?
# TODO: check rpm result code and convert it to compatible format if possible
......
......@@ -33,7 +33,8 @@ epm_remove_low()
case $PMTYPE in
*-rpm)
cd /tmp || fatal
sudocmd rpm -ev $nodeps $@
__epm_check_vendor $@
sudocmd rpm -ev $noscripts $nodeps $@
# keep status
#cd - >/dev/null
return ;;
......
......@@ -67,3 +67,19 @@ get_only_installed_packages()
estrlist exclude "$(echo "$installlist" | (skip_installed='yes' filter_out_installed_packages))" "$installlist"
}
# Args: package names. Set noscripts for outside packages.
__epm_check_vendor()
{
# don't check vendor if there are forced script options
[ -n "$scripts$noscripts" ] && return
local i
for i in $* ; do
local vendor
vendor="$(epm print field Vendor for "$i" 2>/dev/null)" || continue
# TODO: check GPG
[ "$vendor" = "ALT Linux Team" ] && continue
warning "Scripts are disabled for package $i from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages."
noscripts="--noscripts"
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