diff options
author | Joseph Herlant <aerostitch@users.noreply.github.com> | 2018-06-04 23:27:43 -0700 |
---|---|---|
committer | jkoan <jkoan@users.noreply.github.com> | 2018-06-05 08:27:43 +0200 |
commit | 5cb434fe13ca071d0eca38800519158013c96888 (patch) | |
tree | 091f0f6b04e28d335b38918ef1f4b672a4ab66e2 | |
parent | fbb59e4739cd085706e0f045a0db53e3ec8bd695 (diff) | |
download | navit-5cb434fe13ca071d0eca38800519158013c96888.tar.gz |
cleanup:scripts:Use $(..) instead of legacy `..` to make codefactor happy (#623)
-rwxr-xr-x | contrib/sailfish/build_on_sailfish_sdk.sh | 4 | ||||
-rwxr-xr-x | navit/android/change_xslt.sh | 10 | ||||
-rwxr-xr-x | navit/script/cabify.sh | 10 | ||||
-rwxr-xr-x | navit/startonce.sh | 4 | ||||
-rwxr-xr-x | navit/tools/cleanattr.sh | 2 | ||||
-rw-r--r-- | scripts/generate_contributors.sh | 4 | ||||
-rw-r--r-- | scripts/import_translations.sh | 70 | ||||
-rw-r--r-- | scripts/merge_i18n_update.sh | 2 | ||||
-rw-r--r-- | scripts/xdotools.sh | 4 |
9 files changed, 55 insertions, 55 deletions
diff --git a/contrib/sailfish/build_on_sailfish_sdk.sh b/contrib/sailfish/build_on_sailfish_sdk.sh index 2aa8ca3dc..4198f9924 100755 --- a/contrib/sailfish/build_on_sailfish_sdk.sh +++ b/contrib/sailfish/build_on_sailfish_sdk.sh @@ -9,8 +9,8 @@ if [ -z ${VERSION_ID+x} ]; then echo "VERSION_ID not set. Forgot to export VERSI #arm devices sb2 -t SailfishOS-${VERSION_ID}-armv7hl -m sdk-install -R zypper in $(grep "^BuildRequires: " navit-sailfish.spec | sed -e "s/BuildRequires: //") -sb2 -t SailfishOS-${VERSION_ID}-armv7hl -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source `pwd`/../.." -bb navit-sailfish.spec +sb2 -t SailfishOS-${VERSION_ID}-armv7hl -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source $(pwd)/../.." -bb navit-sailfish.spec #intel devices sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-install -R zypper in $(grep "^BuildRequires: " navit-sailfish.spec | sed -e "s/BuildRequires: //") -sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source `pwd`/../.." -bb navit-sailfish.spec +sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source $(pwd)/../.." -bb navit-sailfish.spec diff --git a/navit/android/change_xslt.sh b/navit/android/change_xslt.sh index dce6707b2..c186e7314 100755 --- a/navit/android/change_xslt.sh +++ b/navit/android/change_xslt.sh @@ -23,31 +23,31 @@ REG3='{round(@1@-number($LAYOUT_001_ORDER_DELTA_1))}-{round(@2@-number($LAYOUT_0 REG4='{round(@1@-number($LAYOUT_001_ORDER_DELTA_1))}' for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do - a=`echo "$REG0"|sed -e "s#@1@#$i#"` + a=$(echo "$REG0"|sed -e "s#@1@#$i#") sed -e "s#order=\"0-${i}\"#order=\"${a}\"#g" -i "$temp" done # dont change order="0-" values !! for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do - a=`echo "$REG1"|sed -e "s#@1@#$i#"` + a=$(echo "$REG1"|sed -e "s#@1@#$i#") sed -e "s#order=\"${i}-\"#order=\"${a}\"#g" -i "$temp" done for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do - a=`echo "$REG2"|sed -e "s#@1@#$i#"` + a=$(echo "$REG2"|sed -e "s#@1@#$i#") sed -e "s#order=\"-${i}\"#order=\"${a}\"#g" -i "$temp" done for j in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do - a=`echo "$REG3"|sed -e "s#@1@#$i#"|sed -e "s#@2@#$j#"` + a=$(echo "$REG3"|sed -e "s#@1@#$i#"|sed -e "s#@2@#$j#") sed -e "s#order=\"${i}-${j}\"#order=\"${a}\"#g" -i "$temp" done done for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do - a=`echo "$REG4"|sed -e "s#@1@#$i#"` + a=$(echo "$REG4"|sed -e "s#@1@#$i#") sed -e "s#order=\"${i}\"#order=\"${a}\"#g" -i "$temp" done cp -p "$temp" "$out" diff --git a/navit/script/cabify.sh b/navit/script/cabify.sh index 33c94d04d..ea6dba4b4 100755 --- a/navit/script/cabify.sh +++ b/navit/script/cabify.sh @@ -44,14 +44,14 @@ echo -n > $CABLIST.$$ for i in $SRCDIR/locale/*/*/*.mo do - bn="`basename "$i"`" + bn=$(basename "$i") d=${i##$SRCDIR/} echo "$i $BASEDIR/$d" >> $CABLIST.$$ done for i in $SRCDIR/navit/icons/*.xpm do - bn="`basename "$i"`" + bn=$(basename "$i") echo "$i $BASEDIR/icons/" >> $CABLIST.$$ done @@ -64,17 +64,17 @@ if [ "$MAPSDIR" != "" ] then for i in $MAPSDIR/*.bin do - bn="`basename "$i"`" + bn=$(basename "$i") echo "$i $BASEDIR/maps/$bn" >> $CABLIST.$$ done for i in $MAPSDIR/*.txt do - bn="`basename "$i"`" + bn=$(basename "$i") echo "$i $BASEDIR/maps/$bn" >> $CABLIST.$$ done for i in $MAPSDIR/*.img do - bn="`basename "$i"`" + bn=$(basename "$i") echo "$i $BASEDIR/maps/$bn" >> $CABLIST.$$ done fi diff --git a/navit/startonce.sh b/navit/startonce.sh index 934e6533e..3e27d77f0 100755 --- a/navit/startonce.sh +++ b/navit/startonce.sh @@ -58,12 +58,12 @@ function start_navit() function check_navit() { if [ -f $PIDFILE ] ; then - pid=`cat $PIDFILE` + pid=$(cat $PIDFILE) kill -0 $pid 2>/dev/null if [ $? -eq 0 ] ; then echo "Bringing Navit to front" - winid=`wmctrl -l -p | grep -e "^[^:blank:]*[:blank:]*[^:blank:]*[:blank:]*$pid[:blank:]*" | sed 's/ .*//'` + winid=$(wmctrl -l -p | grep -e "^[^:blank:]*[:blank:]*[^:blank:]*[:blank:]*$pid[:blank:]*" | sed 's/ .*//') wmctrl -i -R $winid exit 0 diff --git a/navit/tools/cleanattr.sh b/navit/tools/cleanattr.sh index 536ea4b8f..200db5b66 100755 --- a/navit/tools/cleanattr.sh +++ b/navit/tools/cleanattr.sh @@ -28,7 +28,7 @@ if [ $? -ne 0 ] ; then fi -ATTRLIST=`grep 'ATTR(.*)' $ATTRFILE | sed 's#^ATTR(##' | sed 's#).*##'` +ATTRLIST=$(grep 'ATTR(.*)' $ATTRFILE | sed 's#^ATTR(##' | sed 's#).*##') cp $ATTRFILE $TMPFILE diff --git a/scripts/generate_contributors.sh b/scripts/generate_contributors.sh index 619b0f862..43ef47c73 100644 --- a/scripts/generate_contributors.sh +++ b/scripts/generate_contributors.sh @@ -11,7 +11,7 @@ set -e declare -A CONTRIBUTORS=() declare -a authors=() -TWO_YEARS_AGO=`date +%s --date="2 years ago"` +TWO_YEARS_AGO=$(date +%s --date="2 years ago") retiredTitleWritten=false git log --encoding=utf-8 --full-history --date=short --use-mailmap "--format=format:%ad;%aN" | @@ -20,7 +20,7 @@ git log --encoding=utf-8 --full-history --date=short --use-mailmap "--format=for while read -r line; do IFS=';'; arrLine=($line); unset IFS; author=${arrLine[1]} - commitDate=`date +%s --date="${arrLine[0]}"` + commitDate=$(date +%s --date="${arrLine[0]}") # Exclude circleci if [[ $author =~ [Cc]ircle[[:space:]]*[Cc][Ii] ]]; then diff --git a/scripts/import_translations.sh b/scripts/import_translations.sh index c934515e2..741c47200 100644 --- a/scripts/import_translations.sh +++ b/scripts/import_translations.sh @@ -6,42 +6,42 @@ set -e # Let's fix the headers of the .po files in the import queue for i in po/import_queue/*.po; do - b=`basename $i`; - po=${b#*-}; - code=${po%.*} - git checkout -b i18n/$code - lname=`head -n1 ${i} | sed 's/# \(.*\) translation.\{0,1\} for navit/\1/'` - if [[ $lname == "" ]]; then - echo "Cannot find the language name in the header of $i" - exit 1 - fi - d=`date +"%Y"` - echo "# ${lname} translations for navit" > po/${po}.header - echo "# Copyright (C) 2006-${d} The Navit Team" >> po/${po}.header - echo "# This file is distributed under the same license as the navit package." >> po/${po}.header - echo "# Many thanks to the contributors of this translation:" >> po/${po}.header - # Build a clean list of the contributors - IFS=$'\n' - echo "Downloading https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details" - contributors=`wget -q https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details -O - | grep -E '^ <a href=".+?" class="sprite person">'` - for user in $contributors; do - url=`echo $user|cut -d'"' -f2` - name=`echo $user|cut -d'>' -f2|cut -d'<' -f1` - echo "# $name $url" >> po/${po}.header - done - echo '' >> po/${po}.header - echo 'msgid ""' >> po/${po}.header + b=$(basename $i) + po=${b#*-} + code=${po%.*} + git checkout -b i18n/$code + lname=$(head -n1 ${i} | sed 's/# \(.*\) translation.\{0,1\} for navit/\1/') + if [[ $lname == "" ]]; then + echo "Cannot find the language name in the header of $i" + exit 1 + fi + d=$(date +"%Y") + echo "# ${lname} translations for navit" > po/${po}.header + echo "# Copyright (C) 2006-${d} The Navit Team" >> po/${po}.header + echo "# This file is distributed under the same license as the navit package." >> po/${po}.header + echo "# Many thanks to the contributors of this translation:" >> po/${po}.header + # Build a clean list of the contributors + IFS=$'\n' + echo "Downloading https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details" + contributors=$(wget -q https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details -O - | grep -E '^ <a href=".+?" class="sprite person">') + for user in $contributors; do + url=$(echo $user|cut -d'"' -f2) + name=$(echo $user|cut -d'>' -f2|cut -d'<' -f1) + echo "# $name $url" >> po/${po}.header + done + echo '' >> po/${po}.header + echo 'msgid ""' >> po/${po}.header - # We remove two tags that just generate noise - sed -i '/X-Launchpad-Export-Date/d' ${i} - sed -i '/X-Generator/d' ${i} - sed -i '/POT-Creation-Date/d' ${i} + # We remove two tags that just generate noise + sed -i '/X-Launchpad-Export-Date/d' ${i} + sed -i '/X-Generator/d' ${i} + sed -i '/POT-Creation-Date/d' ${i} - # Let's put the translation from launchpad without the header - mv po/${po}.header po/${po}.in - sed '1,/msgid ""/ d' ${i} >> po/${po}.in + # Let's put the translation from launchpad without the header + mv po/${po}.header po/${po}.in + sed '1,/msgid ""/ d' ${i} >> po/${po}.in - git add po/${po}.in && rm $i - git commit -m "Updated ${lname} translation from launchpad" po/${po}.in - git push --set-upstream origin i18n/${code} + git add po/${po}.in && rm $i + git commit -m "Updated ${lname} translation from launchpad" po/${po}.in + git push --set-upstream origin i18n/${code} done diff --git a/scripts/merge_i18n_update.sh b/scripts/merge_i18n_update.sh index 5fb42d56e..bb0715d5b 100644 --- a/scripts/merge_i18n_update.sh +++ b/scripts/merge_i18n_update.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -message=`git log -1 --pretty=%B` +message=$(git log -1 --pretty=%B) git config --global user.name "CircleCI" git config --global user.email circleci@navit-project.org git rebase trunk diff --git a/scripts/xdotools.sh b/scripts/xdotools.sh index 143a36ee7..a9fa65e8d 100644 --- a/scripts/xdotools.sh +++ b/scripts/xdotools.sh @@ -11,7 +11,7 @@ LOGS_DIR=$CIRCLE_ARTIFACTS/logs_${1} event=0 send_event (){ - file=`printf "%05d\n" $event` + file=$(printf "%05d\n" $event) import -window root $FRAME_DIR/tmp.png if [[ "$1" == "mousemove" ]]; then @@ -82,7 +82,7 @@ send_event key KP_Enter # Validate # Send 'Berk' # capture 5 seconds of usage -for i in `seq 99994 99999`; do +for i in $(seq 99994 99999); do import -window root $FRAME_DIR/${i}.png sleep 1 done |