Commit 73ebc549 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.16.6

parent f78f458a
...@@ -8801,8 +8801,8 @@ override_distrib() ...@@ -8801,8 +8801,8 @@ override_distrib()
DISTRIB_RELEASE="$(echo "$1" | sed -e 's|.*/||')" DISTRIB_RELEASE="$(echo "$1" | sed -e 's|.*/||')"
} }
# Translate DISTRIB_ID to vendor name (like %_vendor does), uses VENDOR_ID by default # Translate DISTRIB_ID to vendor name (like %_vendor does or package release name uses), uses VENDOR_ID by default
rpmvendor() pkgvendor()
{ {
[ "$DISTRIB_ID" = "ALTLinux" ] && echo "alt" && return [ "$DISTRIB_ID" = "ALTLinux" ] && echo "alt" && return
[ "$DISTRIB_ID" = "ALTServer" ] && echo "alt" && return [ "$DISTRIB_ID" = "ALTServer" ] && echo "alt" && return
...@@ -8813,17 +8813,14 @@ rpmvendor() ...@@ -8813,17 +8813,14 @@ rpmvendor()
[ "$DISTRIB_ID" = "OpenSUSE" ] && echo "suse" && return [ "$DISTRIB_ID" = "OpenSUSE" ] && echo "suse" && return
[ "$DISTRIB_ID" = "openSUSETumbleweed" ] && echo "suse" && return [ "$DISTRIB_ID" = "openSUSETumbleweed" ] && echo "suse" && return
[ "$DISTRIB_ID" = "openSUSELeap" ] && echo "suse" && return [ "$DISTRIB_ID" = "openSUSELeap" ] && echo "suse" && return
[ -n "$VENDOR_ID" ] && echo "$VENDOR_ID" && return if [ -n "$VENDOR_ID" ] ; then
[ "$VENDOR_ID" = "altlinux" ] && echo "alt" && return
echo "$VENDOR_ID"
return
fi
tolower "$DISTRIB_ID" tolower "$DISTRIB_ID"
} }
# Translate DISTRIB_ID name to package manner (like in the package release name)
pkgvendor()
{
[ "$DISTRIB_ID" = "Mandriva" ] && echo "mdv" && return
rpmvendor
}
# TODO: in more appropriate way # TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend" #which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
...@@ -8862,7 +8859,7 @@ case $DISTRIB_ID in ...@@ -8862,7 +8859,7 @@ case $DISTRIB_ID in
ArchLinux) ArchLinux)
CMD="pacman" CMD="pacman"
;; ;;
Fedora|FedoraLinux|LinuxXP|ASPLinux|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|Scientific|GosLinux|Amzn|RedOS) Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|Scientific|GosLinux|Amzn|RedOS)
CMD="dnf-rpm" CMD="dnf-rpm"
hascommand dnf || CMD=yum-rpm hascommand dnf || CMD=yum-rpm
[ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm [ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm
...@@ -8967,13 +8964,21 @@ get_major_version() ...@@ -8967,13 +8964,21 @@ get_major_version()
normalize_name() normalize_name()
{ {
[ "$1" = "RED OS" ] && echo "RedOS" && return case "$1" in
[ "$1" = "CentOS Linux" ] && echo "CentOS" && return "RED OS")
[ "$1" = "Rocky Linux" ] && echo "RockyLinux" && return echo "RedOS"
[ "$1" = "Oracle Linux" ] && echo "OracleLinux" && return ;;
[ "$1" = "Alma Linux" ] && echo "AlmaLinux" && return "CentOS Linux")
#echo "${1// /}" echo "CentOS"
echo "$1" | sed -e "s/ //g" ;;
"Fedora Linux")
echo "Fedora"
;;
*)
#echo "${1// /}"
echo "$1" | sed -e "s/ //g"
;;
esac
} }
# Default values # Default values
...@@ -9053,6 +9058,17 @@ elif distro gentoo-release ; then ...@@ -9053,6 +9058,17 @@ elif distro gentoo-release ; then
elif [ "$DISTRIB_ID" = "ALTServer" ] ; then elif [ "$DISTRIB_ID" = "ALTServer" ] ; then
DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g") DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g")
elif [ "$DISTRIB_ID" = "ALTSPWorkstation" ] ; then
DISTRIB_ID="ALTLinux"
case "$DISTRIB_RELEASE" in
8.0|8.1)
;;
8.*)
DISTRIB_RELEASE="c9"
;;
esac
DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g")
elif distro slackware-version ; then elif distro slackware-version ; then
DISTRIB_ID="Slackware" DISTRIB_ID="Slackware"
DISTRIB_RELEASE="$(grep -Eo '[0-9]+\.[0-9]+' $DISTROFILE)" DISTRIB_RELEASE="$(grep -Eo '[0-9]+\.[0-9]+' $DISTROFILE)"
...@@ -9471,8 +9487,7 @@ Pretty distro name (--pretty): $(print_pretty_name) ...@@ -9471,8 +9487,7 @@ Pretty distro name (--pretty): $(print_pretty_name)
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)
Base OS name (-o): $(get_base_os_name) Base OS name (-o): $(get_base_os_name)
Build system distro name (-s): $(pkgvendor) Base distro name (-s|-n): $(pkgvendor)
Build system vendor name (-n): $(rpmvendor)
(run with -h to get help) (run with -h to get help)
EOF EOF
...@@ -9493,11 +9508,10 @@ case $1 in ...@@ -9493,11 +9508,10 @@ case $1 in
echo " -i - print virtualization type" echo " -i - print virtualization type"
echo " -h - this help" echo " -h - this help"
echo " -m - print system memory size (in MB)" echo " -m - print system memory size (in MB)"
echo " -n [SystemName] - print vendor name (as _vendor macros in rpm)"
echo " -o - print base OS name" echo " -o - print base OS name"
echo " -p [SystemName] - print type of the packaging system" echo " -p [SystemName] - print type of the packaging system"
echo " -g [SystemName] - print name of the packaging system" echo " -g [SystemName] - print name of the packaging system"
echo " -s [SystemName] - print name of distro for build system (like in the package release name)" echo " -s|-n [SystemName] - print base name of the distro (ubuntu for all Ubuntu family, alt for all ALT family) (as _vendor macros in rpm)"
echo " -y - print running service manager" echo " -y - print running service manager"
echo " --pretty - print pretty distro name" echo " --pretty - print pretty distro name"
echo " -v - print version of distro" echo " -v - print version of distro"
...@@ -9555,16 +9569,11 @@ case $1 in ...@@ -9555,16 +9569,11 @@ case $1 in
-v) -v)
echo $DISTRIB_RELEASE echo $DISTRIB_RELEASE
;; ;;
-s) -s|-n)
override_distrib "$2" override_distrib "$2"
pkgvendor pkgvendor
exit 0 exit 0
;; ;;
-n)
override_distrib "$2"
rpmvendor
exit 0
;;
-y) -y)
get_service_manager get_service_manager
;; ;;
...@@ -10381,7 +10390,7 @@ Examples: ...@@ -10381,7 +10390,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.16.5 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.16.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-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."
...@@ -10391,7 +10400,7 @@ print_version() ...@@ -10391,7 +10400,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.16.5 EPMVERSION=3.16.6
verbose=$EPM_VERBOSE verbose=$EPM_VERBOSE
quiet= quiet=
nodeps= nodeps=
......
...@@ -1337,8 +1337,8 @@ override_distrib() ...@@ -1337,8 +1337,8 @@ override_distrib()
DISTRIB_RELEASE="$(echo "$1" | sed -e 's|.*/||')" DISTRIB_RELEASE="$(echo "$1" | sed -e 's|.*/||')"
} }
# Translate DISTRIB_ID to vendor name (like %_vendor does), uses VENDOR_ID by default # Translate DISTRIB_ID to vendor name (like %_vendor does or package release name uses), uses VENDOR_ID by default
rpmvendor() pkgvendor()
{ {
[ "$DISTRIB_ID" = "ALTLinux" ] && echo "alt" && return [ "$DISTRIB_ID" = "ALTLinux" ] && echo "alt" && return
[ "$DISTRIB_ID" = "ALTServer" ] && echo "alt" && return [ "$DISTRIB_ID" = "ALTServer" ] && echo "alt" && return
...@@ -1349,17 +1349,14 @@ rpmvendor() ...@@ -1349,17 +1349,14 @@ rpmvendor()
[ "$DISTRIB_ID" = "OpenSUSE" ] && echo "suse" && return [ "$DISTRIB_ID" = "OpenSUSE" ] && echo "suse" && return
[ "$DISTRIB_ID" = "openSUSETumbleweed" ] && echo "suse" && return [ "$DISTRIB_ID" = "openSUSETumbleweed" ] && echo "suse" && return
[ "$DISTRIB_ID" = "openSUSELeap" ] && echo "suse" && return [ "$DISTRIB_ID" = "openSUSELeap" ] && echo "suse" && return
[ -n "$VENDOR_ID" ] && echo "$VENDOR_ID" && return if [ -n "$VENDOR_ID" ] ; then
[ "$VENDOR_ID" = "altlinux" ] && echo "alt" && return
echo "$VENDOR_ID"
return
fi
tolower "$DISTRIB_ID" tolower "$DISTRIB_ID"
} }
# Translate DISTRIB_ID name to package manner (like in the package release name)
pkgvendor()
{
[ "$DISTRIB_ID" = "Mandriva" ] && echo "mdv" && return
rpmvendor
}
# TODO: in more appropriate way # TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend" #which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
...@@ -1398,7 +1395,7 @@ case $DISTRIB_ID in ...@@ -1398,7 +1395,7 @@ case $DISTRIB_ID in
ArchLinux) ArchLinux)
CMD="pacman" CMD="pacman"
;; ;;
Fedora|FedoraLinux|LinuxXP|ASPLinux|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|Scientific|GosLinux|Amzn|RedOS) Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|Scientific|GosLinux|Amzn|RedOS)
CMD="dnf-rpm" CMD="dnf-rpm"
hascommand dnf || CMD=yum-rpm hascommand dnf || CMD=yum-rpm
[ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm [ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm
...@@ -1503,13 +1500,21 @@ get_major_version() ...@@ -1503,13 +1500,21 @@ get_major_version()
normalize_name() normalize_name()
{ {
[ "$1" = "RED OS" ] && echo "RedOS" && return case "$1" in
[ "$1" = "CentOS Linux" ] && echo "CentOS" && return "RED OS")
[ "$1" = "Rocky Linux" ] && echo "RockyLinux" && return echo "RedOS"
[ "$1" = "Oracle Linux" ] && echo "OracleLinux" && return ;;
[ "$1" = "Alma Linux" ] && echo "AlmaLinux" && return "CentOS Linux")
#echo "${1// /}" echo "CentOS"
echo "$1" | sed -e "s/ //g" ;;
"Fedora Linux")
echo "Fedora"
;;
*)
#echo "${1// /}"
echo "$1" | sed -e "s/ //g"
;;
esac
} }
# Default values # Default values
...@@ -1589,6 +1594,17 @@ elif distro gentoo-release ; then ...@@ -1589,6 +1594,17 @@ elif distro gentoo-release ; then
elif [ "$DISTRIB_ID" = "ALTServer" ] ; then elif [ "$DISTRIB_ID" = "ALTServer" ] ; then
DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g") DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g")
elif [ "$DISTRIB_ID" = "ALTSPWorkstation" ] ; then
DISTRIB_ID="ALTLinux"
case "$DISTRIB_RELEASE" in
8.0|8.1)
;;
8.*)
DISTRIB_RELEASE="c9"
;;
esac
DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g")
elif distro slackware-version ; then elif distro slackware-version ; then
DISTRIB_ID="Slackware" DISTRIB_ID="Slackware"
DISTRIB_RELEASE="$(grep -Eo '[0-9]+\.[0-9]+' $DISTROFILE)" DISTRIB_RELEASE="$(grep -Eo '[0-9]+\.[0-9]+' $DISTROFILE)"
...@@ -2007,8 +2023,7 @@ Pretty distro name (--pretty): $(print_pretty_name) ...@@ -2007,8 +2023,7 @@ Pretty distro name (--pretty): $(print_pretty_name)
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)
Base OS name (-o): $(get_base_os_name) Base OS name (-o): $(get_base_os_name)
Build system distro name (-s): $(pkgvendor) Base distro name (-s|-n): $(pkgvendor)
Build system vendor name (-n): $(rpmvendor)
(run with -h to get help) (run with -h to get help)
EOF EOF
...@@ -2029,11 +2044,10 @@ case $1 in ...@@ -2029,11 +2044,10 @@ case $1 in
echo " -i - print virtualization type" echo " -i - print virtualization type"
echo " -h - this help" echo " -h - this help"
echo " -m - print system memory size (in MB)" echo " -m - print system memory size (in MB)"
echo " -n [SystemName] - print vendor name (as _vendor macros in rpm)"
echo " -o - print base OS name" echo " -o - print base OS name"
echo " -p [SystemName] - print type of the packaging system" echo " -p [SystemName] - print type of the packaging system"
echo " -g [SystemName] - print name of the packaging system" echo " -g [SystemName] - print name of the packaging system"
echo " -s [SystemName] - print name of distro for build system (like in the package release name)" echo " -s|-n [SystemName] - print base name of the distro (ubuntu for all Ubuntu family, alt for all ALT family) (as _vendor macros in rpm)"
echo " -y - print running service manager" echo " -y - print running service manager"
echo " --pretty - print pretty distro name" echo " --pretty - print pretty distro name"
echo " -v - print version of distro" echo " -v - print version of distro"
...@@ -2091,16 +2105,11 @@ case $1 in ...@@ -2091,16 +2105,11 @@ case $1 in
-v) -v)
echo $DISTRIB_RELEASE echo $DISTRIB_RELEASE
;; ;;
-s) -s|-n)
override_distrib "$2" override_distrib "$2"
pkgvendor pkgvendor
exit 0 exit 0
;; ;;
-n)
override_distrib "$2"
rpmvendor
exit 0
;;
-y) -y)
get_service_manager get_service_manager
;; ;;
...@@ -2985,7 +2994,7 @@ print_version() ...@@ -2985,7 +2994,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.16.5 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.16.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-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