Skip to content

Commit

Permalink
some checkbashisms fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vitlav committed Apr 14, 2023
1 parent fcb7dbc commit 2eaa56b
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bin/epm-checksystem
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/epm-download
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/epm-epm_install
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bin/epm-pack
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions bin/epm-play
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -327,6 +327,7 @@ __epm_play_install()
esac
local p="$1"
local v=''
# drop spaces
n="$(echo $2)"
if [ "$n" = "=" ] ; then
v="$3"
Expand Down
3 changes: 1 addition & 2 deletions bin/epm-query_file
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/epm-release_upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion bin/epm-removerepo
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion bin/epm-repack-deb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bin/epm-repack-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/epm-sh-functions
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bin/epm-sh-install
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions check_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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_*
2 changes: 1 addition & 1 deletion repack.d/ungoogled-chromium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 2eaa56b

Please sign in to comment.