Commit 9c497ea9 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.8.4

parent 2101abdd
...@@ -296,15 +296,21 @@ set_sudo() ...@@ -296,15 +296,21 @@ set_sudo()
# do not need sudo # do not need sudo
[ $EFFUID = "0" ] && return [ $EFFUID = "0" ] && return
# use sudo if possible if ! which sudo >/dev/null 2>/dev/null ; then
if which sudo >/dev/null 2>/dev/null ; then SUDO="fatal 'Can't find sudo. Please install and tune sudo or run epm under root.'"
SUDO="sudo --"
# check for < 1.7 version which do not support -- (and --help possible too)
sudo -h 2>/dev/null | grep -q " --" || SUDO="sudo"
return return
fi fi
SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'" # use sudo if one is tuned and tuned without password
if ! sudo -l -n >/dev/null 2>/dev/null ; then
SUDO="fatal 'Can't use sudo (only without password sudo is supported). Please run epm under root.'"
return
fi
SUDO="sudo --"
# check for < 1.7 version which do not support -- (and --help possible too)
sudo -h 2>/dev/null | grep -q " --" || SUDO="sudo"
} }
withtimeout() withtimeout()
...@@ -484,9 +490,9 @@ get_help() ...@@ -484,9 +490,9 @@ get_help()
continue continue
fi fi
echo "$n" | grep -q "^ *#" && continue echo "$n" | grep -q "^ *#" && continue
opt="$(echo $n | sed -e "s|) # $1:.*||g" -e 's|"||g' -e 's@^|@@')" #" opt=`echo $n | sed -e "s|) # $1:.*||g" -e 's|"||g' -e 's@^|@@'`
desc="$(echo $n | sed -e "s|.*) # $1:||g")" #" desc=`echo $n | sed -e "s|.*) # $1:||g"`
printf " %-20s %s\n" $opt "$desc" printf " %-20s %s\n" "$opt" "$desc"
done done
} }
...@@ -4757,6 +4763,16 @@ __check_system() ...@@ -4757,6 +4763,16 @@ __check_system()
if is_active_systemd systemd ; then if is_active_systemd systemd ; then
docmd epm --skip-installed install systemd || fatal docmd epm --skip-installed install systemd || fatal
fi fi
# switch from prefdm: https://bugzilla.altlinux.org/show_bug.cgi?id=26405#c52
if is_active_systemd systemd && serv display-manager status >/dev/null || serv prefdm status >/dev/null ; then
docmd systemctl disable prefdm.service
docmd systemctl disable display-manager.service
docmd systemctl enable display-manager.service
# docmd systemctl enable sddm.service
# docmd systemctl enable lightdm.service
fi
} }
__epm_ru_update() __epm_ru_update()
...@@ -9280,7 +9296,7 @@ Examples: ...@@ -9280,7 +9296,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.8.1 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.8.4 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2020" echo "Copyright (c) Etersoft 2012-2020"
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."
...@@ -9290,7 +9306,7 @@ print_version() ...@@ -9290,7 +9306,7 @@ print_version()
Usage="Usage: epm [options] <command> [package name(s), package files]..." Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager" Descr="epm - EPM package manager"
EPMVERSION=3.8.1 EPMVERSION=3.8.4
verbose= verbose=
quiet= quiet=
nodeps= nodeps=
...@@ -9613,7 +9629,7 @@ check_option() ...@@ -9613,7 +9629,7 @@ check_option()
# TODO: how to read arg? # TODO: how to read arg?
sort="$1" sort="$1"
;; ;;
--auto|--non-interactive) # HELPOPT: non interactive mode --auto|--assumeyes|--non-interactive) # HELPOPT: non interactive mode
non_interactive="--auto" non_interactive="--auto"
;; ;;
*) *)
......
...@@ -287,15 +287,21 @@ set_sudo() ...@@ -287,15 +287,21 @@ set_sudo()
# do not need sudo # do not need sudo
[ $EFFUID = "0" ] && return [ $EFFUID = "0" ] && return
# use sudo if possible if ! which sudo >/dev/null 2>/dev/null ; then
if which sudo >/dev/null 2>/dev/null ; then SUDO="fatal 'Can't find sudo. Please install and tune sudo or run epm under root.'"
SUDO="sudo --"
# check for < 1.7 version which do not support -- (and --help possible too)
sudo -h 2>/dev/null | grep -q " --" || SUDO="sudo"
return return
fi fi
SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'" # use sudo if one is tuned and tuned without password
if ! sudo -l -n >/dev/null 2>/dev/null ; then
SUDO="fatal 'Can't use sudo (only without password sudo is supported). Please run epm under root.'"
return
fi
SUDO="sudo --"
# check for < 1.7 version which do not support -- (and --help possible too)
sudo -h 2>/dev/null | grep -q " --" || SUDO="sudo"
} }
withtimeout() withtimeout()
...@@ -475,9 +481,9 @@ get_help() ...@@ -475,9 +481,9 @@ get_help()
continue continue
fi fi
echo "$n" | grep -q "^ *#" && continue echo "$n" | grep -q "^ *#" && continue
opt="$(echo $n | sed -e "s|) # $1:.*||g" -e 's|"||g' -e 's@^|@@')" #" opt=`echo $n | sed -e "s|) # $1:.*||g" -e 's|"||g' -e 's@^|@@'`
desc="$(echo $n | sed -e "s|.*) # $1:||g")" #" desc=`echo $n | sed -e "s|.*) # $1:||g"`
printf " %-20s %s\n" $opt "$desc" printf " %-20s %s\n" "$opt" "$desc"
done done
} }
...@@ -2782,7 +2788,7 @@ print_version() ...@@ -2782,7 +2788,7 @@ print_version()
local on_text="(host system)" local on_text="(host system)"
local virt="$($DISTRVENDOR -i)" local virt="$($DISTRVENDOR -i)"
[ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)" [ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)"
echo "Service manager version 3.8.1 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.8.4 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE" echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2019" echo "Copyright (c) Etersoft 2012-2019"
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."
...@@ -2816,10 +2822,6 @@ check_command() ...@@ -2816,10 +2822,6 @@ check_command()
status) # HELPCMD: show service status status) # HELPCMD: show service status
serv_cmd=status serv_cmd=status
;; ;;
usage) # HELPCMD: print out usage of the service
serv_cmd=usage
withoutservicename=1
;;
restart) # HELPCMD: restart service restart) # HELPCMD: restart service
serv_cmd=restart serv_cmd=restart
;; ;;
...@@ -2829,12 +2831,27 @@ check_command() ...@@ -2829,12 +2831,27 @@ check_command()
start) # HELPCMD: start service start) # HELPCMD: start service
serv_cmd=start serv_cmd=start
;; ;;
try-restart|condrestart) # HELPCMD: Restart service if running
serv_cmd=try_restart
;;
stop) # HELPCMD: stop service stop) # HELPCMD: stop service
serv_cmd=stop serv_cmd=stop
;; ;;
on|enable) # HELPCMD: add service to run on startup and start it now
serv_cmd=enable
;;
off|disable) # HELPCMD: remove service to run on startup and stop it now
serv_cmd=disable
;;
log|journal) # HELPCMD: print log for the service (-f - follow, -r - reverse order)
serv_cmd=log
;;
cat) # HELPCMD: print out service file for the service
serv_cmd=cat
;;
edit) # HELPCMD: edit service file overload (use --full to edit full file)
serv_cmd=edit
;;
test|-t) # HELPCMD: test a config file of the service
serv_cmd=test
;;
list) # HELPCMD: list running services list) # HELPCMD: list running services
serv_cmd=list serv_cmd=list
withoutservicename=1 withoutservicename=1
...@@ -2851,27 +2868,16 @@ check_command() ...@@ -2851,27 +2868,16 @@ check_command()
serv_cmd=list_failed serv_cmd=list_failed
withoutservicename=1 withoutservicename=1
;; ;;
on|enable) # HELPCMD: add service to run on startup and start it now
serv_cmd=enable
;;
off|disable) # HELPCMD: remove service to run on startup and stop it now
serv_cmd=disable
;;
print) # HELPCMD: print some info print) # HELPCMD: print some info
serv_cmd=print serv_cmd=print
withoutservicename=1 withoutservicename=1
;; ;;
log|journal) # HELPCMD: print log for the service (-f - follow, -r - reverse order) try-restart|condrestart) # HELPCMD: Restart service if running
serv_cmd=log serv_cmd=try_restart
;;
cat) # HELPCMD: print out service file for the service
serv_cmd=cat
;;
edit)
serv_cmd=edit # HELPCMD: edit service file overload (use --full to edit full file)
;; ;;
test|-t) usage) # HELPCMD: print out usage of the service
serv_cmd=test # HELPCMD: test a config file of the service serv_cmd=usage
withoutservicename=1
;; ;;
*) *)
return 1 return 1
......
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