Commit fb90eba7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

make shellcheck more happy

parent a0be2778
...@@ -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 "[A-Z]" "[a-z]" echo "$DISTRIB_ID" | tr "A-Z" "a-z"
} }
# 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)
......
...@@ -356,7 +356,7 @@ check_option() ...@@ -356,7 +356,7 @@ check_option()
check_filenames() check_filenames()
{ {
local opt local opt
for opt in $* ; do for opt in "$@" ; do
# files can be with full path or have extension via . # files can be with full path or have extension via .
if [ -f "$opt" ] && echo "$opt" | grep -q "[/\.]" ; then if [ -f "$opt" ] && echo "$opt" | grep -q "[/\.]" ; then
pkg_files="$pkg_files $opt" pkg_files="$pkg_files $opt"
...@@ -406,7 +406,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names") ...@@ -406,7 +406,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
if [ -z "$epm_cmd" ] ; then if [ -z "$epm_cmd" ] ; then
print_version print_version
echo echo
fatstr="Unknown command in $@ arg(s)" fatstr="Unknown command in $* arg(s)"
[ -n "$*" ] || fatstr="That program needs be running with some command" [ -n "$*" ] || fatstr="That program needs be running with some command"
fatal "$fatstr. Run $ $PROGNAME --help to get help." fatal "$fatstr. Run $ $PROGNAME --help to get help."
fi fi
......
...@@ -46,7 +46,7 @@ case $DISTRNAME in ...@@ -46,7 +46,7 @@ case $DISTRNAME in
;; ;;
autoimports) autoimports)
[ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION" [ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION"
repo="$repo.$(echo "$DISTRVERSION" | tr "[A-Z]" "[a-z]")" repo="$repo.$(echo "$DISTRVERSION" | tr "A-Z" "a-z")"
esac esac
assure_exists apt-repo assure_exists apt-repo
......
...@@ -76,7 +76,7 @@ print_pkgname() ...@@ -76,7 +76,7 @@ print_pkgname()
print_srcname() print_srcname()
{ {
print_name $(print_srcpkgname "$@") print_name "$(print_srcpkgname "$@")"
} }
print_specname() print_specname()
...@@ -137,7 +137,7 @@ EOF ...@@ -137,7 +137,7 @@ EOF
"name") "name")
[ -n "$1" ] || fatal "Arg is missed" [ -n "$1" ] || fatal "Arg is missed"
if [ -n "$FNFLAG" ] ; then if [ -n "$FNFLAG" ] ; then
print_name $(print_pkgname "$@") print_name "$(print_pkgname "$@")"
elif [ -n "$PKFLAG" ] ; then elif [ -n "$PKFLAG" ] ; then
query_package_field "name" "$@" query_package_field "name" "$@"
else else
...@@ -147,7 +147,7 @@ EOF ...@@ -147,7 +147,7 @@ EOF
"version") "version")
[ -n "$1" ] || fatal "Arg is missed" [ -n "$1" ] || fatal "Arg is missed"
if [ -n "$FNFLAG" ] ; then if [ -n "$FNFLAG" ] ; then
print_version $(print_pkgname "$@") print_version "$(print_pkgname "$@")"
elif [ -n "$PKFLAG" ] ; then elif [ -n "$PKFLAG" ] ; then
query_package_field "version" "$@" query_package_field "version" "$@"
else else
...@@ -157,7 +157,7 @@ EOF ...@@ -157,7 +157,7 @@ EOF
"release") "release")
[ -n "$1" ] || fatal "Arg is missed" [ -n "$1" ] || fatal "Arg is missed"
if [ -n "$FNFLAG" ] ; then if [ -n "$FNFLAG" ] ; then
print_release $(print_pkgname "$@") print_release "$(print_pkgname "$@")"
elif [ -n "$PKFLAG" ] ; then elif [ -n "$PKFLAG" ] ; then
query_package_field "release" "$@" query_package_field "release" "$@"
else else
...@@ -222,6 +222,6 @@ epm_print() ...@@ -222,6 +222,6 @@ epm_print()
{ {
[ -n "$pkg_filenames" ] || fatal "Missed args. Use epm print help for get help." [ -n "$pkg_filenames" ] || fatal "Missed args. Use epm print help for get help."
__epm_print $(eval echo $quoted_args) __epm_print "$(eval echo $quoted_args)"
} }
...@@ -27,7 +27,7 @@ case $DISTRNAME in ...@@ -27,7 +27,7 @@ case $DISTRNAME in
autoimports) autoimports)
info "remove autoimports repo" info "remove autoimports repo"
[ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION" [ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION"
repo="$repo.$(echo "$DISTRVERSION" | tr "[A-Z]" "[a-z]")" repo="$repo.$(echo "$DISTRVERSION" | tr "A-Z" "a-z")"
;; ;;
esac esac
......
...@@ -44,7 +44,7 @@ epm_requires_files() ...@@ -44,7 +44,7 @@ epm_requires_files()
epm_requires_names() epm_requires_names()
{ {
local pkg_names="$@" local pkg_names="$*"
local CMD local CMD
[ -n "$pkg_names" ] || return [ -n "$pkg_names" ] || return
......
...@@ -132,7 +132,7 @@ __epm_search_make_grep() ...@@ -132,7 +132,7 @@ __epm_search_make_grep()
#list=$(strip_spaces $list | sed -e "s/ /|/g") #list=$(strip_spaces $list | sed -e "s/ /|/g")
listN=$(strip_spaces $listN | sed -e "s/ /|/g" | sed -e "s/\^//g") listN=$(strip_spaces $listN | sed -e "s/ /|/g" | sed -e "s/\^//g")
if [ "$short" ] ; then if [ -n "$short" ] ; then
echon " | sed -e \"s| .*||g\"" echon " | sed -e \"s| .*||g\""
fi fi
......
...@@ -81,7 +81,7 @@ epm_upgrade() ...@@ -81,7 +81,7 @@ epm_upgrade()
;; ;;
homebrew) homebrew)
#CMD="brew upgrade" #CMD="brew upgrade"
docmd "brew upgrade `brew outdated`" docmd "brew upgrade $(brew outdated)"
return return
;; ;;
ipkg) ipkg)
......
...@@ -61,13 +61,13 @@ is_service_autostart() ...@@ -61,13 +61,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"
......
...@@ -3,5 +3,15 @@ ...@@ -3,5 +3,15 @@
# http://mywiki.wooledge.org/Bashism # http://mywiki.wooledge.org/Bashism
# https://wiki.ubuntu.com/DashAsBinSh # https://wiki.ubuntu.com/DashAsBinSh
EXCL=-eSC2086,SC2039,SC2034,SC2068,SC2155
if [ -n "$1" ] ; then
shellcheck $EXCL "$1"
exit
fi
checkbashisms -f bin/* checkbashisms -f bin/*
checkbashisms -f Makefile checkbashisms -f Makefile
shellcheck $EXCL \
bin/epm bin/distr_info bin/epm-* bin/serv-* bin/tools_*
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