Commit 0954ccaa authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p8 as 2.1.3-alt0.M80P.1 (with rpmbph script)

parents 9bbb2b73 8ebe54ed
rsync -av --inplace --progress --compress
epmqp uuid на x86_64/Ubuntu не различает архитектуру
eon sf - скачивание через rsync -z для компактности? eon sf - скачивание через rsync -z для компактности?
get system checking get system checking
......
...@@ -33,7 +33,7 @@ rpmvendor() ...@@ -33,7 +33,7 @@ rpmvendor()
[ "$DISTRIB_ID" = "LinuxXP" ] && echo "lxp" && return [ "$DISTRIB_ID" = "LinuxXP" ] && echo "lxp" && return
[ "$DISTRIB_ID" = "TinyCoreLinux" ] && echo "tcl" && return [ "$DISTRIB_ID" = "TinyCoreLinux" ] && echo "tcl" && return
[ "$DISTRIB_ID" = "VoidLinux" ] && echo "void" && return [ "$DISTRIB_ID" = "VoidLinux" ] && echo "void" && return
echo "$DISTRIB_ID" | tr "[:lower:]" echo "$DISTRIB_ID" | tr "[:upper:]" "[:lower:]"
} }
# Translate DISTRIB_ID name to package manner (like in the package release name) # Translate DISTRIB_ID name to package manner (like in the package release name)
......
...@@ -94,6 +94,7 @@ epm_install_names() ...@@ -94,6 +94,7 @@ epm_install_names()
[ -z "$1" ] && return [ -z "$1" ] && return
case $PMTYPE in case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm|apt-dpkg)
APTOPTIONS="$APTOPTIONS $(subst_option verbose "-o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1")"
sudocmd apt-get $APTOPTIONS $noremove install $@ sudocmd apt-get $APTOPTIONS $noremove install $@
return ;; return ;;
aptitude-dpkg) aptitude-dpkg)
...@@ -187,7 +188,7 @@ epm_ni_install_names() ...@@ -187,7 +188,7 @@ epm_ni_install_names()
case $PMTYPE in case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm|apt-dpkg)
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
sudocmd apt-get -y $noremove --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" $APTOPTIONS install $@ sudocmd apt-get -y $noremove --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" $APTOPTIONS install $@
return ;; return ;;
aptitude-dpkg) aptitude-dpkg)
sudocmd aptitude -y install $@ sudocmd aptitude -y install $@
...@@ -471,6 +472,7 @@ epm_install_files() ...@@ -471,6 +472,7 @@ epm_install_files()
epm_print_install_command() epm_print_install_command()
{ {
[ -z "$1" ] && return
case $PMTYPE in case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm) apt-rpm|yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm)
echo "rpm -Uvh --force $nodeps $*" echo "rpm -Uvh --force $nodeps $*"
...@@ -523,11 +525,49 @@ epm_print_install_command() ...@@ -523,11 +525,49 @@ epm_print_install_command()
esac esac
} }
epm_print_install_names_command()
{
[ -z "$1" ] && return
case $PMTYPE in
apt-rpm|apt-dpkg)
echo "apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true $APTOPTIONS install $*"
return ;;
aptitude-dpkg)
echo "aptitude -y install $*"
return ;;
yum-rpm)
echo "yum -y $YUMOPTIONS install $*"
return ;;
dnf-rpm)
echo "dnf -y $YUMOPTIONS install $*"
return ;;
urpm-rpm)
echo "urpmi --auto $URPMOPTIONS $*"
return ;;
zypper-rpm)
echo "zypper --non-interactive $ZYPPEROPTIONS install $*"
return ;;
pacman)
echo "pacman -S --noconfirm $force $*"
return ;;
chocolatey)
echo "chocolatey install $*"
return ;;
nix)
echo "nix-env --install $*"
return ;;
*)
fatal "Have no suitable appropriate install command for $PMTYPE"
;;
esac
}
epm_install() epm_install()
{ {
if [ -n "$show_command_only" ] ; then if [ -n "$show_command_only" ] ; then
epm_print_install_command $pkg_filenames epm_print_install_command $pkg_files
epm_print_install_names_command $pkg_names
return return
fi fi
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2013, 2016 Etersoft # Copyright (C) 2013, 2016, 2017 Etersoft
# Copyright (C) 2013, 2016 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2013, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -17,9 +17,11 @@ ...@@ -17,9 +17,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
load_helper epm-check_updated_repo
epm_kernel_update() epm_kernel_update()
{ {
info "Starting update system kernel to the latest version" info "Updating system kernel to the latest version..."
case $DISTRNAME in case $DISTRNAME in
ALTLinux) ALTLinux)
...@@ -29,6 +31,7 @@ epm_kernel_update() ...@@ -29,6 +31,7 @@ epm_kernel_update()
return return
fi fi
assure_exists update-kernel update-kernel 0.9.9 assure_exists update-kernel update-kernel 0.9.9
update_repo_if_needed
sudocmd update-kernel $pkg_filenames || return sudocmd update-kernel $pkg_filenames || return
docmd epm remove-old-kernels $pkg_filenames || fatal docmd epm remove-old-kernels $pkg_filenames || fatal
return ;; return ;;
......
...@@ -92,6 +92,8 @@ download_alt_contents_index() ...@@ -92,6 +92,8 @@ download_alt_contents_index()
URL=$(echo "$URL" | sed -e "s|^file:||") URL=$(echo "$URL" | sed -e "s|^file:||")
[ -s "$URL" ] || { touch $OFILE.failed ; return 1; } [ -s "$URL" ] || { touch $OFILE.failed ; return 1; }
ln -sf "$URL" "$OFILE" || { touch $OFILE.failed ; return 1; } ln -sf "$URL" "$OFILE" || { touch $OFILE.failed ; return 1; }
# TODO rsync
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449#c22
else else
docmd eget -O "$OFILE" "$URL" || { rm -fv $OFILE ; touch $OFILE.failed ; return 1; } docmd eget -O "$OFILE" "$URL" || { rm -fv $OFILE ; touch $OFILE.failed ; return 1; }
fi fi
......
...@@ -32,7 +32,7 @@ epm_upgrade() ...@@ -32,7 +32,7 @@ epm_upgrade()
case $PMTYPE in case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm|apt-dpkg)
local APTOPTIONS="$(subst_option non_interactive -y)" local APTOPTIONS="$(subst_option non_interactive -y) $(subst_option verbose "-o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1")"
# Функцию добавления параметра при условии # Функцию добавления параметра при условии
CMD="apt-get $APTOPTIONS dist-upgrade $noremove" CMD="apt-get $APTOPTIONS dist-upgrade $noremove"
;; ;;
......
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils. # This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
# #
Name: eepm Name: eepm
Version: 2.1.0 Version: 2.1.3
Release: alt0.M80P.1 Release: alt0.M80P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -68,9 +68,21 @@ chmod a+x %buildroot%_datadir/%name/tools_* ...@@ -68,9 +68,21 @@ chmod a+x %buildroot%_datadir/%name/tools_*
%_sysconfdir/bash_completion.d/cerv %_sysconfdir/bash_completion.d/cerv
%changelog %changelog
* Sun Jul 23 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.0-alt0.M80P.1 * Wed Oct 18 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.3-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script) - backport to ALTLinux p8 (by rpmbph script)
* Thu Sep 14 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.3-alt1
- use force package selection only in non interactive install
- kernel_update: add update repo if needed
- install/upgrade: add debug output for apt when --verbose
* Fri Aug 04 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.2-alt1
- apt install: add force package selection (see ALT bug #22572)
* Mon Jul 31 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.1-alt1
- distr_info: fix tr using
- install --show-command-only supports hi level names now
* Sat Jul 22 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.0-alt1 * Sat Jul 22 2017 Vitaly Lipatov <lav@altlinux.ru> 2.1.0-alt1
- fix quotes (eterbug #11863) - fix quotes (eterbug #11863)
- make shellcheck happy - make shellcheck happy
......
...@@ -62,7 +62,7 @@ check_tty() ...@@ -62,7 +62,7 @@ check_tty()
# egrep from busybox may not --color # egrep from busybox may not --color
# egrep from MacOS print help to stderr # egrep from MacOS print help to stderr
if egrep --help 2>&1 | grep -q -- "--color" ; then if grep -E --help 2>&1 | grep -q -- "--color" ; then
export EGREPCOLOR="--color" export EGREPCOLOR="--color"
fi fi
...@@ -102,7 +102,7 @@ echover() ...@@ -102,7 +102,7 @@ echover()
echon() echon()
{ {
# default /bin/sh on MacOS does not recognize -n # default /bin/sh on MacOS does not recognize -n
/bin/echo -n "$@" /bin/echo -n "$*"
} }
...@@ -120,14 +120,14 @@ showcmd() ...@@ -120,14 +120,14 @@ showcmd()
set_boldcolor $GREEN set_boldcolor $GREEN
local PROMTSIG="\$" local PROMTSIG="\$"
[ "$EFFUID" = 0 ] && PROMTSIG="#" [ "$EFFUID" = 0 ] && PROMTSIG="#"
echo " $PROMTSIG $@" echo " $PROMTSIG $*"
restore_color restore_color
fi >&2 fi >&2
} }
docmd() docmd()
{ {
showcmd "$@$EXTRA_SHOWDOCMD" showcmd "$*$EXTRA_SHOWDOCMD"
$@ $@
} }
...@@ -144,7 +144,7 @@ docmd_foreach() ...@@ -144,7 +144,7 @@ docmd_foreach()
sudocmd() sudocmd()
{ {
showcmd "$SUDO $@" showcmd "$SUDO $*"
$SUDO $@ $SUDO $@
} }
...@@ -174,11 +174,10 @@ get_firstarg() ...@@ -174,11 +174,10 @@ get_firstarg()
get_lastarg() get_lastarg()
{ {
local lastarg local lastarg
eval lastarg=\${$#} eval "lastarg=\${$#}"
echon "$lastarg" echon "$lastarg"
} }
filter_strip_spaces() filter_strip_spaces()
{ {
# possible use just # possible use just
...@@ -205,7 +204,7 @@ store_output() ...@@ -205,7 +204,7 @@ store_output()
echo 1 >$CMDSTATUS echo 1 >$CMDSTATUS
#RC_STDERR=$(mktemp) #RC_STDERR=$(mktemp)
( $@ 2>&1 ; echo $? >$CMDSTATUS ) | tee $RC_STDOUT ( $@ 2>&1 ; echo $? >$CMDSTATUS ) | tee $RC_STDOUT
return $(cat $CMDSTATUS) return "$(cat $CMDSTATUS)"
# bashism # bashism
# http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF # http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF
#return $PIPESTATUS #return $PIPESTATUS
...@@ -231,7 +230,7 @@ epm() ...@@ -231,7 +230,7 @@ epm()
fatal() fatal()
{ {
if [ -z "$TEXTDOMAIN" ] ; then if [ -z "$TEXTDOMAIN" ] ; then
echo "Error: $@" >&2 echo "Error: $*" >&2
fi fi
exit 1 exit 1
} }
...@@ -239,7 +238,7 @@ fatal() ...@@ -239,7 +238,7 @@ fatal()
warning() warning()
{ {
if [ -z "$TEXTDOMAIN" ] ; then if [ -z "$TEXTDOMAIN" ] ; then
echo "Warning: $@" >&2 echo "Warning: $*" >&2
fi fi
} }
...@@ -250,9 +249,9 @@ info() ...@@ -250,9 +249,9 @@ info()
# print message to stderr if stderr forwarded to (a file) # print message to stderr if stderr forwarded to (a file)
if isatty2 ; then if isatty2 ; then
isatty || return 0 isatty || return 0
echo "$@" echo "$*"
else else
echo "$@" >&2 echo "$*" >&2
fi fi
} }
...@@ -266,7 +265,7 @@ set_sudo() ...@@ -266,7 +265,7 @@ set_sudo()
return return
fi fi
EFFUID=`id -u` EFFUID=$(id -u)
# do not need sudo # do not need sudo
[ $EFFUID = "0" ] && return [ $EFFUID = "0" ] && return
...@@ -402,7 +401,7 @@ get_help() ...@@ -402,7 +401,7 @@ get_help()
return return
fi fi
grep -v -- "^#" $0 | grep -- "# $1" | while read n ; do grep -v -- "^#" $0 | grep -- "# $1" | while read -r n ; do
opt=$(echo $n | sed -e "s|) # $1:.*||g") opt=$(echo $n | sed -e "s|) # $1:.*||g")
desc=$(echo $n | sed -e "s|.*) # $1:||g") desc=$(echo $n | sed -e "s|.*) # $1:||g")
printf " %-20s %s\n" $opt "$desc" printf " %-20s %s\n" $opt "$desc"
...@@ -506,9 +505,10 @@ is_active_systemd() ...@@ -506,9 +505,10 @@ is_active_systemd()
SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd
[ -x "$SYSTEMCTL" ] || return [ -x "$SYSTEMCTL" ] || return
[ -d "$SYSTEMD_CGROUP_DIR" ] || return [ -d "$SYSTEMD_CGROUP_DIR" ] || return
a= mountpoint -q "$SYSTEMD_CGROUP_DIR" || return a='' mountpoint -q "$SYSTEMD_CGROUP_DIR" || return
readlink /sbin/init | grep -q 'systemd' || return readlink /sbin/init | grep -q 'systemd' || return
# some hack # some hack
# shellcheck disable=SC2009
ps ax | grep '[s]ystemd' | grep -q -v 'systemd-udev' ps ax | grep '[s]ystemd' | grep -q -v 'systemd-udev'
} }
...@@ -873,13 +873,13 @@ is_service_autostart() ...@@ -873,13 +873,13 @@ is_service_autostart()
LANG=C $SUDO chkconfig $1 --list | grep -q "[35]:on" LANG=C $SUDO chkconfig $1 --list | grep -q "[35]:on"
;; ;;
service-initd|service-update) service-initd|service-update)
test -L $(echo /etc/rc5.d/S??$1) test -L "$(echo /etc/rc5.d/S??$1)"
;; ;;
systemd) systemd)
$SUDO systemctl is-enabled $1 $SUDO systemctl is-enabled $1
;; ;;
runit) runit)
test -L /var/service/$SERVICE test -L "/var/service/$SERVICE"
;; ;;
*) *)
fatal "Have no suitable command for $SERVICETYPE" fatal "Have no suitable command for $SERVICETYPE"
...@@ -906,7 +906,7 @@ serv_status() ...@@ -906,7 +906,7 @@ serv_status()
sudocmd $INITDIR/$SERVICE status "$@" sudocmd $INITDIR/$SERVICE status "$@"
;; ;;
systemd) systemd)
sudocmd systemctl status $SERVICE "$@" sudocmd systemctl -l status $SERVICE "$@"
;; ;;
runit) runit)
sudocmd sv status "$SERVICE" sudocmd sv status "$SERVICE"
...@@ -1036,7 +1036,7 @@ rpmvendor() ...@@ -1036,7 +1036,7 @@ rpmvendor()
[ "$DISTRIB_ID" = "LinuxXP" ] && echo "lxp" && return [ "$DISTRIB_ID" = "LinuxXP" ] && echo "lxp" && return
[ "$DISTRIB_ID" = "TinyCoreLinux" ] && echo "tcl" && return [ "$DISTRIB_ID" = "TinyCoreLinux" ] && echo "tcl" && return
[ "$DISTRIB_ID" = "VoidLinux" ] && echo "void" && return [ "$DISTRIB_ID" = "VoidLinux" ] && echo "void" && return
echo "$DISTRIB_ID" | tr "[A-Z]" "[a-z]" echo "$DISTRIB_ID" | tr "[:upper:]" "[:lower:]"
} }
# Translate DISTRIB_ID name to package manner (like in the package release name) # Translate DISTRIB_ID name to package manner (like in the package release name)
...@@ -1049,7 +1049,7 @@ pkgvendor() ...@@ -1049,7 +1049,7 @@ pkgvendor()
# Print pkgtype (need DISTRIB_ID var) # Print pkgtype (need DISTRIB_ID var)
pkgtype() pkgtype()
{ {
case `pkgvendor` in case $(pkgvendor) in
freebsd) echo "tbz" ;; freebsd) echo "tbz" ;;
sunos) echo "pkg.gz" ;; sunos) echo "pkg.gz" ;;
slackware|mopslinux) echo "tgz" ;; slackware|mopslinux) echo "tgz" ;;
...@@ -1089,9 +1089,9 @@ DISTRIB_CODENAME="" ...@@ -1089,9 +1089,9 @@ DISTRIB_CODENAME=""
# Default with LSB # Default with LSB
if distro lsb-release ; then if distro lsb-release ; then
DISTRIB_ID=`cat $DISTROFILE | get_var DISTRIB_ID` DISTRIB_ID=$(cat $DISTROFILE | get_var DISTRIB_ID)
DISTRIB_RELEASE=`cat $DISTROFILE | get_var DISTRIB_RELEASE` DISTRIB_RELEASE=$(cat $DISTROFILE | get_var DISTRIB_RELEASE)
DISTRIB_CODENAME=`cat $DISTROFILE | get_var DISTRIB_CODENAME` DISTRIB_CODENAME=$(cat $DISTROFILE | get_var DISTRIB_CODENAME)
fi fi
# ALT Linux based # ALT Linux based
...@@ -1099,6 +1099,7 @@ if distro altlinux-release ; then ...@@ -1099,6 +1099,7 @@ if distro altlinux-release ; then
DISTRIB_ID="ALTLinux" DISTRIB_ID="ALTLinux"
if has Sisyphus ; then DISTRIB_RELEASE="Sisyphus" if has Sisyphus ; then DISTRIB_RELEASE="Sisyphus"
elif has "ALT Linux 7." ; then DISTRIB_RELEASE="p7" elif has "ALT Linux 7." ; then DISTRIB_RELEASE="p7"
elif has "ALT Linux t7." ; then DISTRIB_RELEASE="t7"
elif has "ALT Linux 8." ; then DISTRIB_RELEASE="p8" elif has "ALT Linux 8." ; then DISTRIB_RELEASE="p8"
elif has "ALT .*8.[0-9]" ; then DISTRIB_RELEASE="p8" elif has "ALT .*8.[0-9]" ; then DISTRIB_RELEASE="p8"
elif has "Simply Linux 6." ; then DISTRIB_RELEASE="p6" elif has "Simply Linux 6." ; then DISTRIB_RELEASE="p6"
...@@ -1123,8 +1124,8 @@ if distro altlinux-release ; then ...@@ -1123,8 +1124,8 @@ if distro altlinux-release ; then
elif distro gentoo-release ; then elif distro gentoo-release ; then
DISTRIB_ID="Gentoo" DISTRIB_ID="Gentoo"
MAKEPROFILE=$(readlink $ROOTDIR/etc/portage/make.profile 2>/dev/null) || MAKEPROFILE=$(readlink $ROOTDIR/etc/make.profile) MAKEPROFILE=$(readlink $ROOTDIR/etc/portage/make.profile 2>/dev/null) || MAKEPROFILE=$(readlink $ROOTDIR/etc/make.profile)
DISTRIB_RELEASE=`basename $MAKEPROFILE` DISTRIB_RELEASE=$(basename $MAKEPROFILE)
echo $DISTRIB_RELEASE | grep -q "[0-9]" || DISTRIB_RELEASE=`basename $(dirname $MAKEPROFILE)` echo $DISTRIB_RELEASE | grep -q "[0-9]" || DISTRIB_RELEASE=$(basename "$(dirname $MAKEPROFILE)")
# Slackware based # Slackware based
elif distro mopslinux-version ; then elif distro mopslinux-version ; then
...@@ -1137,19 +1138,22 @@ elif distro mopslinux-version ; then ...@@ -1137,19 +1138,22 @@ elif distro mopslinux-version ; then
fi fi
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)"
elif distro os-release && which apk 2>/dev/null >/dev/null ; then elif distro os-release && which apk 2>/dev/null >/dev/null ; then
# shellcheck disable=SC1090
. $ROOTDIR/etc/os-release . $ROOTDIR/etc/os-release
DISTRIB_ID="$ID" DISTRIB_ID="$ID"
DISTRIB_RELEASE="$VERSION_ID" DISTRIB_RELEASE="$VERSION_ID"
elif distro os-release && which tce-ab 2>/dev/null >/dev/null ; then elif distro os-release && which tce-ab 2>/dev/null >/dev/null ; then
# shellcheck disable=SC1090
. $ROOTDIR/etc/os-release . $ROOTDIR/etc/os-release
DISTRIB_ID="TinyCoreLinux" DISTRIB_ID="TinyCoreLinux"
DISTRIB_RELEASE="$VERSION_ID" DISTRIB_RELEASE="$VERSION_ID"
elif distro os-release && which xbps-query 2>/dev/null >/dev/null ; then elif distro os-release && which xbps-query 2>/dev/null >/dev/null ; then
# shellcheck disable=SC1090
. $ROOTDIR/etc/os-release . $ROOTDIR/etc/os-release
DISTRIB_ID="VoidLinux" DISTRIB_ID="VoidLinux"
DISTRIB_RELEASE="Live" DISTRIB_RELEASE="Live"
...@@ -1272,32 +1276,32 @@ elif distro SuSe-release || distro SuSE-release ; then ...@@ -1272,32 +1276,32 @@ elif distro SuSe-release || distro SuSE-release ; then
fi fi
# fixme: can we detect by some file? # fixme: can we detect by some file?
elif [ `uname` = "FreeBSD" ] ; then elif [ "$(uname)" = "FreeBSD" ] ; then
DISTRIB_ID="FreeBSD" DISTRIB_ID="FreeBSD"
UNAME=$(uname -r) UNAME=$(uname -r)
DISTRIB_RELEASE=$(echo "$UNAME" | grep RELEASE | sed -e "s|\([0-9]\.[0-9]\)-RELEASE|\1|g") DISTRIB_RELEASE=$(echo "$UNAME" | grep RELEASE | sed -e "s|\([0-9]\.[0-9]\)-RELEASE|\1|g")
# fixme: can we detect by some file? # fixme: can we detect by some file?
elif [ `uname` = "SunOS" ] ; then elif [ "$(uname)" = "SunOS" ] ; then
DISTRIB_ID="SunOS" DISTRIB_ID="SunOS"
DISTRIB_RELEASE=$(uname -r) DISTRIB_RELEASE=$(uname -r)
# fixme: can we detect by some file? # fixme: can we detect by some file?
elif [ `uname -s 2>/dev/null` = "Darwin" ] ; then elif [ "$(uname -s 2>/dev/null)" = "Darwin" ] ; then
DISTRIB_ID="MacOS" DISTRIB_ID="MacOS"
DISTRIB_RELEASE=$(uname -r) DISTRIB_RELEASE=$(uname -r)
# fixme: move to up # fixme: move to up
elif [ `uname` = "Linux" ] && which guix 2>/dev/null >/dev/null ; then elif [ "$(uname)" = "Linux" ] && which guix 2>/dev/null >/dev/null ; then
DISTRIB_ID="GNU/Linux/Guix" DISTRIB_ID="GNU/Linux/Guix"
DISTRIB_RELEASE=$(uname -r) DISTRIB_RELEASE=$(uname -r)
# fixme: move to up # fixme: move to up
elif [ `uname` = "Linux" ] && [ -x $ROOTDIR/system/bin/getprop ] ; then elif [ "$(uname)" = "Linux" ] && [ -x $ROOTDIR/system/bin/getprop ] ; then
DISTRIB_ID="Android" DISTRIB_ID="Android"
DISTRIB_RELEASE=$(getprop | awk -F": " '/build.version.release/ { print $2 }' | tr -d '[]') DISTRIB_RELEASE=$(getprop | awk -F": " '/build.version.release/ { print $2 }' | tr -d '[]')
elif [ `uname -o 2>/dev/null` = "Cygwin" ] ; then elif [ "$(uname -o 2>/dev/null)" = "Cygwin" ] ; then
DISTRIB_ID="Cygwin" DISTRIB_ID="Cygwin"
DISTRIB_RELEASE="all" DISTRIB_RELEASE="all"
...@@ -1436,7 +1440,7 @@ create_fake_files() ...@@ -1436,7 +1440,7 @@ create_fake_files()
DIRALLFILES="$MYTMPDIR/files/" DIRALLFILES="$MYTMPDIR/files/"
mkdir -p "$DIRALLFILES" mkdir -p "$DIRALLFILES"
print_files | while read line ; do print_files | while read -r line ; do
touch $DIRALLFILES/$(basename "$line") touch $DIRALLFILES/$(basename "$line")
done done
} }
...@@ -1767,7 +1771,7 @@ $(get_help HELPOPT) ...@@ -1767,7 +1771,7 @@ $(get_help HELPOPT)
print_version() print_version()
{ {
echo "Service manager version 2.0.5" echo "Service manager version 2.1.1"
echo "Running on $($DISTRVENDOR) with $SERVICETYPE" echo "Running on $($DISTRVENDOR) with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012, 2013, 2016" echo "Copyright (c) Etersoft 2012, 2013, 2016"
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