Commit ec84e721 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.64.6

parent eb63657e
...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR ...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR=$PROGDIR/../etc CONFIGDIR=$PROGDIR/../etc
export EPMVERSION="3.64.5" export EPMVERSION="3.64.6"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -294,6 +294,28 @@ strip_spaces() ...@@ -294,6 +294,28 @@ strip_spaces()
echo "$*" | filter_strip_spaces echo "$*" | filter_strip_spaces
} }
firstupper()
{
# FIXME: works with GNU sed only
echo "$*" | sed 's/.*/\u&/'
}
tolower()
{
# tr is broken in busybox (checked with OpenWrt)
#echo "$*" | tr "[:upper:]" "[:lower:]"
echo "$*" | awk '{print tolower($0)}'
}
firstword()
{
echo "$*" | cut -f1 -d" "
}
lastword()
{
echo "$*" | xargs -n1 echo 2>/dev/null | tail -n1
}
sed_escape() sed_escape()
{ {
...@@ -13769,7 +13791,7 @@ epm_status_thirdparty() ...@@ -13769,7 +13791,7 @@ epm_status_thirdparty()
echo "$distribution" | grep -q "^EEPM" && return 1 echo "$distribution" | grep -q "^EEPM" && return 1
return 0 return 0
;; ;;
rosafresh|mos) rosa*|mos)
epm_status_validate $pkg || return 1 epm_status_validate $pkg || return 1
echo "$distribution" | grep -q "^ROSA" && return 1 echo "$distribution" | grep -q "^ROSA" && return 1
...@@ -14555,6 +14577,19 @@ tolower() ...@@ -14555,6 +14577,19 @@ tolower()
echo "$*" | awk '{print tolower($0)}' echo "$*" | awk '{print tolower($0)}'
} }
# copied from estrlist
firstword()
{
echo "$*" | cut -f1 -d" "
}
lastword()
{
echo "$*" | xargs -n1 echo 2>/dev/null | tail -n1
}
print_bug_report_url() print_bug_report_url()
{ {
echo "$BUG_REPORT_URL" echo "$BUG_REPORT_URL"
...@@ -14607,6 +14642,7 @@ pkgvendor() ...@@ -14607,6 +14642,7 @@ pkgvendor()
#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"
# Print package manager (need DISTRIB_ID, DISTRIB_RELEASE vars) # Print package manager (need DISTRIB_ID, DISTRIB_RELEASE vars)
# used in package manager detection via distro name
pkgmanager() pkgmanager()
{ {
local CMD local CMD
...@@ -14628,7 +14664,7 @@ case $DISTRIB_ID in ...@@ -14628,7 +14664,7 @@ case $DISTRIB_ID in
PCLinux) PCLinux)
CMD="apt-rpm" CMD="apt-rpm"
;; ;;
Ubuntu|Debian|Mint|OSNovaLinux|AstraLinux*|Elbrus) Ubuntu|Debian|Mint|OSNovaLinux|Uncom|AstraLinux*|Elbrus)
CMD="apt-dpkg" CMD="apt-dpkg"
#which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg #which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg
#is_command snappy && CMD=snappy #is_command snappy && CMD=snappy
...@@ -14659,7 +14695,7 @@ case $DISTRIB_ID in ...@@ -14659,7 +14695,7 @@ case $DISTRIB_ID in
ArchLinux|ManjaroLinux) ArchLinux|ManjaroLinux)
CMD="pacman" CMD="pacman"
;; ;;
Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|RELS|Scientific|GosLinux|Amzn|RedOS) Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|RELS|Scientific|GosLinux|Amzn|RedOS|MSVSphere)
CMD="dnf-rpm" CMD="dnf-rpm"
is_command dnf || CMD="yum-rpm" is_command dnf || CMD="yum-rpm"
[ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD="yum-rpm" [ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD="yum-rpm"
...@@ -14887,16 +14923,20 @@ if distro os-release ; then ...@@ -14887,16 +14923,20 @@ if distro os-release ; then
# set by os-release: # set by os-release:
#PRETTY_NAME #PRETTY_NAME
VENDOR_ID="$ID" VENDOR_ID="$ID"
DISTRIB_CODENAME="$VERSION_CODENAME"
case "$VENDOR_ID" in case "$VENDOR_ID" in
ubuntu|reld|rhel|astra|manjaro|redos|msvsphere|alteros|rockylinux|almalinux) ubuntu|reld|rhel|astra|manjaro|redos|msvsphere|alteros|rockylinux|almalinux)
;; ;;
*) *)
if [ -n "$ID_LIKE" ] ; then if [ -n "$ID_LIKE" ] ; then
# ID_LIKE can be 'rhel centos fedora', use first word # ID_LIKE can be 'rhel centos fedora', use first word
VENDOR_ID="$(echo "$ID_LIKE" | xargs -n1 echo | head -n1)" VENDOR_ID="$(firstword "$ID_LIKE")"
# use latest word for versions like Fedora has # use latest word for versions like Fedora has
if is_numeric "$DISTRIB_RELEASE" && [ "$DISTRIB_RELEASE" -ge 20 ] ; then if is_numeric "$DISTRIB_RELEASE" && [ "$DISTRIB_RELEASE" -ge 20 ] ; then
VENDOR_ID="$(echo "$ID_LIKE" | xargs -n1 echo | tail -n1)" VENDOR_ID="$(lastword "$ID_LIKE")"
fi
if [ "$VENDOR_ID" = "debian" ] && [ -n "$DEBIAN_CODENAME" ] ; then
DISTRIB_CODENAME="$DEBIAN_CODENAME"
fi fi
fi fi
;; ;;
...@@ -14907,7 +14947,6 @@ if distro os-release ; then ...@@ -14907,7 +14947,6 @@ if distro os-release ; then
;; ;;
esac esac
DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE" DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE"
DISTRIB_CODENAME="$VERSION_CODENAME"
elif distro lsb-release ; then elif distro lsb-release ; then
DISTRIB_ID=$(cat $DISTROFILE | get_var DISTRIB_ID) DISTRIB_ID=$(cat $DISTROFILE | get_var DISTRIB_ID)
......
...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR ...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR=$PROGDIR/../etc CONFIGDIR=$PROGDIR/../etc
EPMVERSION="3.64.5" EPMVERSION="3.64.6"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -291,6 +291,28 @@ strip_spaces() ...@@ -291,6 +291,28 @@ strip_spaces()
echo "$*" | filter_strip_spaces echo "$*" | filter_strip_spaces
} }
firstupper()
{
# FIXME: works with GNU sed only
echo "$*" | sed 's/.*/\u&/'
}
tolower()
{
# tr is broken in busybox (checked with OpenWrt)
#echo "$*" | tr "[:upper:]" "[:lower:]"
echo "$*" | awk '{print tolower($0)}'
}
firstword()
{
echo "$*" | cut -f1 -d" "
}
lastword()
{
echo "$*" | xargs -n1 echo 2>/dev/null | tail -n1
}
sed_escape() sed_escape()
{ {
...@@ -1863,6 +1885,19 @@ tolower() ...@@ -1863,6 +1885,19 @@ tolower()
echo "$*" | awk '{print tolower($0)}' echo "$*" | awk '{print tolower($0)}'
} }
# copied from estrlist
firstword()
{
echo "$*" | cut -f1 -d" "
}
lastword()
{
echo "$*" | xargs -n1 echo 2>/dev/null | tail -n1
}
print_bug_report_url() print_bug_report_url()
{ {
echo "$BUG_REPORT_URL" echo "$BUG_REPORT_URL"
...@@ -1915,6 +1950,7 @@ pkgvendor() ...@@ -1915,6 +1950,7 @@ pkgvendor()
#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"
# Print package manager (need DISTRIB_ID, DISTRIB_RELEASE vars) # Print package manager (need DISTRIB_ID, DISTRIB_RELEASE vars)
# used in package manager detection via distro name
pkgmanager() pkgmanager()
{ {
local CMD local CMD
...@@ -1936,7 +1972,7 @@ case $DISTRIB_ID in ...@@ -1936,7 +1972,7 @@ case $DISTRIB_ID in
PCLinux) PCLinux)
CMD="apt-rpm" CMD="apt-rpm"
;; ;;
Ubuntu|Debian|Mint|OSNovaLinux|AstraLinux*|Elbrus) Ubuntu|Debian|Mint|OSNovaLinux|Uncom|AstraLinux*|Elbrus)
CMD="apt-dpkg" CMD="apt-dpkg"
#which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg #which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg
#is_command snappy && CMD=snappy #is_command snappy && CMD=snappy
...@@ -1967,7 +2003,7 @@ case $DISTRIB_ID in ...@@ -1967,7 +2003,7 @@ case $DISTRIB_ID in
ArchLinux|ManjaroLinux) ArchLinux|ManjaroLinux)
CMD="pacman" CMD="pacman"
;; ;;
Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|RELS|Scientific|GosLinux|Amzn|RedOS) Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|RELS|Scientific|GosLinux|Amzn|RedOS|MSVSphere)
CMD="dnf-rpm" CMD="dnf-rpm"
is_command dnf || CMD="yum-rpm" is_command dnf || CMD="yum-rpm"
[ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD="yum-rpm" [ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD="yum-rpm"
...@@ -2195,16 +2231,20 @@ if distro os-release ; then ...@@ -2195,16 +2231,20 @@ if distro os-release ; then
# set by os-release: # set by os-release:
#PRETTY_NAME #PRETTY_NAME
VENDOR_ID="$ID" VENDOR_ID="$ID"
DISTRIB_CODENAME="$VERSION_CODENAME"
case "$VENDOR_ID" in case "$VENDOR_ID" in
ubuntu|reld|rhel|astra|manjaro|redos|msvsphere|alteros|rockylinux|almalinux) ubuntu|reld|rhel|astra|manjaro|redos|msvsphere|alteros|rockylinux|almalinux)
;; ;;
*) *)
if [ -n "$ID_LIKE" ] ; then if [ -n "$ID_LIKE" ] ; then
# ID_LIKE can be 'rhel centos fedora', use first word # ID_LIKE can be 'rhel centos fedora', use first word
VENDOR_ID="$(echo "$ID_LIKE" | xargs -n1 echo | head -n1)" VENDOR_ID="$(firstword "$ID_LIKE")"
# use latest word for versions like Fedora has # use latest word for versions like Fedora has
if is_numeric "$DISTRIB_RELEASE" && [ "$DISTRIB_RELEASE" -ge 20 ] ; then if is_numeric "$DISTRIB_RELEASE" && [ "$DISTRIB_RELEASE" -ge 20 ] ; then
VENDOR_ID="$(echo "$ID_LIKE" | xargs -n1 echo | tail -n1)" VENDOR_ID="$(lastword "$ID_LIKE")"
fi
if [ "$VENDOR_ID" = "debian" ] && [ -n "$DEBIAN_CODENAME" ] ; then
DISTRIB_CODENAME="$DEBIAN_CODENAME"
fi fi
fi fi
;; ;;
...@@ -2215,7 +2255,6 @@ if distro os-release ; then ...@@ -2215,7 +2255,6 @@ if distro os-release ; then
;; ;;
esac esac
DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE" DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE"
DISTRIB_CODENAME="$VERSION_CODENAME"
elif distro lsb-release ; then elif distro lsb-release ; then
DISTRIB_ID=$(cat $DISTROFILE | get_var DISTRIB_ID) DISTRIB_ID=$(cat $DISTROFILE | get_var DISTRIB_ID)
......
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