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

some checkbashisms fixes

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