Commit 2eaa56b1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

some checkbashisms fixes

parent fcb7dbc2
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
__alt_fix_triggers() __alt_fix_triggers()
{ {
local TDIR=$(mktemp -d) local TDIR="$(mktemp -d)"
assure_exists time assure_exists time
touch $TDIR/added touch $TDIR/added
for ft in $(ls /usr/lib/rpm/*.filetrigger | sort) ; do for ft in $(ls /usr/lib/rpm/*.filetrigger | sort) ; do
......
...@@ -67,7 +67,7 @@ __download_pkg_urls() ...@@ -67,7 +67,7 @@ __download_pkg_urls()
local url local url
[ -z "$pkg_urls" ] && return [ -z "$pkg_urls" ] && return
for url in $pkg_urls ; do for url in $pkg_urls ; do
local tmppkg=$(mktemp -d) || fatal "failed mktemp -d" local tmppkg="$(mktemp -d)" || fatal "failed mktemp -d"
docmd chmod $verbose a+rX $tmppkg docmd chmod $verbose a+rX $tmppkg
showcmd cd $tmppkg showcmd cd $tmppkg
cd $tmppkg || fatal cd $tmppkg || fatal
...@@ -157,7 +157,7 @@ __epm_print_url_alt_check() ...@@ -157,7 +157,7 @@ __epm_print_url_alt_check()
{ {
local pkg=$1 local pkg=$1
shift shift
local tm=$(mktemp) local tm="$(mktemp)"
assure_exists curl assure_exists curl
load_helper epm-site load_helper epm-site
quiet=1 quiet=1
......
...@@ -27,7 +27,7 @@ __epm_korinf_site_mask() { ...@@ -27,7 +27,7 @@ __epm_korinf_site_mask() {
local MASK="$1" local MASK="$1"
local archprefix="" local archprefix=""
# short hack to install needed package # short hack to install needed package
rhas "$MASK" "[-_]" || MASK="$MASK[-_][0-9]" rhas "$MASK" "[-_]" || MASK="${MASK}[-_][0-9]"
# set arch for Korinf compatibility # set arch for Korinf compatibility
[ "$($DISTRVENDOR -a)" = "x86_64" ] && archprefix="x86_64/" [ "$($DISTRVENDOR -a)" = "x86_64" ] && archprefix="x86_64/"
local URL="$EPM_KORINF_REPO_URL/$archprefix$($DISTRVENDOR -e)" local URL="$EPM_KORINF_REPO_URL/$archprefix$($DISTRVENDOR -e)"
...@@ -61,7 +61,7 @@ __epm_korinf_install() { ...@@ -61,7 +61,7 @@ __epm_korinf_install() {
__epm_korinf_install_eepm() { __epm_korinf_install_eepm() {
# enable interactive for install eepm from console # enable interactive for install eepm from console
if inputisatty && [ "$EPMMODE" != "pipe" ] && [ "$1" = "eepm" ] ; then if inputisatty && [ "$EPMMODE" != "pipe" ] ; then
[ -n "$non_interactive" ] || interactive="--interactive" [ -n "$non_interactive" ] || interactive="--interactive"
fi fi
......
...@@ -34,7 +34,7 @@ __epm_pack() ...@@ -34,7 +34,7 @@ __epm_pack()
[ -x "$repackcode" ] || fatal "Can't find script $repackcode for packname $packname" [ -x "$repackcode" ] || fatal "Can't find script $repackcode for packname $packname"
[ -f "$repackcode.rpmnew" ] && warning "There is .rpmnew file(s) in $EPM_PACK_SCRIPTS_DIR dir. The pack script can be outdated." [ -f "$repackcode.rpmnew" ] && warning "There is .rpmnew file(s) in $EPM_PACK_SCRIPTS_DIR dir. The pack script can be outdated."
tmpdir=$(mktemp -d) tmpdir="$(mktemp -d)"
filefortarname="$tmpdir/filefortarname" filefortarname="$tmpdir/filefortarname"
trap "rm -rf $tmpdir" EXIT trap "rm -rf $tmpdir" EXIT
......
...@@ -101,7 +101,7 @@ __list_app_packages_table() ...@@ -101,7 +101,7 @@ __list_app_packages_table()
__list_installed_app() __list_installed_app()
{ {
local i local i
local tapt=$(mktemp) || fatal local tapt="$(mktemp)" || fatal
__list_app_packages_table >$tapt __list_app_packages_table >$tapt
# get all installed packages and convert it to a apps list # get all installed packages and convert it to a apps list
for i in $(epm query --short $(cat $tapt | sed -e 's| .*$||') 2>/dev/null) ; do for i in $(epm query --short $(cat $tapt | sed -e 's| .*$||') 2>/dev/null) ; do
...@@ -116,7 +116,7 @@ __list_installed_app() ...@@ -116,7 +116,7 @@ __list_installed_app()
__list_installed_packages() __list_installed_packages()
{ {
local i local i
local tapt=$(mktemp) || fatal local tapt="$(mktemp)" || fatal
__list_app_packages_table >$tapt __list_app_packages_table >$tapt
# get all installed packages and convert it to a apps list # get all installed packages and convert it to a apps list
for i in $(epm query --short $(cat $tapt | sed -e 's| .*$||') 2>/dev/null) ; do for i in $(epm query --short $(cat $tapt | sed -e 's| .*$||') 2>/dev/null) ; do
...@@ -327,6 +327,7 @@ __epm_play_install() ...@@ -327,6 +327,7 @@ __epm_play_install()
esac esac
local p="$1" local p="$1"
local v='' local v=''
# drop spaces
n="$(echo $2)" n="$(echo $2)"
if [ "$n" = "=" ] ; then if [ "$n" = "=" ] ; then
v="$3" v="$3"
......
...@@ -144,8 +144,7 @@ __do_short_query() ...@@ -144,8 +144,7 @@ __do_short_query()
CMD="rpm -qf --queryformat %{NAME}\n" CMD="rpm -qf --queryformat %{NAME}\n"
;; ;;
apt-dpkg) apt-dpkg)
showcmd dpkg -S "$1" docmd dpkg -S "$1" | sed -e "s|:.*||"
a= dpkg -S $1 | sed -e "s|:.*||"
return ;; return ;;
NOemerge) NOemerge)
assure_exists equery assure_exists equery
......
...@@ -251,8 +251,8 @@ get_next_release() ...@@ -251,8 +251,8 @@ get_next_release()
echo "c7" ;; echo "c7" ;;
"c7") "c7")
echo "c8" ;; echo "c8" ;;
"c8") # "c8")
echo "c8.1" ;; # echo "c8.1" ;;
"c8.1") "c8.1")
echo "c8.2" ;; echo "c8.2" ;;
"c8") "c8")
......
...@@ -137,7 +137,7 @@ case $PMTYPE in ...@@ -137,7 +137,7 @@ case $PMTYPE in
sudocmd zypper removerepo "$@" sudocmd zypper removerepo "$@"
;; ;;
emerge) emerge)
sudocmd layman "-d$@" sudocmd layman "-d$1"
;; ;;
pacman) pacman)
info "You need remove repo from /etc/pacman.conf" info "You need remove repo from /etc/pacman.conf"
......
...@@ -30,7 +30,7 @@ __epm_repack_to_deb() ...@@ -30,7 +30,7 @@ __epm_repack_to_deb()
repacked_pkgs='' repacked_pkgs=''
local TDIR=$(mktemp -d --tmpdir=$BIGTMPDIR) local TDIR="$(mktemp -d --tmpdir=$BIGTMPDIR)"
to_clean_tmp_dirs="$to_clean_tmp_dirs $TDIR" to_clean_tmp_dirs="$to_clean_tmp_dirs $TDIR"
trap "__epm_remove_tmp_files" EXIT trap "__epm_remove_tmp_files" EXIT
......
...@@ -131,7 +131,7 @@ __epm_repack_to_rpm() ...@@ -131,7 +131,7 @@ __epm_repack_to_rpm()
fi fi
local pkg local pkg
export HOME=$(mktemp -d --tmpdir=$BIGTMPDIR) export HOME="$(mktemp -d --tmpdir=$BIGTMPDIR)"
to_clean_tmp_dirs="$to_clean_tmp_dirs $HOME" to_clean_tmp_dirs="$to_clean_tmp_dirs $HOME"
trap "__epm_remove_tmp_files" EXIT trap "__epm_remove_tmp_files" EXIT
__create_rpmmacros __create_rpmmacros
......
...@@ -265,7 +265,7 @@ subst_option() ...@@ -265,7 +265,7 @@ subst_option()
store_output() store_output()
{ {
# use make_temp_file from etersoft-build-utils # use make_temp_file from etersoft-build-utils
RC_STDOUT=$(mktemp) RC_STDOUT="$(mktemp)"
local CMDSTATUS=$RC_STDOUT.pipestatus local CMDSTATUS=$RC_STDOUT.pipestatus
echo 1 >$CMDSTATUS echo 1 >$CMDSTATUS
#RC_STDERR=$(mktemp) #RC_STDERR=$(mktemp)
......
...@@ -69,7 +69,7 @@ get_only_installed_packages() ...@@ -69,7 +69,7 @@ get_only_installed_packages()
__convert_pkgallowscripts_to_regexp() __convert_pkgallowscripts_to_regexp()
{ {
local tmpalf=$(mktemp) || fatal local tmpalf="$(mktemp)" || fatal
# copied from eget's filter_glob # copied from eget's filter_glob
# check man glob # check man glob
# remove commentы and translate glob to regexp # remove commentы and translate glob to regexp
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# 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 EXCL=-eSC2086,SC2039,SC2034,SC2068,SC2155,SC3043
# TODO: # TODO:
# SC2154: pkg_filenames is referenced but not assigned. # SC2154: pkg_filenames is referenced but not assigned.
...@@ -20,4 +20,4 @@ checkbashisms -f bin/* ...@@ -20,4 +20,4 @@ checkbashisms -f bin/*
checkbashisms -f Makefile checkbashisms -f Makefile
shellcheck $EXCL \ shellcheck $EXCL \
bin/epm bin/distro_info bin/epm-* bin/serv-* bin/tools_* bin/epm bin/distr_info bin/epm-* bin/serv-* bin/tools_*
...@@ -23,7 +23,7 @@ use_system_xdg ...@@ -23,7 +23,7 @@ use_system_xdg
install_file $PRODUCTDIR/product_logo_48.png /usr/share/pixmaps/$PRODUCT.png install_file $PRODUCTDIR/product_logo_48.png /usr/share/pixmaps/$PRODUCT.png
create desktop file # create desktop file
mkdir -p $BUILDROOT/usr/share/applications/ mkdir -p $BUILDROOT/usr/share/applications/
cat <<EOF >$BUILDROOT/usr/share/applications/$PRODUCT.desktop cat <<EOF >$BUILDROOT/usr/share/applications/$PRODUCT.desktop
[Desktop Entry] [Desktop Entry]
......
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