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
c538750f
Commit
c538750f
authored
Oct 18, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autoremove: add support for autoremove [libs|python|perl|libs-devel]
parent
54756d39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
14 deletions
+45
-14
TODO
TODO
+0
-2
epm
bin/epm
+1
-1
epm-autoremove
bin/epm-autoremove
+44
-11
No files found.
TODO
View file @
c538750f
...
...
@@ -4,8 +4,6 @@ packages list таск
аналог epm purge: запоминаем список файлов, удаляем пакеты и по возможности всё, от чего зависит (рекурсивно).
epm autoremove [libs|python|perl|libs-devel]
--interactive
встроить вычисление зависимость сюда rpmreqs
...
...
bin/epm
View file @
c538750f
...
...
@@ -256,7 +256,7 @@ check_command()
clean
)
# HELPCMD: clean local package cache
epm_cmd
=
clean
;;
autoremove|package-cleanup
)
# HELPCMD: auto remove unneeded package(s)
autoremove|package-cleanup
)
# HELPCMD: auto remove unneeded package(s)
Supports args for ALT: [libs|python|perl|libs-devel]
epm_cmd
=
autoremove
;;
autoorphans|--orphans
)
# HELPCMD: remove all packages not from the repository
...
...
bin/epm-autoremove
View file @
c538750f
...
...
@@ -25,11 +25,12 @@ __epm_autoremove_altrpm_pp()
#[ -n "$force" ] || info "You can run with --force for more deep removing"
local
force
=
force
local
libexclude
=
"
$1
"
local
flag
=
[
-n
"
$force
"
]
||
libexclude
=
$libexclude
'[^-]*$'
libexclude
=
'^(python-module-|python3-module-|python-modules-|python3-modules|perl-)'
[
-n
"
$force
"
]
||
libexclude
=
$libexclude
'[^-]*$'
showcmd
"apt-cache list-nodeps | grep -E --
\"
$libexclude
\"
"
pkgs
=
$(
apt-cache list-nodeps |
grep
-E
--
"
$libexclude
"
)
...
...
@@ -44,7 +45,7 @@ __epm_autoremove_altrpm_pp()
if
[
-n
"
$flag
"
]
;
then
info
""
info
"call again for next cycle until all modules will be removed"
__epm_autoremove_altrpm_pp
__epm_autoremove_altrpm_pp
"
$libexclude
"
fi
return
0
...
...
@@ -54,8 +55,16 @@ __epm_autoremove_altrpm_lib()
{
local
pkgs
local
nodevel
=
"
$1
"
info
info
"Removing all non -devel/-debuginfo libs packages not need by anything..."
if
[
"
$nodevel
"
=
"nodevel"
]
;
then
info
"Removing all non -devel/-debuginfo libs packages not need by anything..."
local
develrule
=
'-(devel|devel-static)$'
else
info
"Removing all non -debuginfo libs packages (-devel too) not need by anything..."
local
develrule
=
'-(NONONO)$'
fi
#[ -n "$force" ] || info "You can run with --force for more deep removing"
local
force
=
force
...
...
@@ -67,7 +76,8 @@ __epm_autoremove_altrpm_lib()
showcmd
"apt-cache list-nodeps | grep --
\"
$libexclude
\"
"
pkgs
=
$(
apt-cache list-nodeps |
grep
-E
--
"
$libexclude
"
\
|
sed
-e
"s/[-
\.
]32bit
$/
/g"
\
|
grep
-E
-v
--
"-(devel|devel-static|debuginfo)$"
\
|
grep
-E
-v
--
"
$develrule
"
\
|
grep
-E
-v
--
"-(debuginfo)$"
\
|
grep
-E
-v
--
"-(util|utils|tool|tools|plugin|daemon|help)$"
\
|
grep
-E
-v
--
"^(libsystemd|libreoffice|libnss|libvirt-client|libvirt-daemon|libsasl2-plugin|eepm)"
)
...
...
@@ -82,7 +92,7 @@ __epm_autoremove_altrpm_lib()
if
[
-n
"
$flag
"
]
;
then
info
""
info
"call again for next cycle until all libs will be removed"
__epm_autoremove_altrpm_lib
__epm_autoremove_altrpm_lib
$nodevel
fi
return
0
...
...
@@ -91,12 +101,35 @@ __epm_autoremove_altrpm_lib()
__epm_autoremove_altrpm
()
{
local
pkg
local
i
load_helper epm-packages
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
__epm_autoremove_altrpm_pp
__epm_autoremove_altrpm_lib
if
[
-z
"
$pkg_names
"
]
;
then
__epm_autoremove_altrpm_pp
'^(python-module-|python3-module-|python-modules-|python3-modules|perl-)'
__epm_autoremove_altrpm_lib nodevel
return
0
fi
for
i
in
$pkg_names
;
do
case
$i
in
libs
)
__epm_autoremove_altrpm_lib nodevel
;;
python
)
__epm_autoremove_altrpm_pp
'^(python-module-|python3-module-|python-modules-|python3-modules)'
;;
perl
)
__epm_autoremove_altrpm_pp
'^(perl-)'
;;
libs-devel
)
__epm_autoremove_altrpm_lib
;;
*
)
fatal
"autoremove: unsupported '
$i
'. Use libs, python, perl, libs-devel."
;;
esac
done
return
0
}
...
...
@@ -105,8 +138,6 @@ __epm_autoremove_altrpm()
epm_autoremove
()
{
[
-z
"
$pkg_filenames
"
]
||
fatal
"No arguments are allowed here"
case
$DISTRNAME
in
ALTLinux
)
__epm_autoremove_altrpm
...
...
@@ -125,6 +156,8 @@ case $DISTRNAME in
;;
esac
[
-z
"
$pkg_filenames
"
]
||
fatal
"No arguments are allowed here"
case
$PMTYPE
in
apt-dpkg|aptitude-dpkg
)
sudocmd apt-get autoremove
$dryrun
...
...
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