Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
fecec172
Commit
fecec172
authored
Oct 10, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separate filter_out_installed_packages to standalone file epm-sh-install
parent
d4a93dc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
41 deletions
+72
-41
epm-install
bin/epm-install
+2
-40
epm-sh-install
bin/epm-sh-install
+69
-0
epm-upgrade
bin/epm-upgrade
+1
-1
No files found.
bin/epm-install
View file @
fecec172
...
...
@@ -18,52 +18,13 @@
#
load_helper epm-sh-altlinux
load_helper epm-sh-install
load_helper epm-query
load_helper epm-assure
load_helper epm-repack
load_helper epm-check_updated_repo
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
filter_out_installed_packages
()
{
[
-z
"
$skip_installed
"
]
&&
cat
&&
return
case
$PMTYPE
in
yum-rpm|dnf-rpm
)
if
[
"
$(
$DISTRVENDOR
-a
)
"
=
"x86_64"
]
;
then
# 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
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)
#"deb")
# LANG=C LC_ALL=C xargs -n1 dpkg -l 2>&1 | grep -i 'no packages found matching' |
# sed -e 's|\.\+$||g' -e 's|^.*[Nn]o packages found matching \(.*\)|\1|g'
# ;;
*
)
# shellcheck disable=SC2013
for
i
in
$(
cat
)
;
do
is_installed
$i
||
echo
$i
done
;;
esac
|
sed
-e
"s|rpm-build-altlinux-compat[^ ]*||g"
| filter_strip_spaces
}
# for zypper before SUSE/11.0
__use_zypper_no_gpg_checks
()
...
...
@@ -591,6 +552,7 @@ epm_install()
# to be filter happy
warmup_lowbase
# Note: filter_out_installed_packages depends on skip_installed flag
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
)
"
...
...
bin/epm-sh-install
0 → 100644
View file @
fecec172
#!/bin/sh
#
# Copyright (C) 2012-2020 Etersoft
# Copyright (C) 2012-2020 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-sh-altlinux
load_helper epm-query
__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'
}
# pass only uninstalled packages
filter_out_installed_packages
()
{
[
-z
"
$skip_installed
"
]
&&
cat
&&
return
case
$PMTYPE
in
yum-rpm|dnf-rpm
)
if
[
"
$(
$DISTRVENDOR
-a
)
"
=
"x86_64"
]
;
then
# 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
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)
#"deb")
# LANG=C LC_ALL=C xargs -n1 dpkg -l 2>&1 | grep -i 'no packages found matching' |
# sed -e 's|\.\+$||g' -e 's|^.*[Nn]o packages found matching \(.*\)|\1|g'
# ;;
*
)
# shellcheck disable=SC2013
for
i
in
$(
cat
)
;
do
is_installed
$i
||
echo
$i
done
;;
esac
|
sed
-e
"s|rpm-build-altlinux-compat[^ ]*||g"
| filter_strip_spaces
}
get_only_installed_packages
()
{
local
installlist
=
"
$*
"
estrlist exclude
"
$(
echo
"
$installlist
"
|
(
skip_installed
=
'yes'
filter_out_installed_packages
)
)"
"
$installlist
"
}
bin/epm-upgrade
View file @
fecec172
...
...
@@ -43,7 +43,7 @@ epm_upgrade()
installlist
=
"
$(
estrlist reg_exclude
".*-devel .*-devel-static"
"
$installlist
"
)
"
[
-n
"
$verbose
"
]
&&
info
"Packages from task(s):
$installlist
"
# install only installed packages (simulate upgrade packages)
installlist
=
"
$(
estrlist exclude
"
$(
echo
"
$installlist
"
|
(
skip_installed
=
'yes'
filter_out_installed_packages
)
)"
"
$installlist
"
)
"
#
"
installlist
=
"
$(
get_only_installed_packages
"
$installlist
"
)
"
[
-n
"
$verbose
"
]
&&
info
"Packages to upgrade:
$installlist
"
(
pkg_names
=
"
$installlist
"
epm_Install
)
epm_removerepo
"
$pkg_names
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment