Commit a14f59c0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p8 as 1.8.8-alt0.M80P.1 (with rpmbph script)

parents 2d38b639 aaad900a
......@@ -18,6 +18,7 @@
#
load_helper epm-query
load_helper epm-assure
load_helper epm-check_updated_repo
# TODO: use when run install with epm --skip-installed install
......@@ -327,13 +328,16 @@ epm_install_files()
apt-rpm)
__epm_check_if_try_install_deb $@ && return
sudocmd rpm -Uvh $force $nodeps $@ && return
local RES=$?
# do not use low-level for install by file path
if ! is_dirpath "$@" || [ "$(get_package_type "$@")" = "rpm" ] ; then
sudocmd rpm -Uvh $force $nodeps $@ && return
local RES=$?
__epm_check_if_rpm_already_installed $@ && return
__epm_check_if_rpm_already_installed $@ && return
# if run with --nodeps, do not fallback on hi level
[ -n "$nodeps" ] && return $RES
fi
# use install_names
;;
......
......@@ -98,12 +98,13 @@ is_active_systemd && CMD="systemd"
SERVICETYPE=$CMD
ANYSERVICE=$(which anyservice 2>/dev/null >/dev/null)
ANYSERVICE=$(which anyservice 2>/dev/null)
ANYSERVDIR="/etc/systemd-lite"
ANYSYSDDIR="/lib/systemd/system"
}
# TODO: done it on anyservice part
is_anyservice()
{
local SERVICE="$1"
......@@ -111,8 +112,11 @@ is_anyservice()
[ -n "$ANYSERVICE" ] || return 1
# not, if there is regular service with the name
[ -d "$INITDIR/$SERVICE" ] && return 1
# yes, if the service is anyservice driven
[ -r "$ANYSERVDIR/$SERVICE.service" ]
# yes, the service is anyservice driven
[ -r "$ANYSERVDIR/$SERVICE.service" ] && return 0
# yes, the service can be anyservice driven
[ -r "$ANYSYSDDIR/$SERVICE.service" ] && return 0
return 1
}
......
......@@ -23,6 +23,8 @@ load_helper serv-status
# Enable service by default
serv_disable()
{
local SERVICE="$1"
is_service_running $1 && { serv_stop $1 || return ; }
is_service_autostart $1 || { echo "Service $1 already disabled for startup" && return ; }
......
......@@ -21,15 +21,15 @@ load_helper serv-start
load_helper serv-status
# Enable service by default
serv_enable()
__serv_enable()
{
is_service_running $1 || serv_start $1 || return
local SERVICE="$1"
is_service_autostart $1 && echo "Service $1 already enabled for startup" && return
case $SERVICETYPE in
service-chkconfig)
# can't use is_anyservice here
if [ ! -d "$INITDIR/$SERVICE" ] && [ -n "$ANYSERVICE" ] && [ -r "$ANYSYSDDIR/$SERVICE.service" ] ; then
if is_anyservice $SERVICE ; then
sudocmd anyservice $SERVICE on
return
fi
......@@ -52,3 +52,10 @@ serv_enable()
esac
}
serv_enable()
{
__serv_enable "$1" || return
# start if need
is_service_running $1 || serv_start $1 || return
}
......@@ -20,9 +20,11 @@
# FIXME: sudo ask password, but we do not print command before
is_service_running()
{
local SERVICE="$1"
case $SERVICETYPE in
service-chkconfig|service-upstart)
if is_anyservice $SERVICE ; then
if is_anyservice $1 ; then
$SUDO anyservice $1 status >/dev/null
return
fi
......@@ -43,12 +45,16 @@ is_service_running()
# FIXME: sudo ask password, but we do not print command before
is_service_autostart()
{
local SERVICE="$1"
case $SERVICETYPE in
service-chkconfig|service-upstart)
if is_anyservice $SERVICE ; then
# if is registered, assume it is autostarted
return 0
if is_anyservice $1; then
# HACK: if is registered, assume it is autostarted
[ -r "$ANYSERVDIR/$SERVICE.service" ]
return
fi
# FIXME: check for current runlevel
LANG=C $SUDO chkconfig $1 --list | grep -q "[35]:on"
;;
......
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 1.8.7
Version: 1.8.8
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
......@@ -67,9 +67,14 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%changelog
* Sun Aug 14 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.7-alt0.M80P.1
* Mon Aug 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.8-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
* Mon Aug 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.8-alt1
- epm-install: skip low-level when install by path
- anyservice support fixes
- serv: some anyssh fixes
* Sun Aug 14 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.7-alt1
- realize autoorphans/autoremove for zypper >= 1.9.2 in SUSE
- introduce epm remove-old-kernels command
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment