Commit 966238e4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm install: add warning when install non ALT packages

parent b2154a1f
...@@ -328,13 +328,16 @@ epm_install_files() ...@@ -328,13 +328,16 @@ epm_install_files()
case "$BASEDISTRNAME" in case "$BASEDISTRNAME" in
"alt") "alt")
# on ALT install target can be a real path
# do not use low-level for install by file path (f.i. epm install /usr/bin/git) # do not use low-level for install by file path (f.i. epm install /usr/bin/git)
if __epm_if_command_path $files ; then if __epm_if_command_path $files ; then
epm_install_names $files epm_install_names $files
return return
fi fi
# on ALT install target can be a real path __epm_print_warning_for_nonalt_packages $files
# do repack if needed
if __epm_repack_if_needed $files ; then if __epm_repack_if_needed $files ; then
[ -n "$repacked_pkgs" ] || fatal "Can't convert $files" [ -n "$repacked_pkgs" ] || fatal "Can't convert $files"
files="$repacked_pkgs" files="$repacked_pkgs"
......
...@@ -115,6 +115,27 @@ __epm_get_pkgvendor() ...@@ -115,6 +115,27 @@ __epm_get_pkgvendor()
epm print field Vendor for "$pkg" 2>/dev/null epm print field Vendor for "$pkg" 2>/dev/null
} }
__epm_print_warning_for_nonalt_packages()
{
# only ALT
[ "$BASEDISTRNAME" = "alt" ] || return 0
local i
for i in $* ; do
local vendor
# TODO: check only for rpm
vendor="$(__epm_get_pkgvendor "$i")"
local packager="$(epm print field Packager for "$i" 2>/dev/null)"
# TODO: check GPG or some other mark
echo "$packager" | grep -q "@altlinux" && [ "$vendor" = "ALT Linux Team" ] && return 0
warning "%%% You are trying install package $i not from ALT repository. Be careful! %%%"
done
}
# Args: package names. Set noscripts for outside packages. # Args: package names. Set noscripts for outside packages.
__epm_check_vendor() __epm_check_vendor()
{ {
......
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