3
# Copyright (C) 2012-2020 Etersoft
4
# Copyright (C) 2012-2020 Vitaly Lipatov <lav@etersoft.ru>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
load_helper epm-sh-altlinux
23
__fast_hack_for_filter_out_installed_rpm()
25
LC_ALL=C xargs -n1 rpm -q 2>&1 | grep 'is not installed' |
26
sed -e 's|^.*package \(.*\) is not installed.*|\1|g'
29
# pass only uninstalled packages
30
filter_out_installed_packages()
32
[ -z "$skip_installed" ] && cat && return
36
if [ "$DISTRARCH" = "x86_64" ] && [ "$DISTRNAME" != "ROSA" ] ; then
37
# shellcheck disable=SC2013
39
is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue
40
is_installed "$(__print_with_arch_suffix $i .noarch)" && continue
44
__fast_hack_for_filter_out_installed_rpm
48
__fast_hack_for_filter_out_installed_rpm
50
# dpkg -l lists some non ii status (un, etc)
52
# LANG=C LC_ALL=C xargs -n1 dpkg -l 2>&1 | grep -i 'no packages found matching' |
53
# sed -e 's|\.\+$||g' -e 's|^.*[Nn]o packages found matching \(.*\)|\1|g'
56
# shellcheck disable=SC2013
58
is_installed $i || echo $i
61
esac | sed -e "s|rpm-build-altlinux-compat[^ ]*||g" | filter_strip_spaces
64
get_only_installed_packages()
66
local installlist="$*"
67
estrlist exclude "$(echo "$installlist" | (skip_installed='yes' filter_out_installed_packages))" "$installlist"
71
__epm_print_warning_for_nonalt_packages()
73
[ -n "$dryrun" ] && return 0
75
[ "$BASEDISTRNAME" = "alt" ] || return 0
78
[ -n "$save_only$download_only" ] && return 0
80
load_helper epm-status
84
if epm_status_repacked "$i" ; then
85
warning "%%% You are trying install package $i repacked from third-party software source. Use it at your own risk. %%%"
89
if epm_status_thirdparty "$i" ; then
90
warning "%%% You are trying install package $i from third-party software source. Use it at your own risk. %%%"
94
if ! epm_status_original "$i" ; then
95
warning "%%% You are trying install package $i not from official $DISTRNAME/$DISTRVERSION repository. Use it at your own risk. %%%"
101
# Args: package names. Set noscripts for outside packages.
104
# don't check vendor if there are forced script options
105
[ -n "$scripts$noscripts" ] && return
106
[ -n "$dryrun" ] && return 0
109
[ "$BASEDISTRNAME" = "alt" ] || return 0
111
load_helper epm-status
116
if ! epm_status_validate "$i" ; then
117
# it is missed package probably (package remove case)
118
if is_installed "$i" ; then
119
warning "Can't get any info for $i package. Scripts are DISABLED for package $bi. Use --scripts if you need run scripts from such packages."
121
noscripts="--noscripts"
126
vendor="$(epm print field Vendor for "$i")"
128
if [ -z "$vendor" ] ; then
129
warning "Can't get info about vendor for $i package. Scripts are DISABLED for package $bi. Use --scripts if you need run scripts from such packages."
130
noscripts="--noscripts"
134
epm_status_original "$i" && continue
135
epm_status_repacked "$i" && continue
137
if __epm_vendor_ok_scripts "$vendor" ; then
138
warning "Scripts are ENABLED for package $bi from outside vendor '$vendor' (this vendor is listed in $CONFIGDIR/vendorallowscripts.list). Use --noscripts if you need disable scripts in such packages."
142
if __epm_package_ok_scripts "$i" ; then
143
warning "Scripts are ENABLED for package $bi from outside vendor '$vendor' (the package is listed in $CONFIGDIR/pkgallowscripts.list). Use --noscripts if you need disable scripts in such packages."
146
warning "Scripts are DISABLED for package $bi from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages."
147
noscripts="--noscripts"