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
Vladislav
eepm
Commits
418a4968
Commit
418a4968
authored
Aug 15, 2019
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p8 as 2.5.10-alt0.M80P.1 (with rpmbph script)
parents
037462aa
47232fca
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
191 additions
and
81 deletions
+191
-81
README.md
README.md
+37
-23
epm
bin/epm
+4
-1
epm-autoorphans
bin/epm-autoorphans
+1
-1
epm-autoremove
bin/epm-autoremove
+1
-1
epm-check
bin/epm-check
+1
-29
epm-dedup
bin/epm-dedup
+68
-0
epm-release_upgrade
bin/epm-release_upgrade
+60
-19
epm-search
bin/epm-search
+1
-1
epm-search_file
bin/epm-search_file
+1
-1
epm-sh-functions
bin/epm-sh-functions
+4
-3
eepm.spec
eepm.spec
+13
-2
No files found.
README.md
View file @
418a4968
Etersoft EPM package manager README
#
Etersoft EPM package manager README
Really, EPM is a wrapper for any package manager used in your operating system.
Run $ epm --help for check all support commands.
Run
```
$ epm --help
```
to see list of all supported commands.
The main goal of the project
—
provide the same package management interface
on a
ny platform
.
The main goal of the project
is to
provide the same package management interface
on a
ll platforms
.
You can use
```
# epmi NAME
```
or
```
# epm -i NAME
```
or
```
# epm install NAME
for install package. It is just aliases for one command: install of the package.
EEPM will run urpmi on Mandriva, apt-get install on Ubuntu, yum install on Fedora.
And it have a little intelligence, so EEPM will try install file with package via
low level commands (rpm or dpkg) before use hi level commands (yum, apt).
```
to install a package. It is just an alias for one command: install the package.
EEPM will run
`urpmi`
on Mandriva,
`apt-get install`
on Ubuntu,
`yum install`
on Fedora.
And it has a little intelligence, so EEPM will first try to install a package file via
low level commands (
`rpm`
or
`dpkg`
) before using higher level commands (
`yum`
,
`apt`
).
Just try your comfort style for package management and
save
your experience the same
on
any platform. EEPM will print out any real command it uses so you can learn from it.
Just try your comfort style for package management and
carry
your experience the same
to
any platform. EEPM will print out any real command it uses so you can learn from it.
Also EEPM has initial support for
control repositories
: list, add, remove, update
Also EEPM has initial support for
repository management
: list, add, remove, update
Pay attention to
follow
useful commands:
epmqf
- query package(s) owning file
epmqp
- search in the list of installed packages
Pay attention to
the following
useful commands:
*
`epmqf`
- query package(s) owning file
*
`epmqp`
- search in the list of installed packages
epmqf helps get package name for any file or command in the system:
`epmqf`
can be helpful to get package name for any file or command in the system:
```
$ epmqf epmqf
Note: epmqf is placed as /usr/bin/epmqf
$ rpm -qf /usr/bin/epmqf
...
...
@@ -36,20 +47,23 @@ Note: /usr/bin/epmqf is link to epm
Note: epm is placed as /usr/bin/epm
$ rpm -qf /usr/bin/epm
eepm-1.1.0-alt2
```
== Install on any system ==
## Install on any system
Just run under root user:
```
# curl -s https://raw.githubusercontent.com/Etersoft/eepm/master/packed/epm.sh | bash /dev/stdin ei --auto
```
== How to add new distro support ==
1.
Fix detection with
distr_info
2.
Add distro support in
set_pm_type
function
3.
Realize
every command in epm-
*
files
4.
Check epm packages and epm --short packages
works correctly
(
epm package 'awk' have to print packages with awk
substring in their names)
## How to add new distro support
1.
Fix detection with
`distr_info`
2.
Add distro support in
`set_pm_type`
function
3.
Implement
every command in epm-
*
files
4.
Ensure that
`epm packages`
and
`epm --short packages`
works correctly
(
`epm package 'awk'`
has to print packages with
`awk`
substring in their names)
See detailed description in
r
ussian at
See detailed description in
R
ussian at
http://wiki.etersoft.ru/Epm
Please e-mail me:
...
...
bin/epm
View file @
418a4968
...
...
@@ -67,7 +67,7 @@ print_version()
{
echo
"EPM package manager version @VERSION@"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Copyright (c) Etersoft 2012-201
8
"
echo
"Copyright (c) Etersoft 2012-201
9
"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
}
...
...
@@ -199,6 +199,9 @@ check_command()
check|fix|verify
)
# HELPCMD: check local package base integrity and fix it
epm_cmd
=
check
;;
dedup
)
# HELPCMD: remove unallowed duplicated pkgs (after upgrade crash)
epm_cmd
=
dedup
;;
-cl
|
cl|changelog
)
# HELPCMD: show changelog for package
epm_cmd
=
changelog
;;
...
...
bin/epm-autoorphans
View file @
418a4968
...
...
@@ -31,7 +31,7 @@ epm_autoorphans()
case
$PMTYPE
in
apt-rpm
)
# ALT Linux only
assure_exists /
etc/buildreqs/files/ignore.d/apt-scripts
apt-scripts
assure_exists /
usr/share/apt/scripts/list-extras.lua
apt-scripts
if
[
-z
"
$dryrun
"
]
;
then
echo
"We will try remove all installed packages which are missed in repositories"
warning
"Use with caution!"
...
...
bin/epm-autoremove
View file @
418a4968
...
...
@@ -132,7 +132,7 @@ __epm_autoremove_altrpm()
{
local
i
load_helper epm-packages
assure_exists /
etc/buildreqs/files/ignore.d/apt-scripts
apt-scripts
assure_exists /
usr/share/apt/scripts/list-nodeps.lua
apt-scripts
if
[
-z
"
$pkg_names
"
]
;
then
__epm_autoremove_altrpm_pp
'^(python-module-|python3-module-|python-modules-|python3-modules|perl-)'
...
...
bin/epm-check
View file @
418a4968
...
...
@@ -17,34 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# remove duplicates
try_fix_apt_rpm_dupls
()
{
info
"Check for duplicates ..."
local
TESTPKG
=
"ignoreflock"
local
has_testpkg
=
""
if
epm
--quiet
installed
$TESTPKG
;
then
has_testpkg
=
1
sudocmd epm remove
--auto
$TESTPKG
||
return
fi
local
PKGLIST
PKGLIST
=
$(
LANG
=
C
$SUDO
apt-get
install
$TESTPKG
2>&1 |
grep
"W: There are multiple versions of"
|
\
sed
-e
's|W: There are multiple versions of "\(.*\)" in your system.|\1|'
)
local
TODEL
for
i
in
$PKGLIST
;
do
local
pkg
=
${
i
/.32bit/
}
local
todel
=
"
$(
rpm
-q
$pkg
|
head
-n1
)
"
local
todel2
=
"
$(
rpm
-q
$pkg
|
head
-n2
|
tail
-n1
)
"
if
[
"
$todel
"
=
"
$todel2
"
]
;
then
echo
"Fix the same name duplicates for
$pkg
..."
sudocmd rpm
-e
"
$todel
"
--allmatches
--nodeps
&&
epm
install
$pkg
&&
continue
fi
sudocmd rpm
-e
"
$todel
"
||
TODEL
=
"
$TODEL
$todel
"
done
[
-n
"
$TODEL
"
]
&&
sudocmd rpm
-e
"
$TODEL
"
[
-n
"
$has_testpkg
"
]
&&
epm
install
$TESTPKG
}
epm_check
()
{
case
$PMTYPE
in
...
...
@@ -52,7 +24,7 @@ case $PMTYPE in
#sudocmd apt-get check || exit
#sudocmd apt-get update || exit
sudocmd apt-get
-f
install
||
return
try_fix_apt_rpm_dupls
info
"You can use epm dedup also"
;;
apt-dpkg
)
#sudocmd apt-get check || exit
...
...
bin/epm-dedup
0 → 100644
View file @
418a4968
#!/bin/sh
#
# Copyright (C) 2019 Etersoft
# Copyright (C) 2019 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/>.
#
# remove duplicates
try_fix_apt_rpm_dupls
()
{
info
"Check for duplicates (internal implementation) ..."
local
TESTPKG
=
"ignoreflock"
local
has_testpkg
=
""
if
epm
--quiet
installed
$TESTPKG
;
then
has_testpkg
=
1
sudocmd epm remove
--auto
$TESTPKG
||
return
fi
local
PKGLIST
PKGLIST
=
$(
LANG
=
C
$SUDO
apt-get
install
$TESTPKG
2>&1 |
grep
"W: There are multiple versions of"
|
\
sed
-e
's|W: There are multiple versions of "\(.*\)" in your system.|\1|'
)
local
TODEL
for
i
in
$PKGLIST
;
do
local
pkg
=
${
i
/.32bit/
}
local
todel
=
"
$(
rpm
-q
$pkg
|
head
-n1
)
"
local
todel2
=
"
$(
rpm
-q
$pkg
|
head
-n2
|
tail
-n1
)
"
if
[
"
$todel
"
=
"
$todel2
"
]
;
then
echo
"Fix the same name duplicates for
$pkg
..."
sudocmd rpm
-e
"
$todel
"
--allmatches
--nodeps
--justdb
&&
epm
install
$pkg
&&
continue
fi
# first use older package
[
"
$(
rpmevrcmp
"
$todel
"
"
$todel2
"
)
"
=
"1"
]
&&
todel
=
"
$todel2
"
sudocmd rpm
-e
"
$todel
"
||
TODEL
=
"
$TODEL
$todel
"
done
[
-n
"
$TODEL
"
]
&&
sudocmd rpm
-e
"
$TODEL
"
[
-n
"
$has_testpkg
"
]
&&
epm
install
$TESTPKG
}
epm_dedup
()
{
case
$PMTYPE
in
apt-rpm
)
# ALT Linux only
assure_exists /usr/share/apt/scripts apt-scripts
if
[
-f
/usr/share/apt/scripts/dedup.lua
]
;
then
"Check for duplicates via apt-get dedup from apt-scripts"
sudocmd apt-get dedup
else
try_fix_apt_rpm_dupls
fi
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
bin/epm-release_upgrade
View file @
418a4968
#!/bin/sh
#
# Copyright (C) 2013, 2016, 2017 Etersoft
# Copyright (C) 2013, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2013, 2016, 2017
, 2019
Etersoft
# Copyright (C) 2013, 2016, 2017
, 2019
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
...
...
@@ -82,10 +82,17 @@ __replace_alt_version_in_repo()
__alt_repofix
()
{
local
TO
=
"
$1
"
load_helper epm-repofix
showcmd epm repofix
quiet
=
1
pkg_filenames
=
''
epm_repofix
>
/dev/null
__replace_text_in_alt_repo
"/^ *#/! s!
\[
[tpc][6-9]
\]
![updates]!g"
# replace sign name
if
[
-n
"
$TO
"
]
;
then
__replace_text_in_alt_repo
"/^ *#/! s!
\[
alt
\]
![
$TO
]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
sisyphus
\]
![
$TO
]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![
$TO
]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
[tpc][6-9]
\]
![
$TO
]!g"
fi
}
__get_conflict_release_pkg
()
...
...
@@ -140,21 +147,20 @@ get_fix_release_pkg()
__update_to_the_distro
()
{
local
TO
=
"
$1
"
__alt_repofix
case
"
$TO
"
in
p7
)
__alt_repofix
docmd epm update
||
fatal
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
||
fatal
"Check an error and run epm release-upgrade again"
__alt_repofix
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![
$TO
]!g"
__alt_repofix
$TO
docmd epm update
||
fatal
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade again"
;;
p8
)
__alt_repofix
docmd epm update
||
fatal
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
||
fatal
"Check an error and run epm release-upgrade again"
__alt_repofix
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![
$TO
]!g"
__alt_repofix
$TO
docmd epm update
||
fatal
# sure we have systemd if systemd is running
if
is_installed systemd
&&
is_active_systemd systemd
;
then
...
...
@@ -162,12 +168,23 @@ __update_to_the_distro()
fi
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade again"
;;
p9
)
#docmd epm update || fatal
#docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run epm release-upgrade again"
__alt_repofix
$TO
docmd epm update
||
fatal
# sure we have systemd if systemd is running
#if is_installed systemd && is_active_systemd systemd ; then
# docmd epm install systemd || fatal
#fi
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade again"
;;
Sisyphus
)
__alt_repofix
docmd epm update
||
fatal
local
ADDPKG
ADDPKG
=
$(
epm
-q
--short
make-initrd sssd-ad 2>/dev/null
)
docmd epm
install
librpm7 librpm rpm apt
$ADDPKG
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
ConsoleKit2-
||
fatal
"Check an error and run again"
#docmd apt-get upgrade || fatal "Check an error and run epm release-upgrade or just epm upgrade again"
#local ADDPKG
#ADDPKG=$(epm -q --short make-initrd sssd-ad 2>/dev/null)
#docmd epm install librpm7 librpm rpm apt $ADDPKG "$(get_fix_release_pkg --force "$TO")" ConsoleKit2- || fatal "Check an error and run again"
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade or just epm upgrade again"
;;
*
)
...
...
@@ -186,6 +203,7 @@ __update_alt_to_next_distro()
TO
=
"p7"
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__replace_alt_version_in_repo
"Sisyphus/"
"
$TO
/branch/"
__replace_alt_version_in_repo
"
$FROM
/branch/"
"
$TO
/branch/"
__update_to_the_distro
"
$TO
"
docmd epm update-kernel
...
...
@@ -196,6 +214,17 @@ __update_alt_to_next_distro()
TO
=
"p8"
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__replace_alt_version_in_repo
"Sisyphus/"
"
$TO
/branch/"
__replace_alt_version_in_repo
$FROM
/branch/
$TO
/branch/
__update_to_the_distro
$TO
docmd epm update-kernel
||
fatal
info
"Done."
;;
"p8"
|
"p8 p9"
|
"t8 p9"
|
"c8 c9"
|
"p9 p9"
)
TO
=
"p9"
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__replace_alt_version_in_repo
"Sisyphus/"
"
$TO
/branch/"
__replace_alt_version_in_repo
$FROM
/branch/
$TO
/branch/
__update_to_the_distro
$TO
docmd epm update-kernel
||
fatal
...
...
@@ -206,19 +235,28 @@ __update_alt_to_next_distro()
confirm_info
"Downgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__replace_alt_version_in_repo
"
$FROM
/"
"
$TO
/branch/"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
alt
\]
![
$TO
]!g"
#__replace_text_in_alt_repo "/^ *#/! s!\[alt\]![$TO]!g"
__update_to_the_distro
$TO
docmd epm downgrade
||
fatal
info
"Done."
;;
"Sisyphus p9"
)
TO
=
"p9"
confirm_info
"Downgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__replace_alt_version_in_repo
"
$FROM
/"
"
$TO
/branch/"
#__replace_text_in_alt_repo "/^ *#/! s!\[alt\]![$TO]!g"
__update_to_the_distro
$TO
docmd epm downgrade
||
fatal
info
"Done."
;;
"p8 Sisyphus"
|
"Sisyphus Sisyphus"
)
"p8 Sisyphus"
|
"
p9 Sisyphus"
|
"
Sisyphus Sisyphus"
)
TO
=
"Sisyphus"
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
docmd epm upgrade
||
fatal
__replace_alt_version_in_repo
"
$FROM
/branch/"
"
$TO
/"
__alt_repofix
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![alt]!g"
__alt_repofix
"sisyphus"
__update_to_the_distro
$TO
docmd epm update-kernel
||
fatal
info
"Done."
...
...
@@ -258,15 +296,18 @@ epm_release_upgrade()
fi
fi
__alt_repofix
# check forced target
if
[
-n
"
$pkg_filenames
"
]
;
then
[
"
$(
__wcount
$pkg_filenames
)
"
=
"1"
]
||
fatal
"Too many args:
$pkg_filenames
"
fi
TARGET
=
"
$pkg_filenames
"
__alt_repofix
# TODO: ask before upgrade
__update_alt_to_next_distro
$DISTRVERSION
$
pkg_filenames
__update_alt_to_next_distro
$DISTRVERSION
$
TARGET
return
;;
*
)
...
...
bin/epm-search
View file @
418a4968
...
...
@@ -60,7 +60,7 @@ case $PMTYPE in
CMD
=
"dnf search --"
;;
zypper-rpm
)
CMD
=
"zypper search --"
CMD
=
"zypper search -
d -
-"
;;
mpkg
)
CMD
=
"mpkg search"
...
...
bin/epm-search_file
View file @
418a4968
...
...
@@ -75,7 +75,7 @@ case $PMTYPE in
CMD
=
"urpmf"
;;
zypper-rpm
)
CMD
=
"zypper
wp vi
"
CMD
=
"zypper
search --file-list
"
;;
pacman
)
CMD
=
"pacman -Qo"
...
...
bin/epm-sh-functions
View file @
418a4968
...
...
@@ -558,11 +558,12 @@ is_active_systemd()
SYSTEMD_CGROUP_DIR
=
/sys/fs/cgroup/systemd
[
-x
"
$SYSTEMCTL
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
''
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
readlink
/sbin/init |
grep
-q
'systemd'
||
return
#a='' mountpoint -q "$SYSTEMD_CGROUP_DIR" || return
cat
/proc/1/cmdline |
grep
-q
'systemd'
||
return
#readlink /sbin/init | grep -q 'systemd' || return
# some hack
# shellcheck disable=SC2009
ps ax |
grep
'[s]ystemd'
|
grep
-q
-v
'systemd-udev'
#
ps ax | grep '[s]ystemd' | grep -q -v 'systemd-udev'
}
assure_distr
()
...
...
eepm.spec
View file @
418a4968
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 2.5.
8
Version: 2.5.
10
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
...
...
@@ -90,9 +90,20 @@ rm -f %buildroot%_datadir/%name/tools_eget
%_sysconfdir/bash_completion.d/cerv
%changelog
* T
ue Mar 26 2019 Vitaly Lipatov <lav@altlinux.ru> 2.5.8
-alt0.M80P.1
* T
hu Aug 15 2019 Vitaly Lipatov <lav@altlinux.ru> 2.5.10
-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
* Thu Aug 15 2019 Vitaly Lipatov <lav@altlinux.ru> 2.5.10-alt1
- move dedup code to the separate command
- epm dedup: add apt-get dedup from apt-get dedup support
- epm search: improve for zypper
- release_upgrade: rewrite to p9 upgrade support
* Fri May 17 2019 Vitaly Lipatov <lav@altlinux.ru> 2.5.9-alt1
- epm-check: use rpmevrcmp to delete old versions
- epm-sh-functions: improve systemd detection (docker support)
- support release upgrade for p9
* Tue Mar 26 2019 Vitaly Lipatov <lav@altlinux.ru> 2.5.8-alt1
- add trueconf-client repack config
- epm: set timeout for 2 secs
...
...
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