Commit ef4fd367 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.21.5

parent 0cb88337
...@@ -355,13 +355,13 @@ set_sudo() ...@@ -355,13 +355,13 @@ set_sudo()
# if input is a console # if input is a console
if inputisatty && isatty && isatty2 ; then if inputisatty && isatty && isatty2 ; then
if ! $SUDO_CMD -l >/dev/null ; then if ! $SUDO_CMD -l >/dev/null ; then
[ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only without password sudo is supported in non interactive using). Please run epm under root.'" [ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only passwordless sudo is supported in non interactive using). Please run epm under root.'"
return "$SUDO_TESTED" return "$SUDO_TESTED"
fi fi
else else
# use sudo if one is tuned and tuned without password # use sudo if one is tuned and tuned without password
if ! $SUDO_CMD -l -n >/dev/null 2>/dev/null ; then if ! $SUDO_CMD -l -n >/dev/null 2>/dev/null ; then
[ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only without password sudo is supported). Please run epm under root or check http://altlinux.org/sudo.'" [ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only passwordless sudo is supported). Please run epm under root or check http://altlinux.org/sudo.'"
return "$SUDO_TESTED" return "$SUDO_TESTED"
fi fi
fi fi
...@@ -373,6 +373,11 @@ set_sudo() ...@@ -373,6 +373,11 @@ set_sudo()
} }
sudo_allowed()
{
set_sudo nofail
}
withtimeout() withtimeout()
{ {
local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null) local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null)
...@@ -1568,7 +1573,7 @@ case $PMTYPE in ...@@ -1568,7 +1573,7 @@ case $PMTYPE in
# sudocmd urpme --auto-orphans # sudocmd urpme --auto-orphans
# ;; # ;;
zypper-rpm) zypper-rpm)
sudocmd zypper verify sudocmd zypper $(subst_option non_interactive --non-interactive) verify
;; ;;
conary) conary)
sudocmd conary verify sudocmd conary verify
...@@ -2509,8 +2514,7 @@ __epm_filelist_remote() ...@@ -2509,8 +2514,7 @@ __epm_filelist_remote()
;; ;;
apt-dpkg) apt-dpkg)
assure_exists apt-file || return assure_exists apt-file || return
# TODO: improve me if sudo_allowed ; then
if sudorun -n true 2>/dev/null ; then
sudocmd apt-file update sudocmd apt-file update
else else
info "sudo requires a password, skip apt-file update" info "sudo requires a password, skip apt-file update"
...@@ -3123,8 +3127,8 @@ epm_install_files() ...@@ -3123,8 +3127,8 @@ epm_install_files()
# TODO: don't resolve fuzzy dependencies () # TODO: don't resolve fuzzy dependencies ()
# are there apt that don't support dpkg files to install? # are there apt that don't support dpkg files to install?
#epm_install_names $(make_filepath "$@") epm_install_names $(make_filepath "$@")
#return return
# old way: # old way:
...@@ -8816,7 +8820,7 @@ case $PMTYPE in ...@@ -8816,7 +8820,7 @@ case $PMTYPE in
sudocmd aura -A -y sudocmd aura -A -y
;; ;;
zypper-rpm) zypper-rpm)
sudocmd zypper refresh sudocmd zypper $(subst_option non_interactive --non-interactive) refresh
;; ;;
emerge) emerge)
sudocmd emerge --sync sudocmd emerge --sync
...@@ -8946,7 +8950,7 @@ epm_upgrade() ...@@ -8946,7 +8950,7 @@ epm_upgrade()
CMD="urpmi --update --auto-select $*" CMD="urpmi --update --auto-select $*"
;; ;;
zypper-rpm) zypper-rpm)
CMD="zypper dist-upgrade" CMD="zypper $(subst_option non_interactive --non-interactive) dist-upgrade"
;; ;;
pacman) pacman)
CMD="pacman -S -u $force" CMD="pacman -S -u $force"
...@@ -10936,7 +10940,7 @@ Examples: ...@@ -10936,7 +10940,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.21.4 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.21.5 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-2021" echo "Copyright (c) Etersoft 2012-2021"
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."
...@@ -10946,7 +10950,7 @@ print_version() ...@@ -10946,7 +10950,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.21.4 EPMVERSION=3.21.5
verbose=$EPM_VERBOSE verbose=$EPM_VERBOSE
quiet= quiet=
nodeps= nodeps=
......
...@@ -346,13 +346,13 @@ set_sudo() ...@@ -346,13 +346,13 @@ set_sudo()
# if input is a console # if input is a console
if inputisatty && isatty && isatty2 ; then if inputisatty && isatty && isatty2 ; then
if ! $SUDO_CMD -l >/dev/null ; then if ! $SUDO_CMD -l >/dev/null ; then
[ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only without password sudo is supported in non interactive using). Please run epm under root.'" [ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only passwordless sudo is supported in non interactive using). Please run epm under root.'"
return "$SUDO_TESTED" return "$SUDO_TESTED"
fi fi
else else
# use sudo if one is tuned and tuned without password # use sudo if one is tuned and tuned without password
if ! $SUDO_CMD -l -n >/dev/null 2>/dev/null ; then if ! $SUDO_CMD -l -n >/dev/null 2>/dev/null ; then
[ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only without password sudo is supported). Please run epm under root or check http://altlinux.org/sudo.'" [ "$nofail" = "nofail" ] || SUDO="fatal 'Can't use sudo (only passwordless sudo is supported). Please run epm under root or check http://altlinux.org/sudo.'"
return "$SUDO_TESTED" return "$SUDO_TESTED"
fi fi
fi fi
...@@ -364,6 +364,11 @@ set_sudo() ...@@ -364,6 +364,11 @@ set_sudo()
} }
sudo_allowed()
{
set_sudo nofail
}
withtimeout() withtimeout()
{ {
local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null) local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null)
...@@ -2250,7 +2255,7 @@ print_version() ...@@ -2250,7 +2255,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.21.4 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.21.5 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-2021" echo "Copyright (c) Etersoft 2012-2021"
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."
......
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