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
964e8196
Commit
964e8196
authored
Apr 20, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p8 as 1.7.2-alt0.M80P.1 (with rpmbph script)
parents
216e67c1
f4ade02e
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
210 additions
and
56 deletions
+210
-56
distr_info
bin/distr_info
+8
-1
epm-install
bin/epm-install
+6
-0
epm-kernel_update
bin/epm-kernel_update
+5
-0
epm-packages
bin/epm-packages
+3
-0
epm-query_package
bin/epm-query_package
+5
-0
epm-reinstall
bin/epm-reinstall
+3
-0
epm-release_upgrade
bin/epm-release_upgrade
+8
-6
epm-remove
bin/epm-remove
+3
-0
epm-search
bin/epm-search
+3
-0
epm-sh-functions
bin/epm-sh-functions
+15
-0
epm-update
bin/epm-update
+3
-0
serv
bin/serv
+0
-12
eepm.spec
eepm.spec
+19
-2
epm.sh
packed/epm.sh
+105
-21
serv.sh
packed/serv.sh
+24
-14
No files found.
bin/distr_info
View file @
964e8196
...
@@ -51,6 +51,7 @@ pkgtype()
...
@@ -51,6 +51,7 @@ pkgtype()
gentoo
)
echo
"tbz2"
;;
gentoo
)
echo
"tbz2"
;;
windows
)
echo
"exe"
;;
windows
)
echo
"exe"
;;
android
)
echo
"apk"
;;
android
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
cygwin
)
echo
"tar.xz"
;;
cygwin
)
echo
"tar.xz"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
...
@@ -89,9 +90,10 @@ if distro altlinux-release ; then
...
@@ -89,9 +90,10 @@ if distro altlinux-release ; then
if
has Sisyphus
;
then
DISTRIB_RELEASE
=
"Sisyphus"
if
has Sisyphus
;
then
DISTRIB_RELEASE
=
"Sisyphus"
elif
has
"ALT Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux 6.
0
"
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux p8"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux p8"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux p7"
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux p7"
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux p6"
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux p6"
;
then
DISTRIB_RELEASE
=
"p6"
...
@@ -130,6 +132,11 @@ elif distro slackware-version ; then
...
@@ -130,6 +132,11 @@ elif distro slackware-version ; then
DISTRIB_ID
=
"Slackware"
DISTRIB_ID
=
"Slackware"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
[
0-9]+
\.
[
0-9]+
$DISTROFILE
)
"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
[
0-9]+
\.
[
0-9]+
$DISTROFILE
)
"
elif
distro os-release
&&
which apk 2>/dev/null
>
/dev/null
;
then
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"
$ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro arch-release
;
then
elif
distro arch-release
;
then
DISTRIB_ID
=
"ArchLinux"
DISTRIB_ID
=
"ArchLinux"
DISTRIB_RELEASE
=
"2010"
DISTRIB_RELEASE
=
"2010"
...
...
bin/epm-install
View file @
964e8196
...
@@ -163,6 +163,9 @@ epm_install_names()
...
@@ -163,6 +163,9 @@ epm_install_names()
nix
)
nix
)
__separate_sudocmd
"nix-env --install"
"nix-env --upgrade"
$@
__separate_sudocmd
"nix-env --install"
"nix-env --upgrade"
$@
return
;;
return
;;
apk
)
sudocmd apk add
$@
return
;;
guix
)
guix
)
__separate_sudocmd
"guix package -i"
"guix package -i"
$@
__separate_sudocmd
"guix package -i"
"guix package -i"
$@
return
;;
return
;;
...
@@ -231,6 +234,9 @@ epm_ni_install_names()
...
@@ -231,6 +234,9 @@ epm_ni_install_names()
nix
)
nix
)
sudocmd nix-env
--install
$@
sudocmd nix-env
--install
$@
return
;;
return
;;
apk
)
sudocmd apk add
$@
return
;;
#android)
#android)
# sudocmd pm install $@
# sudocmd pm install $@
# return ;;
# return ;;
...
...
bin/epm-kernel_update
View file @
964e8196
...
@@ -23,6 +23,11 @@ epm_kernel_update()
...
@@ -23,6 +23,11 @@ epm_kernel_update()
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
load_helper epm-query_package
if
!
__epm_query_package kernel-image
>
/dev/null
;
then
info
"No installed kernel packages, skipping update"
return
fi
assure_exists update-kernel
assure_exists update-kernel
sudocmd update-kernel
$pkg_filenames
sudocmd update-kernel
$pkg_filenames
return
;;
return
;;
...
...
bin/epm-packages
View file @
964e8196
...
@@ -122,6 +122,9 @@ case $PMTYPE in
...
@@ -122,6 +122,9 @@ case $PMTYPE in
ipkg
)
ipkg
)
CMD
=
"ipkg list"
CMD
=
"ipkg list"
;;
;;
apk
)
CMD
=
"apk info"
;;
guix
)
guix
)
CMD
=
"guix package -I"
CMD
=
"guix package -I"
;;
;;
...
...
bin/epm-query_package
View file @
964e8196
...
@@ -20,6 +20,11 @@
...
@@ -20,6 +20,11 @@
load_helper epm-packages
load_helper epm-packages
load_helper epm-search
load_helper epm-search
__epm_query_package
()
{
pkg_filenames
=
"
$@
"
quoted_args
=
"
$@
"
quiet
=
1 epm_query_package
}
epm_query_package
()
epm_query_package
()
{
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Please, use search with some argument or run epmqa for get all packages."
[
-n
"
$pkg_filenames
"
]
||
fatal
"Please, use search with some argument or run epmqa for get all packages."
...
...
bin/epm-reinstall
View file @
964e8196
...
@@ -72,6 +72,9 @@ epm_reinstall()
...
@@ -72,6 +72,9 @@ epm_reinstall()
{
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Reinstall: missing package(s) name."
[
-n
"
$pkg_filenames
"
]
||
fatal
"Reinstall: missing package(s) name."
# get package name for hi level package management command (with version if supported and if possible)
pkg_names
=
$(
__epm_get_hilevel_name
$pkg_names
)
epm_reinstall_names
$pkg_names
epm_reinstall_names
$pkg_names
epm_reinstall_files
$pkg_files
epm_reinstall_files
$pkg_files
}
}
...
...
bin/epm-release_upgrade
View file @
964e8196
...
@@ -49,11 +49,12 @@ __update_alt_repo_to_next_distro()
...
@@ -49,11 +49,12 @@ __update_alt_repo_to_next_distro()
__replace_alt_version_in_repo p6 p7
__replace_alt_version_in_repo p6 p7
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p6
\]
![updates]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p6
\]
![updates]!g"
docmd epm update
||
fatal
docmd epm update
||
fatal
docmd epm
install
apt rpm apt-conf-branch
||
fatal
docmd epm
install
apt rpm apt-conf-branch
||
fatal
"Check an error and run epm release-upgrade again"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![p7]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![p7]!g"
docmd epm update
||
fatal
docmd epm update
||
fatal
docmd epm upgrade
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade again"
docmd epm update-kernel
docmd epm update-kernel
info
"Done."
info
"Run epm release-upgrade again for update to p8"
info
"Run epm release-upgrade again for update to p8"
;;
;;
p7
)
p7
)
...
@@ -63,15 +64,16 @@ __update_alt_repo_to_next_distro()
...
@@ -63,15 +64,16 @@ __update_alt_repo_to_next_distro()
__replace_alt_version_in_repo p7 p8
__replace_alt_version_in_repo p7 p8
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p7
\]
![updates]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p7
\]
![updates]!g"
docmd epm update
||
fatal
docmd epm update
||
fatal
docmd epm
install
apt rpm apt-conf-branch
||
fatal
docmd epm
install
apt rpm apt-conf-branch
||
fatal
"Check an error and run epm release-upgrade again"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![p
7
]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![p
8
]!g"
docmd epm update
||
fatal
docmd epm update
||
fatal
if
is_installed systemd
;
then
if
is_installed systemd
&&
is_active_systemd systemd
;
then
docmd epm
install
systemd
||
fatal
docmd epm
install
systemd
||
fatal
fi
fi
docmd epm upgrade
||
fatal
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade again"
#info " # epmi branding-simply-linux-release branding-simply-linux-graphics"
#info " # epmi branding-simply-linux-release branding-simply-linux-graphics"
docmd epm update-kernel
||
fatal
docmd epm update-kernel
||
fatal
info
"Done."
;;
;;
*
)
*
)
info
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
. Try install branding-simply-linux-release package before."
info
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
. Try install branding-simply-linux-release package before."
...
...
bin/epm-remove
View file @
964e8196
...
@@ -107,6 +107,9 @@ epm_remove_names()
...
@@ -107,6 +107,9 @@ epm_remove_names()
nix
)
nix
)
sudocmd nix-env
--uninstall
$@
sudocmd nix-env
--uninstall
$@
return
;;
return
;;
apk
)
sudocmd apk del
$@
return
;;
guix
)
guix
)
sudocmd guix package
-r
$@
sudocmd guix package
-r
$@
return
;;
return
;;
...
...
bin/epm-search
View file @
964e8196
...
@@ -64,6 +64,9 @@ case $PMTYPE in
...
@@ -64,6 +64,9 @@ case $PMTYPE in
mpkg
)
mpkg
)
CMD
=
"mpkg search"
CMD
=
"mpkg search"
;;
;;
apk
)
CMD
=
"apk search"
;;
conary
)
conary
)
CMD
=
"conary repquery"
CMD
=
"conary repquery"
;;
;;
...
...
bin/epm-sh-functions
View file @
964e8196
...
@@ -469,6 +469,9 @@ case $DISTRNAME in
...
@@ -469,6 +469,9 @@ case $DISTRNAME in
Cygwin
)
Cygwin
)
CMD
=
"aptcyg"
CMD
=
"aptcyg"
;;
;;
alpine
)
CMD
=
"apk"
;;
*
)
*
)
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
;;
;;
...
@@ -476,3 +479,15 @@ esac
...
@@ -476,3 +479,15 @@ esac
PMTYPE
=
$CMD
PMTYPE
=
$CMD
}
}
is_active_systemd
()
{
local
a
SYSTEMCTL
=
/bin/systemctl
SYSTEMD_CGROUP_DIR
=
/sys/fs/cgroup/systemd
[
-x
"
$SYSTEMCTL
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
pidof systemd
>
/dev/null
}
bin/epm-update
View file @
964e8196
...
@@ -80,6 +80,9 @@ case $PMTYPE in
...
@@ -80,6 +80,9 @@ case $PMTYPE in
ipkg
)
ipkg
)
sudocmd ipkg update
sudocmd ipkg update
;;
;;
apk
)
sudocmd apk update
;;
pkgsrc
)
pkgsrc
)
# portsnap extract for the first time?
# portsnap extract for the first time?
sudocmd portsnap fetch update
sudocmd portsnap fetch update
...
...
bin/serv
View file @
964e8196
...
@@ -54,18 +54,6 @@ set_service_type()
...
@@ -54,18 +54,6 @@ set_service_type()
[
-n
"
$DISTRVERSION
"
]
||
DISTRVERSION
=
$(
$DISTRVENDOR
-v
)
[
-n
"
$DISTRVERSION
"
]
||
DISTRVERSION
=
$(
$DISTRVENDOR
-v
)
set_target_pkg_env
set_target_pkg_env
is_active_systemd
()
{
local
a
SYSTEMCTL
=
/bin/systemctl
SYSTEMD_CGROUP_DIR
=
/sys/fs/cgroup/systemd
[
-x
"
$SYSTEMCTL
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
pidof systemd
>
/dev/null
}
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
CMD
=
"service-chkconfig"
CMD
=
"service-chkconfig"
...
...
eepm.spec
View file @
964e8196
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
#
Name: eepm
Name: eepm
Version: 1.
6.8
Version: 1.
7.2
Release: alt0.M80P.1
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
Summary: Etersoft EPM package manager
...
@@ -67,9 +67,26 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
...
@@ -67,9 +67,26 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%_sysconfdir/bash_completion.d/cerv
%changelog
%changelog
*
Mon Apr 18 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.8
-alt0.M80P.1
*
Wed Apr 20 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.2
-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
- backport to ALTLinux p8 (by rpmbph script)
* Wed Apr 20 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.2-alt1
- distr_info: fix os-release detection
* Wed Apr 20 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.1-alt1
- epm: added alpine apk package manager install, update, remove, qa, search commands
- fix Simply Linux 6.0 detection
- kernel_update: do not install kernel if it is not installed (for ovz containers)
* Tue Apr 19 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.0-alt1
- epm release-upgrade with ALT Linux p8 support
- epm-reinstall: add names filtering (to support epmqp some | epm reinstall)
- release-upgrade: print some info
* Tue Apr 19 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.9-alt1
- check if systemd is active
- release_upgrade: fix version
* Mon Apr 18 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.8-alt1
* Mon Apr 18 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.8-alt1
- small output fix
- small output fix
- rewrite release-upgrade
- rewrite release-upgrade
...
...
packed/epm.sh
View file @
964e8196
...
@@ -459,6 +459,9 @@ case $DISTRNAME in
...
@@ -459,6 +459,9 @@ case $DISTRNAME in
Cygwin
)
Cygwin
)
CMD
=
"aptcyg"
CMD
=
"aptcyg"
;;
;;
alpine
)
CMD
=
"apk"
;;
*
)
*
)
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
;;
;;
...
@@ -467,6 +470,18 @@ PMTYPE=$CMD
...
@@ -467,6 +470,18 @@ PMTYPE=$CMD
}
}
is_active_systemd
()
{
local
a
SYSTEMCTL
=
/bin/systemctl
SYSTEMD_CGROUP_DIR
=
/sys/fs/cgroup/systemd
[
-x
"
$SYSTEMCTL
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
pidof systemd
>
/dev/null
}
# File bin/epm-addrepo:
# File bin/epm-addrepo:
epm_addrepo
()
epm_addrepo
()
...
@@ -1694,6 +1709,9 @@ epm_install_names()
...
@@ -1694,6 +1709,9 @@ epm_install_names()
nix
)
nix
)
__separate_sudocmd
"nix-env --install"
"nix-env --upgrade"
$@
__separate_sudocmd
"nix-env --install"
"nix-env --upgrade"
$@
return
;;
return
;;
apk
)
sudocmd apk add
$@
return
;;
guix
)
guix
)
__separate_sudocmd
"guix package -i"
"guix package -i"
$@
__separate_sudocmd
"guix package -i"
"guix package -i"
$@
return
;;
return
;;
...
@@ -1761,6 +1779,9 @@ epm_ni_install_names()
...
@@ -1761,6 +1779,9 @@ epm_ni_install_names()
nix
)
nix
)
sudocmd nix-env
--install
$@
sudocmd nix-env
--install
$@
return
;;
return
;;
apk
)
sudocmd apk add
$@
return
;;
#android)
#android)
# sudocmd pm install $@
# sudocmd pm install $@
# return ;;
# return ;;
...
@@ -1984,7 +2005,7 @@ epm_Install()
...
@@ -1984,7 +2005,7 @@ epm_Install()
yum-rpm
)
yum-rpm
)
;;
;;
*
)
*
)
epm_update
||
return
pkg_filenames
=
epm_update
||
return
;;
;;
esac
esac
...
@@ -2076,6 +2097,11 @@ epm_kernel_update()
...
@@ -2076,6 +2097,11 @@ epm_kernel_update()
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
load_helper epm-query_package
if
!
__epm_query_package kernel-image
>
/dev/null
;
then
info
"No installed kernel packages, skipping update"
return
fi
assure_exists update-kernel
assure_exists update-kernel
sudocmd update-kernel
$pkg_filenames
sudocmd update-kernel
$pkg_filenames
return
;;
return
;;
...
@@ -2224,6 +2250,9 @@ case $PMTYPE in
...
@@ -2224,6 +2250,9 @@ case $PMTYPE in
ipkg
)
ipkg
)
CMD
=
"ipkg list"
CMD
=
"ipkg list"
;;
;;
apk
)
CMD
=
"apk info"
;;
guix
)
guix
)
CMD
=
"guix package -I"
CMD
=
"guix package -I"
;;
;;
...
@@ -2954,6 +2983,11 @@ epm_query_file()
...
@@ -2954,6 +2983,11 @@ epm_query_file()
# File bin/epm-query_package:
# File bin/epm-query_package:
__epm_query_package
()
{
pkg_filenames
=
"
$@
"
quoted_args
=
"
$@
"
quiet
=
1 epm_query_package
}
epm_query_package
()
epm_query_package
()
{
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Please, use search with some argument or run epmqa for get all packages."
[
-n
"
$pkg_filenames
"
]
||
fatal
"Please, use search with some argument or run epmqa for get all packages."
...
@@ -3020,6 +3054,9 @@ epm_reinstall()
...
@@ -3020,6 +3054,9 @@ epm_reinstall()
{
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Reinstall: missing package(s) name."
[
-n
"
$pkg_filenames
"
]
||
fatal
"Reinstall: missing package(s) name."
# get package name for hi level package management command (with version if supported and if possible)
pkg_names
=
$(
__epm_get_hilevel_name
$pkg_names
)
epm_reinstall_names
$pkg_names
epm_reinstall_names
$pkg_names
epm_reinstall_files
$pkg_files
epm_reinstall_files
$pkg_files
}
}
...
@@ -3027,22 +3064,24 @@ epm_reinstall()
...
@@ -3027,22 +3064,24 @@ epm_reinstall()
# File bin/epm-release_upgrade:
# File bin/epm-release_upgrade:
__replace_text_in_alt_repo
()
{
local
i
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
regexp_subst
"
$1
"
"
$i
"
done
}
__replace_alt_version_in_repo
()
__replace_alt_version_in_repo
()
{
{
local
i
local
i
assure_exists apt-repo
assure_exists apt-repo
echo
"Upgrading
$DISTRNAME
from
$1
to
$2
..."
echo
"Upgrading
$DISTRNAME
from
$1
to
$2
..."
docmd apt-repo list |
sed
-e
"s|
\(
$1
/branch
\)
|{
\1
}->
$2
/branch<
|g"
| egrep
--color
--
"
$1
/branch"
docmd apt-repo list |
sed
-e
"s|
\(
$1
/branch
\)
|{
\1
}->
{
$2
/branch}
|g"
| egrep
--color
--
"
$1
/branch"
confirm
"Are these correct changes?"
||
fatal
"Exiting"
confirm
"Are these correct changes?"
||
fatal
"Exiting"
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
__replace_text_in_alt_repo
"/^ *#/! s!
$1
/branch!
$2
/branch!g"
[
-s
"
$i
"
]
||
continue
# TODO: only for uncommended strings
#sed -i -r -e "s!$1/branch!$2/branch!g" $i
regexp_subst
"/^ *#/! s!
$1
/branch!
$2
/branch!g"
$i
# TODO: start with improve to [p8] - install some package firstly?
regexp_subst
"/^ *#/! s s!
\[
$1
\]
![alt]/branch!g"
$i
done
docmd apt-repo list
docmd apt-repo list
}
}
...
@@ -3050,14 +3089,40 @@ __update_alt_repo_to_next_distro()
...
@@ -3050,14 +3089,40 @@ __update_alt_repo_to_next_distro()
{
{
case
"
$DISTRVERSION
"
in
case
"
$DISTRVERSION
"
in
p6
)
p6
)
docmd epm
install
apt-conf-branch
||
fatal
load_helper epm-repofix
pkg_filenames
=
epm_repofix
__replace_alt_version_in_repo p6 p7
__replace_alt_version_in_repo p6 p7
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p6
\]
![updates]!g"
docmd epm update
||
fatal
docmd epm
install
apt rpm apt-conf-branch
||
fatal
"Check an error and run epm release-upgrade again"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![p7]!g"
docmd epm update
||
fatal
docmd epm upgrade
||
fatal
"Check an error and run epm release-upgrade again"
docmd epm update-kernel
info
"Done."
info
"Run epm release-upgrade again for update to p8"
info
"Run epm release-upgrade again for update to p8"
;;
;;
p7
)
p7
)
docmd epm
install
apt-conf-branch
||
fatal
load_helper epm-repofix
pkg_filenames
=
epm_repofix
__replace_alt_version_in_repo p7 p8
__replace_alt_version_in_repo p7 p8
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p7
\]
![updates]!g"
docmd epm update
||
fatal
docmd epm
install
apt rpm apt-conf-branch
||
fatal
"Check an error and run epm release-upgrade again"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![p8]!g"
docmd epm update
||
fatal
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"
#info " # epmi branding-simply-linux-release branding-simply-linux-graphics"
docmd epm update-kernel
||
fatal
info
"Done."
;;
;;
*
)
*
)
info
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
"
info
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
. Try install branding-simply-linux-release package before.
"
return
1
return
1
esac
esac
}
}
...
@@ -3072,10 +3137,7 @@ epm_release_upgrade()
...
@@ -3072,10 +3137,7 @@ epm_release_upgrade()
ALTLinux
)
ALTLinux
)
docmd epm update
docmd epm update
docmd epm
install
apt rpm
docmd epm
install
apt rpm
pkg_filenames
=
epm_repofix
__update_alt_repo_to_next_distro
__update_alt_repo_to_next_distro
||
exit
docmd epm Upgrade
docmd epm update-kernel
return
return
;;
;;
*
)
*
)
...
@@ -3222,6 +3284,9 @@ epm_remove_names()
...
@@ -3222,6 +3284,9 @@ epm_remove_names()
nix
)
nix
)
sudocmd nix-env
--uninstall
$@
sudocmd nix-env
--uninstall
$@
return
;;
return
;;
apk
)
sudocmd apk del
$@
return
;;
guix
)
guix
)
sudocmd guix package
-r
$@
sudocmd guix package
-r
$@
return
;;
return
;;
...
@@ -3393,10 +3458,10 @@ esac
...
@@ -3393,10 +3458,10 @@ esac
# File bin/epm-repofix:
# File bin/epm-repofix:
SUBST_ALT_RULE
=
's!^([^#].*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ](Sisyphus|p8[/ ]branch|p7[/ ]branch|p6[/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi'
__fix_apt_sources_list
()
__fix_apt_sources_list
()
{
{
local
SUBST_ALT_RULE
=
's!^(.*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ](Sisyphus|p8[/ ]branch|p7[/ ]branch|p6[/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi'
local
i
local
i
assure_root
assure_root
for
i
in
"
$@
"
;
do
for
i
in
"
$@
"
;
do
...
@@ -3405,6 +3470,12 @@ __fix_apt_sources_list()
...
@@ -3405,6 +3470,12 @@ __fix_apt_sources_list()
# TODO: only for uncommented strings
# TODO: only for uncommented strings
#sed -i -r -e "$SUBST_ALT_RULE" $i
#sed -i -r -e "$SUBST_ALT_RULE" $i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
local
br
for
br
in
p6 p7 p8
;
do
# sed -r -e "/ALTLinux\/p8\/branch/s/rpm *([fhr])/rpm [p8] \1/"
regexp_subst
"/ALTLinux
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [
$br
]
\1
/"
$i
regexp_subst
"/Etersoft
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [etersoft]
\1
/"
$i
done
done
done
}
}
...
@@ -3647,6 +3718,9 @@ case $PMTYPE in
...
@@ -3647,6 +3718,9 @@ case $PMTYPE in
mpkg
)
mpkg
)
CMD
=
"mpkg search"
CMD
=
"mpkg search"
;;
;;
apk
)
CMD
=
"apk search"
;;
conary
)
conary
)
CMD
=
"conary repquery"
CMD
=
"conary repquery"
;;
;;
...
@@ -4148,6 +4222,9 @@ case $PMTYPE in
...
@@ -4148,6 +4222,9 @@ case $PMTYPE in
ipkg
)
ipkg
)
sudocmd ipkg update
sudocmd ipkg update
;;
;;
apk
)
sudocmd apk update
;;
pkgsrc
)
pkgsrc
)
# portsnap extract for the first time?
# portsnap extract for the first time?
sudocmd portsnap fetch update
sudocmd portsnap fetch update
...
@@ -4258,7 +4335,7 @@ epm_Upgrade()
...
@@ -4258,7 +4335,7 @@ epm_Upgrade()
yum-rpm
)
yum-rpm
)
;;
;;
*
)
*
)
epm_update
||
return
pkg_filenames
=
epm_update
||
return
;;
;;
esac
esac
...
@@ -4400,6 +4477,7 @@ pkgtype()
...
@@ -4400,6 +4477,7 @@ pkgtype()
gentoo
)
echo
"tbz2"
;;
gentoo
)
echo
"tbz2"
;;
windows
)
echo
"exe"
;;
windows
)
echo
"exe"
;;
android
)
echo
"apk"
;;
android
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
cygwin
)
echo
"tar.xz"
;;
cygwin
)
echo
"tar.xz"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
...
@@ -4438,9 +4516,10 @@ if distro altlinux-release ; then
...
@@ -4438,9 +4516,10 @@ if distro altlinux-release ; then
if
has Sisyphus
;
then
DISTRIB_RELEASE
=
"Sisyphus"
if
has Sisyphus
;
then
DISTRIB_RELEASE
=
"Sisyphus"
elif
has
"ALT Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux 6.
0
"
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux p8"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux p8"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux p7"
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux p7"
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux p6"
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux p6"
;
then
DISTRIB_RELEASE
=
"p6"
...
@@ -4479,6 +4558,11 @@ elif distro slackware-version ; then
...
@@ -4479,6 +4558,11 @@ elif distro slackware-version ; then
DISTRIB_ID
=
"Slackware"
DISTRIB_ID
=
"Slackware"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
[
0-9]+
\.
[
0-9]+
$DISTROFILE
)
"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
[
0-9]+
\.
[
0-9]+
$DISTROFILE
)
"
elif
distro os-release
&&
which apk 2>/dev/null
>
/dev/null
;
then
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"
$ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro arch-release
;
then
elif
distro arch-release
;
then
DISTRIB_ID
=
"ArchLinux"
DISTRIB_ID
=
"ArchLinux"
DISTRIB_RELEASE
=
"2010"
DISTRIB_RELEASE
=
"2010"
...
@@ -4694,9 +4778,9 @@ $(get_help HELPOPT)
...
@@ -4694,9 +4778,9 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"EPM package manager version 1.
6.4
"
echo
"EPM package manager version 1.
7.2
"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Copyright (c) Etersoft 2012-201
5
"
echo
"Copyright (c) Etersoft 2012-201
6
"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
}
}
...
...
packed/serv.sh
View file @
964e8196
...
@@ -457,6 +457,9 @@ case $DISTRNAME in
...
@@ -457,6 +457,9 @@ case $DISTRNAME in
Cygwin
)
Cygwin
)
CMD
=
"aptcyg"
CMD
=
"aptcyg"
;;
;;
alpine
)
CMD
=
"apk"
;;
*
)
*
)
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
;;
;;
...
@@ -465,6 +468,18 @@ PMTYPE=$CMD
...
@@ -465,6 +468,18 @@ PMTYPE=$CMD
}
}
is_active_systemd
()
{
local
a
SYSTEMCTL
=
/bin/systemctl
SYSTEMD_CGROUP_DIR
=
/sys/fs/cgroup/systemd
[
-x
"
$SYSTEMCTL
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
pidof systemd
>
/dev/null
}
# File bin/serv-common:
# File bin/serv-common:
serv_common
()
serv_common
()
...
@@ -859,6 +874,7 @@ pkgtype()
...
@@ -859,6 +874,7 @@ pkgtype()
gentoo
)
echo
"tbz2"
;;
gentoo
)
echo
"tbz2"
;;
windows
)
echo
"exe"
;;
windows
)
echo
"exe"
;;
android
)
echo
"apk"
;;
android
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
cygwin
)
echo
"tar.xz"
;;
cygwin
)
echo
"tar.xz"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
...
@@ -897,9 +913,10 @@ if distro altlinux-release ; then
...
@@ -897,9 +913,10 @@ if distro altlinux-release ; then
if
has Sisyphus
;
then
DISTRIB_RELEASE
=
"Sisyphus"
if
has Sisyphus
;
then
DISTRIB_RELEASE
=
"Sisyphus"
elif
has
"ALT Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux 6.
0
"
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux p8"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux p8"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT Linux p7"
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux p7"
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"ALT Linux p6"
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"ALT Linux p6"
;
then
DISTRIB_RELEASE
=
"p6"
...
@@ -938,6 +955,11 @@ elif distro slackware-version ; then
...
@@ -938,6 +955,11 @@ elif distro slackware-version ; then
DISTRIB_ID
=
"Slackware"
DISTRIB_ID
=
"Slackware"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
[
0-9]+
\.
[
0-9]+
$DISTROFILE
)
"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
[
0-9]+
\.
[
0-9]+
$DISTROFILE
)
"
elif
distro os-release
&&
which apk 2>/dev/null
>
/dev/null
;
then
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"
$ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro arch-release
;
then
elif
distro arch-release
;
then
DISTRIB_ID
=
"ArchLinux"
DISTRIB_ID
=
"ArchLinux"
DISTRIB_RELEASE
=
"2010"
DISTRIB_RELEASE
=
"2010"
...
@@ -1151,18 +1173,6 @@ set_service_type()
...
@@ -1151,18 +1173,6 @@ set_service_type()
[
-n
"
$DISTRVERSION
"
]
||
DISTRVERSION
=
$(
$DISTRVENDOR
-v
)
[
-n
"
$DISTRVERSION
"
]
||
DISTRVERSION
=
$(
$DISTRVENDOR
-v
)
set_target_pkg_env
set_target_pkg_env
is_active_systemd
()
{
local
a
SYSTEMCTL
=
/bin/systemctl
SYSTEMD_CGROUP_DIR
=
/sys/fs/cgroup/systemd
[
-x
"
$SYSTEMCTL
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
pidof systemd
>
/dev/null
}
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
CMD
=
"service-chkconfig"
CMD
=
"service-chkconfig"
...
@@ -1225,7 +1235,7 @@ $(get_help HELPOPT)
...
@@ -1225,7 +1235,7 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"Service manager version 1.
6.4
"
echo
"Service manager version 1.
7.2
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Copyright (c) Etersoft 2012, 2013, 2016"
echo
"Copyright (c) Etersoft 2012, 2013, 2016"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
...
...
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