Commit ba05be89 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.9.6

parent 6a3185bd
...@@ -3755,12 +3755,14 @@ construct_name() ...@@ -3755,12 +3755,14 @@ construct_name()
local arch="$3" local arch="$3"
local pkgtype="$4" local pkgtype="$4"
local ds="$5" local ds="$5"
local pds="$ds"
[ -n "$arch" ] || arch="$($DISTRVENDOR --distro-arch)" [ -n "$arch" ] || arch="$($DISTRVENDOR --distro-arch)"
[ -n "$pkgtype" ] || pkgtype="$($DISTRVENDOR -p)" [ -n "$pkgtype" ] || pkgtype="$($DISTRVENDOR -p)"
[ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype) [ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype)
[ "$pds" = "-" ] && pds="."
[ -n "$version" ] && version="$ds$version" [ -n "$version" ] && version="$ds$version"
echo "${name}${version}${ds/-/.}$arch.$pkgtype" echo "${name}${version}${pds}$arch.$pkgtype"
} }
epm_print() epm_print()
...@@ -5060,9 +5062,11 @@ epm_release_upgrade() ...@@ -5060,9 +5062,11 @@ epm_release_upgrade()
# File bin/epm-remove: # File bin/epm-remove:
RPMISNOTINSTALLED=202
__check_rpm_e_result() __check_rpm_e_result()
{ {
grep -q "is not installed" $1 && return 2 grep -q "is not installed" $1 && return $RPMISNOTINSTALLED
return $2 return $2
} }
...@@ -5078,6 +5082,7 @@ epm_remove_low() ...@@ -5078,6 +5082,7 @@ epm_remove_low()
cd /tmp || fatal cd /tmp || fatal
__epm_check_vendor $@ __epm_check_vendor $@
store_output sudocmd rpm -ev $noscripts $nodeps $@ store_output sudocmd rpm -ev $noscripts $nodeps $@
# rpm returns number of packages if failed on removing
__check_rpm_e_result $RC_STDOUT $? __check_rpm_e_result $RC_STDOUT $?
RES=$? RES=$?
clean_store_output clean_store_output
...@@ -5356,7 +5361,7 @@ epm_remove() ...@@ -5356,7 +5361,7 @@ epm_remove()
epm_remove_low $pkg_names && return epm_remove_low $pkg_names && return
local STATUS=$? local STATUS=$?
if [ -n "$direct" ] || [ -n "$nodeps" ] || [ "$STATUS" = "2" ]; then if [ -n "$direct" ] || [ -n "$nodeps" ] || [ "$STATUS" = "$RPMISNOTINSTALLED" ]; then
return $STATUS return $STATUS
fi fi
...@@ -8441,6 +8446,11 @@ get_core_count() ...@@ -8441,6 +8446,11 @@ get_core_count()
echo $detected echo $detected
} }
get_core_mhz()
{
cat /proc/cpuinfo | grep "cpu MHz" | head -n1 | cut -d':' -f2 | cut -d' ' -f2 | cut -d'.' -f1
}
get_virt() get_virt()
{ {
...@@ -8494,7 +8504,7 @@ Pretty distro name (--pretty): $(print_pretty_name) ...@@ -8494,7 +8504,7 @@ Pretty distro name (--pretty): $(print_pretty_name)
Package manager/type (-g/-p): $(pkgmanager) / $(pkgtype) Package manager/type (-g/-p): $(pkgmanager) / $(pkgtype)
Running service manager (-y): $(get_service_manager) Running service manager (-y): $(get_service_manager)
Virtualization (-i): $(get_virt) Virtualization (-i): $(get_virt)
CPU Cores (-c): $(get_core_count) CPU Cores/MHz (-c/-z): $(get_core_count) / $(get_core_mhz) MHz
CPU Architecture (-a): $(get_arch) CPU Architecture (-a): $(get_arch)
CPU norm register size (-b): $(get_bit_size) CPU norm register size (-b): $(get_bit_size)
System memory size (MB) (-m): $(get_memory_size) System memory size (MB) (-m): $(get_memory_size)
...@@ -8515,6 +8525,7 @@ case $1 in ...@@ -8515,6 +8525,7 @@ case $1 in
echo " -a - print hardware architecture (--distro-arch for distro depended name)" echo " -a - print hardware architecture (--distro-arch for distro depended name)"
echo " -b - print size of arch bit (32/64)" echo " -b - print size of arch bit (32/64)"
echo " -c - print number of CPU cores" echo " -c - print number of CPU cores"
echo " -z - print current CPU MHz"
echo " -d - print distro name" echo " -d - print distro name"
echo " -e - print full name of distro with version" echo " -e - print full name of distro with version"
echo " -i - print virtualization type" echo " -i - print virtualization type"
...@@ -8571,6 +8582,9 @@ case $1 in ...@@ -8571,6 +8582,9 @@ case $1 in
-c) -c)
get_core_count get_core_count
;; ;;
-z)
get_core_mhz
;;
-i) -i)
get_virt get_virt
;; ;;
...@@ -8687,6 +8701,7 @@ scat() ...@@ -8687,6 +8701,7 @@ scat()
{ {
$CURL -L $CURLQ "$1" $CURL -L $CURLQ "$1"
} }
# download to default name of to $2 # download to default name of to $2
sget() sget()
{ {
...@@ -8781,14 +8796,21 @@ if echo "$1" | grep -q "^https://github.com/" && ! echo "$1" | grep -q "/release ...@@ -8781,14 +8796,21 @@ if echo "$1" | grep -q "^https://github.com/" && ! echo "$1" | grep -q "/release
MASK="$2" MASK="$2"
if [ -n "$LISTONLY" ] ; then if [ -n "$LISTONLY" ] ; then
get_github_urls "$1" | filter_glob "$MASK" | filter_order fn=''
for fn in $(get_github_urls "$1" | filter_glob "$MASK" | filter_order) ; do
echo "$fn"
done
test -n "$fn"
return return
fi fi
ERROR=0
fn=''
for fn in $(get_github_urls "$1" | filter_glob "$MASK" | filter_order) ; do for fn in $(get_github_urls "$1" | filter_glob "$MASK" | filter_order) ; do
sget "$fn" || ERROR=1 sget "$fn" || ERROR=1
done done
return test -n "$fn" || ERROR=1
return $ERROR
fi fi
...@@ -8824,17 +8846,21 @@ get_urls() ...@@ -8824,17 +8846,21 @@ get_urls()
} }
if [ -n "$LISTONLY" ] ; then if [ -n "$LISTONLY" ] ; then
fn=''
for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do
# TODO: return full url? someone use old behaviour? # TODO: return full url? someone use old behaviour?
echo "$(basename "$fn")" echo "$(basename "$fn")"
done done
test -n "$fn"
return return
fi fi
ERROR=0 ERROR=0
fn=''
for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do
sget "$URL/$(basename "$fn")" || ERROR=1 sget "$URL/$(basename "$fn")" || ERROR=1
done done
test -n "$fn" || ERROR=1
return $ERROR return $ERROR
} }
...@@ -9394,7 +9420,7 @@ Examples: ...@@ -9394,7 +9420,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.9.4 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.9.6 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."
...@@ -9404,7 +9430,7 @@ print_version() ...@@ -9404,7 +9430,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.9.4 EPMVERSION=3.9.6
verbose= verbose=
quiet= quiet=
nodeps= nodeps=
......
...@@ -1784,6 +1784,11 @@ get_core_count() ...@@ -1784,6 +1784,11 @@ get_core_count()
echo $detected echo $detected
} }
get_core_mhz()
{
cat /proc/cpuinfo | grep "cpu MHz" | head -n1 | cut -d':' -f2 | cut -d' ' -f2 | cut -d'.' -f1
}
get_virt() get_virt()
{ {
...@@ -1837,7 +1842,7 @@ Pretty distro name (--pretty): $(print_pretty_name) ...@@ -1837,7 +1842,7 @@ Pretty distro name (--pretty): $(print_pretty_name)
Package manager/type (-g/-p): $(pkgmanager) / $(pkgtype) Package manager/type (-g/-p): $(pkgmanager) / $(pkgtype)
Running service manager (-y): $(get_service_manager) Running service manager (-y): $(get_service_manager)
Virtualization (-i): $(get_virt) Virtualization (-i): $(get_virt)
CPU Cores (-c): $(get_core_count) CPU Cores/MHz (-c/-z): $(get_core_count) / $(get_core_mhz) MHz
CPU Architecture (-a): $(get_arch) CPU Architecture (-a): $(get_arch)
CPU norm register size (-b): $(get_bit_size) CPU norm register size (-b): $(get_bit_size)
System memory size (MB) (-m): $(get_memory_size) System memory size (MB) (-m): $(get_memory_size)
...@@ -1858,6 +1863,7 @@ case $1 in ...@@ -1858,6 +1863,7 @@ case $1 in
echo " -a - print hardware architecture (--distro-arch for distro depended name)" echo " -a - print hardware architecture (--distro-arch for distro depended name)"
echo " -b - print size of arch bit (32/64)" echo " -b - print size of arch bit (32/64)"
echo " -c - print number of CPU cores" echo " -c - print number of CPU cores"
echo " -z - print current CPU MHz"
echo " -d - print distro name" echo " -d - print distro name"
echo " -e - print full name of distro with version" echo " -e - print full name of distro with version"
echo " -i - print virtualization type" echo " -i - print virtualization type"
...@@ -1914,6 +1920,9 @@ case $1 in ...@@ -1914,6 +1920,9 @@ case $1 in
-c) -c)
get_core_count get_core_count
;; ;;
-z)
get_core_mhz
;;
-i) -i)
get_virt get_virt
;; ;;
...@@ -2030,6 +2039,7 @@ scat() ...@@ -2030,6 +2039,7 @@ scat()
{ {
$CURL -L $CURLQ "$1" $CURL -L $CURLQ "$1"
} }
# download to default name of to $2 # download to default name of to $2
sget() sget()
{ {
...@@ -2124,14 +2134,21 @@ if echo "$1" | grep -q "^https://github.com/" && ! echo "$1" | grep -q "/release ...@@ -2124,14 +2134,21 @@ if echo "$1" | grep -q "^https://github.com/" && ! echo "$1" | grep -q "/release
MASK="$2" MASK="$2"
if [ -n "$LISTONLY" ] ; then if [ -n "$LISTONLY" ] ; then
get_github_urls "$1" | filter_glob "$MASK" | filter_order fn=''
for fn in $(get_github_urls "$1" | filter_glob "$MASK" | filter_order) ; do
echo "$fn"
done
test -n "$fn"
return return
fi fi
ERROR=0
fn=''
for fn in $(get_github_urls "$1" | filter_glob "$MASK" | filter_order) ; do for fn in $(get_github_urls "$1" | filter_glob "$MASK" | filter_order) ; do
sget "$fn" || ERROR=1 sget "$fn" || ERROR=1
done done
return test -n "$fn" || ERROR=1
return $ERROR
fi fi
...@@ -2167,17 +2184,21 @@ get_urls() ...@@ -2167,17 +2184,21 @@ get_urls()
} }
if [ -n "$LISTONLY" ] ; then if [ -n "$LISTONLY" ] ; then
fn=''
for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do
# TODO: return full url? someone use old behaviour? # TODO: return full url? someone use old behaviour?
echo "$(basename "$fn")" echo "$(basename "$fn")"
done done
test -n "$fn"
return return
fi fi
ERROR=0 ERROR=0
fn=''
for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do
sget "$URL/$(basename "$fn")" || ERROR=1 sget "$URL/$(basename "$fn")" || ERROR=1
done done
test -n "$fn" || ERROR=1
return $ERROR return $ERROR
} }
...@@ -2803,7 +2824,7 @@ print_version() ...@@ -2803,7 +2824,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.9.4 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.9.6 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."
......
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