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
537524b7
Commit
537524b7
authored
Dec 02, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p8 as 1.9.8-alt0.M80P.1 (with rpmbph script)
parents
89b43b7e
d8814981
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
203 additions
and
93 deletions
+203
-93
Makefile
Makefile
+3
-2
epm-autoorphans
bin/epm-autoorphans
+3
-2
epm-autoremove
bin/epm-autoremove
+1
-1
epm-checkpkg
bin/epm-checkpkg
+19
-3
epm-downgrade
bin/epm-downgrade
+8
-0
epm-download
bin/epm-download
+82
-0
epm-install
bin/epm-install
+7
-61
epm-query_file
bin/epm-query_file
+1
-1
epm-reinstall
bin/epm-reinstall
+5
-2
epm-repolist
bin/epm-repolist
+1
-1
epm-sh-functions
bin/epm-sh-functions
+1
-1
tools_eget
bin/tools_eget
+1
-1
eepm.spec
eepm.spec
+14
-2
epm.sh
packed/epm.sh
+6
-6
serv.sh
packed/serv.sh
+51
-10
No files found.
Makefile
View file @
537524b7
...
@@ -6,14 +6,15 @@ instpkgdatadir=$(pkgdatadir)
...
@@ -6,14 +6,15 @@ instpkgdatadir=$(pkgdatadir)
install
:
install
:
mkdir
-p
$(DESTDIR)$(bindir)
/
mkdir
-p
$(DESTDIR)$(bindir)
/
# breaks link
# breaks link
#install -m 755 `ls -1 bin/* | grep -v "-
"`
$(DESTDIR)$(bindir)
/
cp
-a
`
ls
-1
bin/
*
|
grep
-v
"[-_]
"
`
$(DESTDIR)$(bindir)
/
cp
-a
`
ls
-1
bin/
*
|
grep
-v
"-"
`
$(DESTDIR)$(bindir)
/
cp
-a
bin/distr_info
$(DESTDIR)$(bindir)
/
chmod
0755
$(DESTDIR)$(bindir)
/
*
chmod
0755
$(DESTDIR)$(bindir)
/
*
sed
-e
"s|SHAREDIR=.*|SHAREDIR=
$(instpkgdatadir)
|g"
-e
"s|@VERSION@|
$(version)
|g"
<bin/epm
>
$(DESTDIR)$(bindir)
/epm
sed
-e
"s|SHAREDIR=.*|SHAREDIR=
$(instpkgdatadir)
|g"
-e
"s|@VERSION@|
$(version)
|g"
<bin/epm
>
$(DESTDIR)$(bindir)
/epm
sed
-e
"s|SHAREDIR=.*|SHAREDIR=
$(instpkgdatadir)
|g"
-e
"s|@VERSION@|
$(version)
|g"
<bin/serv
>
$(DESTDIR)$(bindir)
/serv
sed
-e
"s|SHAREDIR=.*|SHAREDIR=
$(instpkgdatadir)
|g"
-e
"s|@VERSION@|
$(version)
|g"
<bin/serv
>
$(DESTDIR)$(bindir)
/serv
mkdir
-p
$(DESTDIR)$(pkgdatadir)/
mkdir
-p
$(DESTDIR)$(pkgdatadir)/
install
-m
644
`ls
-1
bin/*
|
grep
"[-_]"
`
$(DESTDIR)$(pkgdatadir)/
install
-m
644
`ls
-1
bin/*
|
grep
"[-_]"
`
$(DESTDIR)$(pkgdatadir)/
rm
-f
$(DESTDIR)$(pkgdatadir)/distr_info
mkdir
-p
$(DESTDIR)$(mandir)/man1
mkdir
-p
$(DESTDIR)$(mandir)/man1
cp
-a
`ls
-1
man/*`
$(DESTDIR)$(mandir)/man1/
cp
-a
`ls
-1
man/*`
$(DESTDIR)$(mandir)/man1/
bin/epm-autoorphans
View file @
537524b7
...
@@ -50,13 +50,14 @@ case $PMTYPE in
...
@@ -50,13 +50,14 @@ case $PMTYPE in
# ;;
# ;;
yum-rpm
)
yum-rpm
)
showcmd package-cleanup
--orphans
showcmd package-cleanup
--orphans
local
PKGLIST
=
$(
package-cleanup
-
-orphans
|
grep
-v
"^eepm$
"
)
local
PKGLIST
=
$(
package-cleanup
-
q
--orphans
|
grep
-v
"^eepm-
"
)
docmd epm remove
$PKGLIST
docmd epm remove
$PKGLIST
;;
;;
dnf-rpm
)
dnf-rpm
)
# TODO: dnf list extras
# TODO: dnf list extras
# TODO: Yum-utils package has been deprecated, use dnf instead.
showcmd package-cleanup
--orphans
showcmd package-cleanup
--orphans
local
PKGLIST
=
$(
package-cleanup
-
-orphans
|
grep
-v
"^eepm$
"
)
local
PKGLIST
=
$(
package-cleanup
-
q
--orphans
|
grep
-v
"^eepm-
"
)
docmd epm remove
$PKGLIST
docmd epm remove
$PKGLIST
;;
;;
urpm-rpm
)
urpm-rpm
)
...
...
bin/epm-autoremove
View file @
537524b7
...
@@ -89,7 +89,7 @@ case $PMTYPE in
...
@@ -89,7 +89,7 @@ case $PMTYPE in
while
true
;
do
while
true
;
do
docmd package-cleanup
--leaves
$(
subst_option non_interactive
--assumeyes
)
docmd package-cleanup
--leaves
$(
subst_option non_interactive
--assumeyes
)
# FIXME: package-cleanup have to use stderr for errors
# FIXME: package-cleanup have to use stderr for errors
local
PKGLIST
=
$(
package-cleanup
-
-leaves
|
grep
-v
"Loaded plugins"
|
grep
-v
"Unable to"
|
grep
-v
"^eepm$
"
)
local
PKGLIST
=
$(
package-cleanup
-
q
--leaves
|
grep
-v
"^eepm-
"
)
[
-n
"
$PKGLIST
"
]
||
break
[
-n
"
$PKGLIST
"
]
||
break
sudocmd yum remove
$PKGLIST
sudocmd yum remove
$PKGLIST
done
done
...
...
bin/epm-checkpkg
View file @
537524b7
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2009, 2012, 2013, 2014 Etersoft
# Copyright (C) 2009, 2012, 2013, 2014
, 2016
Etersoft
# Copyright (C) 2009, 2012, 2013, 2014 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2009, 2012, 2013, 2014
, 2016
Vitaly Lipatov <lav@etersoft.ru>
#
#
# This program is free software: you can redistribute it and/or modify
# 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
# it under the terms of the GNU Affero General Public License as published by
...
@@ -75,14 +75,30 @@ esac
...
@@ -75,14 +75,30 @@ esac
epm_checkpkg
()
epm_checkpkg
()
{
{
if
[
-n
"
$pkg_names
"
]
;
then
if
[
-n
"
$pkg_names
"
]
;
then
# TODO: если есть / или расширение, это отсутствующий файл
info
"Suggest
$pkg_names
are name(s) of installed packages"
info
"Suggest
$pkg_names
are name(s) of installed packages"
__epm_check_installed_pkg
$pkg_names
__epm_check_installed_pkg
$pkg_names
return
return
fi
fi
# if possible, it will put pkg_urls into pkg_files or pkg_names
if
[
-n
"
$pkg_urls
"
]
;
then
load_helper epm-download
__handle_pkg_urls_to_checking
fi
[
-n
"
$pkg_files
"
]
||
fatal
"Checkpkg: missing file or package name(s)"
[
-n
"
$pkg_files
"
]
||
fatal
"Checkpkg: missing file or package name(s)"
local
RETVAL
=
0
local
pkg
local
pkg
for
pkg
in
$pkg_files
;
do
for
pkg
in
$pkg_files
;
do
check_pkg_integrity
$pkg
||
fatal
"Broken package
$pkg
"
check_pkg_integrity
$pkg
||
RETVAL
=
1
done
done
# TODO: reinvent
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-fv
$to_remove_pkg_files
#fatal "Broken package $pkg"
return
$RETVAL
}
}
bin/epm-downgrade
View file @
537524b7
...
@@ -90,10 +90,18 @@ epm_downgrade()
...
@@ -90,10 +90,18 @@ epm_downgrade()
;;
;;
yum-rpm
)
yum-rpm
)
# can do update repobase automagically
# can do update repobase automagically
if
[
-n
"
$pkg_filenames
"
]
;
then
sudocmd yum downgrade
$pkg_filenames
sudocmd yum downgrade
$pkg_filenames
else
sudocmd yum distro-sync
fi
;;
;;
dnf-rpm
)
dnf-rpm
)
if
[
-n
"
$pkg_filenames
"
]
;
then
sudocmd dnf downgrade
$pkg_filenames
sudocmd dnf downgrade
$pkg_filenames
else
sudocmd dnf distro-sync
fi
;;
;;
urpm-rpm
)
urpm-rpm
)
assure_exists urpm-reposync urpm-tools
assure_exists urpm-reposync urpm-tools
...
...
bin/epm-download
View file @
537524b7
...
@@ -17,6 +17,88 @@
...
@@ -17,6 +17,88 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
__use_url_install
()
{
case
$PMTYPE
in
apt-rpm
)
# ALT Linux really?
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#deepsolver-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
#urpm-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
pacman
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
yum-rpm|dnf-rpm
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#zypper-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
*
)
return
1
;;
esac
return
0
}
# for download before install / checking
__download_pkg_urls
()
{
local
url
[
-z
"
$pkg_urls
"
]
&&
return
for
url
in
$pkg_urls
;
do
# TODO: use some individual tmp dir
local
new_file
=
/tmp/
$(
basename
"
$url
"
)
if
eget
-O
$new_file
$url
&&
[
-s
"
$new_file
"
]
;
then
pkg_files
=
"
$pkg_files
$new_file
"
to_remove_pkg_files
=
"
$to_remove_pkg_files
$new_file
"
else
warning
"Failed to download
$url
, ignoring"
fi
done
}
# NOTE: call __clean_downloaded_pkg_files after
__handle_pkg_urls_to_install
()
{
#[ -n "$pkg_urls" ] || return
# TODO: do it correctly
to_remove_pkg_files
=
if
[
"
$(
get_package_type
"
$pkg
"
)
"
!=
$PKGFORMAT
]
||
!
__use_url_install
;
then
# use workaround with eget: download and put in pkg_files
__download_pkg_urls
fi
pkg_urls
=
}
__handle_pkg_urls_to_checking
()
{
#[ -n "$pkg_urls" ] || return
# TODO: do it correctly
to_remove_pkg_files
=
# use workaround with eget: download and put in pkg_files
__download_pkg_urls
pkg_urls
=
}
#__clean_downloaded_pkg_files()
#{
# [ -z "$to_remove_pkg_files" ] && return
# rm -fv $to_remove_pkg_files
#}
epm_download
()
epm_download
()
{
{
local
CMD
local
CMD
...
...
bin/epm-install
View file @
537524b7
...
@@ -506,64 +506,6 @@ epm_print_install_command()
...
@@ -506,64 +506,6 @@ epm_print_install_command()
esac
esac
}
}
download_pkg_urls
()
{
local
url
[
-z
"
$pkg_urls
"
]
&&
return
for
url
in
$pkg_urls
;
do
# TODO: use some individual tmp dir
local
new_file
=
/tmp/
$(
basename
"
$url
"
)
if
eget
-O
$new_file
$url
&&
[
-s
"
$new_file
"
]
;
then
pkg_files
=
"
$pkg_files
$new_file
"
to_remove_pkg_files
=
"
$to_remove_pkg_files
$new_file
"
else
warning
"Failed to download
$url
, ignoring"
fi
done
}
__use_url_install
()
{
case
$PMTYPE
in
apt-rpm
)
# ALT Linux really?
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#deepsolver-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
#urpm-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
pacman
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
yum-rpm|dnf-rpm
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#zypper-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
*
)
return
1
;;
esac
return
0
}
__handle_pkg_urls
()
{
[
-n
"
$pkg_urls
"
]
||
return
# TODO: do it correctly
to_remove_pkg_files
=
if
[
"
$(
get_package_type
"
$pkg
"
)
"
!=
$PKGFORMAT
]
||
!
__use_url_install
;
then
# use workaround with eget: download and put in pkg_files
download_pkg_urls
fi
pkg_urls
=
}
epm_install
()
epm_install
()
{
{
...
@@ -572,8 +514,11 @@ epm_install()
...
@@ -572,8 +514,11 @@ epm_install()
return
return
fi
fi
# in any case it will put pkg_urls into pkg_files or pkg_names
# if possible, it will put pkg_urls into pkg_files or pkg_names
__handle_pkg_urls
if
[
-n
"
$pkg_urls
"
]
;
then
load_helper epm-download
__handle_pkg_urls_to_install
fi
[
-z
"
$pkg_files$pkg_names
"
]
&&
info
"Skip empty install list"
&&
return
22
[
-z
"
$pkg_files$pkg_names
"
]
&&
info
"Skip empty install list"
&&
return
22
...
@@ -589,9 +534,10 @@ epm_install()
...
@@ -589,9 +534,10 @@ epm_install()
epm_install_names
$names
||
return
epm_install_names
$names
||
return
epm_install_files
$files
epm_install_files
$files
local
RETVAL
=
$?
# TODO: reinvent
# TODO: reinvent
local
RETVAL
=
$?
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-fv
$to_remove_pkg_files
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-fv
$to_remove_pkg_files
return
$RETVAL
return
$RETVAL
}
}
bin/epm-query_file
View file @
537524b7
...
@@ -25,7 +25,7 @@ __do_query_real_file()
...
@@ -25,7 +25,7 @@ __do_query_real_file()
# get canonical path
# get canonical path
if
[
-e
"
$1
"
]
;
then
if
[
-e
"
$1
"
]
;
then
TOFILE
=
"
$1
"
TOFILE
=
$(
realpath
"
$1
"
)
else
else
TOFILE
=
$(
which
"
$1
"
2>/dev/null
||
echo
"
$1
"
)
TOFILE
=
$(
which
"
$1
"
2>/dev/null
||
echo
"
$1
"
)
if
[
"
$TOFILE
"
!=
"
$1
"
]
;
then
if
[
"
$TOFILE
"
!=
"
$1
"
]
;
then
...
...
bin/epm-reinstall
View file @
537524b7
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012,2014 Etersoft
# Copyright (C) 2012,2014
,2016
Etersoft
# Copyright (C) 2012,2014 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012,2014
,2016
Vitaly Lipatov <lav@etersoft.ru>
#
#
# This program is free software: you can redistribute it and/or modify
# 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
# it under the terms of the GNU Affero General Public License as published by
...
@@ -31,6 +31,9 @@ epm_reinstall_names()
...
@@ -31,6 +31,9 @@ epm_reinstall_names()
aptitude-dpkg
)
aptitude-dpkg
)
sudocmd aptitude reinstall
$@
sudocmd aptitude reinstall
$@
return
;;
return
;;
yum-rpm
)
sudocmd yum reinstall
$@
return
;;
dnf-rpm
)
dnf-rpm
)
sudocmd dnf reinstall
$@
sudocmd dnf reinstall
$@
return
;;
return
;;
...
...
bin/epm-repolist
View file @
537524b7
...
@@ -43,7 +43,7 @@ case $PMTYPE in
...
@@ -43,7 +43,7 @@ case $PMTYPE in
print_apt_sources_list /etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
print_apt_sources_list /etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;;
;;
yum-rpm
)
yum-rpm
)
docmd yum repolist
docmd yum repolist
-v
;;
;;
dnf-rpm
)
dnf-rpm
)
docmd dnf repolist
-v
docmd dnf repolist
-v
...
...
bin/epm-sh-functions
View file @
537524b7
...
@@ -516,5 +516,5 @@ is_active_systemd()
...
@@ -516,5 +516,5 @@ is_active_systemd()
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
# some hack
ps ax |
grep
-q
'[s]ystemd'
>
/dev/null
ps ax |
grep
-q
'[s]ystemd'
|
grep
-v
'systemd-udev'
>
/dev/null
}
}
bin/tools_eget
View file @
537524b7
...
@@ -42,7 +42,7 @@ fi
...
@@ -42,7 +42,7 @@ fi
# If ftp protocol or have no asterisk, just download
# If ftp protocol or have no asterisk, just download
# TODO: use has()
# TODO: use has()
if
echo
"
$1
"
|
grep
-q
"
\(
^ftp://
\|
[^*]
$
\
)"
;
then
if
echo
"
$1
"
|
grep
-q
"
\(
^ftp://
\|
[^*]
\)
"
;
then
$WGET
$WGET_OPTION_TARGET
"
$1
"
$WGET
$WGET_OPTION_TARGET
"
$1
"
exit
exit
fi
fi
...
...
eepm.spec
View file @
537524b7
# 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.9.
6
Version: 1.9.
8
Release: alt0.M80P.1
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
Summary: Etersoft EPM package manager
...
@@ -68,9 +68,21 @@ chmod a+x %buildroot%_datadir/%name/tools_*
...
@@ -68,9 +68,21 @@ chmod a+x %buildroot%_datadir/%name/tools_*
%_sysconfdir/bash_completion.d/cerv
%_sysconfdir/bash_completion.d/cerv
%changelog
%changelog
*
Thu Oct 06 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.6
-alt0.M80P.1
*
Fri Dec 02 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.8
-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
- backport to ALTLinux p8 (by rpmbph script)
* Thu Dec 01 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.8-alt1
- epm-install: move download code to epm-download
- epm-checkpkg: add support for checking package by url
- downgrade: use distro-sync for downgrade with yum/dnf
- autoorphans/autoremove: fix uses package-cleanup with yum/dnf
- epmqf: use realpath for exists files by default
- improve systemd detection
* Tue Nov 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.7-alt1
- fix build install
- small fixes
* Sun Oct 02 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.6-alt1
* Sun Oct 02 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.6-alt1
- epm: improve message about incorrect command
- epm: improve message about incorrect command
- workaround for sudo -h prints first line in stderr
- workaround for sudo -h prints first line in stderr
...
...
packed/epm.sh
View file @
537524b7
...
@@ -275,7 +275,7 @@ set_sudo()
...
@@ -275,7 +275,7 @@ set_sudo()
if
which
sudo
>
/dev/null 2>/dev/null
;
then
if
which
sudo
>
/dev/null 2>/dev/null
;
then
SUDO
=
"sudo --"
SUDO
=
"sudo --"
# check for < 1.7 version which do not support -- (and --help possible too)
# check for < 1.7 version which do not support -- (and --help possible too)
sudo
-h
|
grep
-q
" --"
||
SUDO
=
"sudo"
sudo
-h
2>/dev/null
|
grep
-q
" --"
||
SUDO
=
"sudo"
return
return
fi
fi
...
@@ -508,7 +508,7 @@ is_active_systemd()
...
@@ -508,7 +508,7 @@ is_active_systemd()
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
# some hack
p
idof systemd
>
/dev/null
p
s ax |
grep
-q
'[s]ystemd'
>
/dev/null
}
}
# File bin/epm-addrepo:
# File bin/epm-addrepo:
...
@@ -3108,7 +3108,7 @@ __epm_query_name()
...
@@ -3108,7 +3108,7 @@ __epm_query_name()
CMD
=
"conary query"
CMD
=
"conary query"
;;
;;
homebrew
)
homebrew
)
warning
"fix query"
docmd brew info
"
$1
"
>
/dev/null 2>/dev/null
&&
echo
"
$1
"
&&
return
return
1
return
1
;;
;;
# TODO: need to print name if exists
# TODO: need to print name if exists
...
@@ -4687,7 +4687,7 @@ __query_package_hl_url()
...
@@ -4687,7 +4687,7 @@ __query_package_hl_url()
# http://petstore.swagger.io/?url=http://packages.altlinux.org/api/docs
# http://petstore.swagger.io/?url=http://packages.altlinux.org/api/docs
epm assure curl
||
return
1
epm assure curl
||
return
1
showcmd curl
"
$PAOAPI
/srpms/
$1
"
showcmd curl
"
$PAOAPI
/srpms/
$1
"
curl
-s
--header
"Accept: application/json"
"
$PAOAPI
/srpms/
$1
"
|
grep
'"url"'
|
sed
-e
's|.*"url":"||g'
|
sed
-e
's|".*||g'
a
=
curl
-s
--header
"Accept: application/json"
"
$PAOAPI
/srpms/
$1
"
|
grep
'"url"'
|
sed
-e
's|.*"url":"||g'
|
sed
-e
's|".*||g'
return
0
return
0
;;
;;
esac
esac
...
@@ -5519,7 +5519,7 @@ $(get_help HELPOPT)
...
@@ -5519,7 +5519,7 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"EPM package manager version 1.9.
3
"
echo
"EPM package manager version 1.9.
6
"
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-2016"
echo
"Copyright (c) Etersoft 2012-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."
...
@@ -5858,7 +5858,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
...
@@ -5858,7 +5858,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
if
[
-z
"
$epm_cmd
"
]
;
then
if
[
-z
"
$epm_cmd
"
]
;
then
print_version
print_version
echo
echo
fatal
"Run
$ $PROGNAME
--help for get help"
fatal
"
Unknown command
$@
.
Run
$ $PROGNAME
--help for get help"
fi
fi
# Use eatmydata for write specific operations
# Use eatmydata for write specific operations
...
...
packed/serv.sh
View file @
537524b7
...
@@ -268,7 +268,7 @@ set_sudo()
...
@@ -268,7 +268,7 @@ set_sudo()
if
which
sudo
>
/dev/null 2>/dev/null
;
then
if
which
sudo
>
/dev/null 2>/dev/null
;
then
SUDO
=
"sudo --"
SUDO
=
"sudo --"
# check for < 1.7 version which do not support -- (and --help possible too)
# check for < 1.7 version which do not support -- (and --help possible too)
sudo
-h
|
grep
-q
" --"
||
SUDO
=
"sudo"
sudo
-h
2>/dev/null
|
grep
-q
" --"
||
SUDO
=
"sudo"
return
return
fi
fi
...
@@ -501,7 +501,7 @@ is_active_systemd()
...
@@ -501,7 +501,7 @@ is_active_systemd()
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
[
-d
"
$SYSTEMD_CGROUP_DIR
"
]
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
a
=
mountpoint
-q
"
$SYSTEMD_CGROUP_DIR
"
||
return
# some hack
# some hack
p
idof systemd
>
/dev/null
p
s ax |
grep
-q
'[s]ystemd'
>
/dev/null
}
}
# File bin/serv-common:
# File bin/serv-common:
...
@@ -636,11 +636,6 @@ serv_list()
...
@@ -636,11 +636,6 @@ serv_list()
for
i
in
$(
serv_list_all
)
;
do
for
i
in
$(
serv_list_all
)
;
do
is_service_running
$i
>
/dev/null
&&
echo
$i
is_service_running
$i
>
/dev/null
&&
echo
$i
done
done
# TODO: только запущенные
if
[
-n
"
$ANYSERVICE
"
]
;
then
sudocmd
$ANYSERVICE
list
return
fi
;;
;;
esac
esac
}
}
...
@@ -655,7 +650,7 @@ serv_list_all()
...
@@ -655,7 +650,7 @@ serv_list_all()
sudocmd chkconfig
--list
|
cut
-f1
sudocmd chkconfig
--list
|
cut
-f1
if
[
-n
"
$ANYSERVICE
"
]
;
then
if
[
-n
"
$ANYSERVICE
"
]
;
then
sudocmd anyservice list
sudocmd anyservice
--quiet
list
return
return
fi
fi
;;
;;
...
@@ -685,6 +680,49 @@ serv_list_startup()
...
@@ -685,6 +680,49 @@ serv_list_startup()
esac
esac
}
}
# File bin/serv-log:
__serv_log_altlinux
()
{
local
SERVICE
=
"
$1
"
case
"
$SERVICE
"
in
postfix
)
sudocmd
tail
-f
/var/log/mail/all /var/log/mail/errors
;;
cups
)
sudocmd
tail
-f
/var/log/cups/access_log /var/log/cups/error_log
;;
fail2ban
)
sudocmd
tail
-f
/var/log/
$SERVICE
.log
;;
*
)
fatal
"Have no suitable for
$SERVICE
service"
;;
esac
}
serv_log
()
{
local
SERVICE
=
"
$1
"
shift
case
$SERVICETYPE
in
systemd
)
sudocmd journalctl
-f
-b
-u
"
$SERVICE
"
"
$@
"
;;
*
)
case
$DISTRNAME
in
ALTLinux
)
__serv_log_altlinux
"
$SERVICE
"
return
;;
*
)
fatal
"Have no suitable for
$DISTRNAME
command for
$SERVICETYPE
"
;;
esac
esac
}
# File bin/serv-print:
# File bin/serv-print:
serv_print
()
serv_print
()
...
@@ -1498,8 +1536,8 @@ $(get_help HELPOPT)
...
@@ -1498,8 +1536,8 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"Service manager version 1.9.
3
"
echo
"Service manager version 1.9.
6
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Running on
$(
$DISTRVENDOR
)
with
$SERVICETYPE
"
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."
}
}
...
@@ -1570,6 +1608,9 @@ check_command()
...
@@ -1570,6 +1608,9 @@ check_command()
serv_cmd
=
print
serv_cmd
=
print
withoutservicename
=
1
withoutservicename
=
1
;;
;;
log|journal
)
# HELPCMD: print log for the service
serv_cmd
=
log
;;
*
)
*
)
return
1
return
1
;;
;;
...
...
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