["$nofail"="nofail"]||SUDO="fatal 'Can't find sudo. Please install and tune sudo ('# epm install sudo') or run epm under root.'"
return"$SUDO_TESTED"
fi
# if input is a console
if inputisatty && isatty && isatty2 ;then
if!$SUDO_CMD-l>/dev/null ;then
["$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"
fi
else
# use sudo if one is tuned and tuned without password
if!$SUDO_CMD-l-n>/dev/null 2>/dev/null ;then
["$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"
fi
fi
SUDO_TESTED="0"
# FIXME: does not work: sudo -- VARIABLE=some command
SUDO="$SUDO_CMD"
#SUDO="$SUDO_CMD --"
# check for < 1.7 version which do not support -- (and --help possible too)
["$nofail"="nofail"]||SUDO="fatal 'Can't find sudo. Please install and tune sudo ('# epm install sudo') or run epm under root.'"
return"$SUDO_TESTED"
fi
# if input is a console
if inputisatty && isatty && isatty2 ;then
if!$SUDO_CMD-l>/dev/null ;then
["$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"
fi
else
# use sudo if one is tuned and tuned without password
if!$SUDO_CMD-l-n>/dev/null 2>/dev/null ;then
["$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"
fi
fi
SUDO_TESTED="0"
# FIXME: does not work: sudo -- VARIABLE=some command
SUDO="$SUDO_CMD"
#SUDO="$SUDO_CMD --"
# check for < 1.7 version which do not support -- (and --help possible too)
echo" -a - print hardware architecture (--distro-arch for distro depended name)"
echo" -b - print size of arch bit (32/64)"
echo" -c - print number of CPU cores"
echo" -i - print virtualization type"
echo" -m - print system memory size (in MB)"
echo" -y|--service-manager - print running service manager"
echo" -z - print current CPU MHz"
echo" --glibc-version - print system glibc version"
echo
echo" -d|--base-distro-name - print distro id (short distro name)"
echo" -e - print full name of distro with version"
echo" -o | --os-name - print base OS name"
echo" -p | package-type - print type of the packaging system"
echo" -g - print name of the packaging system"
echo" -s|-n|--vendor-name - print name of the distro family (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"
echo" -a - print hardware architecture (--distro-arch for distro depended name)"
echo" -b - print size of arch bit (32/64)"
echo" -c - print number of CPU cores"
echo" -i - print virtualization type"
echo" -m - print system memory size (in MB)"
echo" -y|--service-manager - print running service manager"
echo" -z - print current CPU MHz"
echo" --glibc-version - print system glibc version"
echo
echo" -d|--base-distro-name - print distro id (short distro name)"
echo" -e - print full name of distro with version"
echo" -o | --os-name - print base OS name"
echo" -p | package-type - print type of the packaging system"
echo" -g - print name of the packaging system"
echo" -s|-n|--vendor-name - print name of the distro family (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"