aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/vendors
diff options
context:
space:
mode:
authorUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2021-06-26 19:40:25 +0100
committerGitHub <noreply@github.com>2021-06-26 20:40:25 +0200
commitb4d4d9abb322ed0807d2ba0888e73820499aa338 (patch)
treeb980d379e95034ee72aac29955833e1ef0dfd912 /scripts/vendors
parent111fe055b2f0f3a0225d2553cf739572d691a14d (diff)
downloadghdl-b4d4d9abb322ed0807d2ba0888e73820499aa338.tar.gz
ghdl-b4d4d9abb322ed0807d2ba0888e73820499aa338.tar.bz2
ghdl-b4d4d9abb322ed0807d2ba0888e73820499aa338.zip
Codacy issues, Travis cleanup and update ghdl.texi (#1807)
* ghw: fix memleaks reported by codacy * ghw: printf issues and style (GNU indent) * testsuite/gna: minor printf issues * testsuite: fix issues reported by codacy * scripts/ci-run: clean travis stuff (deprecated) * scripts: fix issues reported by codacy * doc/Makefile: add .PHONY * doc: update ghdl.texi * testsuite/synth: use synth_tb
Diffstat (limited to 'scripts/vendors')
-rwxr-xr-xscripts/vendors/compile-altera.sh2
-rwxr-xr-xscripts/vendors/compile-lattice.sh2
-rwxr-xr-xscripts/vendors/compile-osvvm.sh6
-rwxr-xr-xscripts/vendors/compile-xilinx-ise.sh12
-rwxr-xr-xscripts/vendors/compile-xilinx-vivado.sh2
-rwxr-xr-xscripts/vendors/filter.analyze.sh6
-rwxr-xr-xscripts/vendors/shared.sh16
7 files changed, 23 insertions, 23 deletions
diff --git a/scripts/vendors/compile-altera.sh b/scripts/vendors/compile-altera.sh
index 06269071e..17dfe42c7 100755
--- a/scripts/vendors/compile-altera.sh
+++ b/scripts/vendors/compile-altera.sh
@@ -217,7 +217,7 @@ fi
# Search Altera Quartus in default installation locations
DefaultDirectories=("/opt/Altera" "/opt/altera" "/c/Altera")
-if [ ! -z $QUARTUS_ROOTDIR ]; then
+if [ -n "$QUARTUS_ROOTDIR" ]; then
EnvSourceDir="$QUARTUS_ROOTDIR/${Altera_Quartus_Settings[SourceDirectory]}"
else
for DefaultDir in "${DefaultDirectories[@]}"; do
diff --git a/scripts/vendors/compile-lattice.sh b/scripts/vendors/compile-lattice.sh
index 2c42e2200..e5e8c3242 100755
--- a/scripts/vendors/compile-lattice.sh
+++ b/scripts/vendors/compile-lattice.sh
@@ -232,7 +232,7 @@ SetupDirectories LatticeDiamond "Lattice Diamond"
# create "lattice" directory and change to it
# => $DestinationDirectory
CreateDestinationDirectory
-cd $DestinationDirectory
+cd "$DestinationDirectory"
# Extend global GHDL Options TODO: move to GHDLSetup
diff --git a/scripts/vendors/compile-osvvm.sh b/scripts/vendors/compile-osvvm.sh
index 34b5f2dd4..9f69fc088 100755
--- a/scripts/vendors/compile-osvvm.sh
+++ b/scripts/vendors/compile-osvvm.sh
@@ -34,10 +34,10 @@ test greadlink --version > /dev/null 2>&1 && READLINK=greadlink || READLINK=read
# Save working directory
WorkingDir=$(pwd)
ScriptDir="$(dirname $0)"
-ScriptDir="$($READLINK -f $ScriptDir)"
+ScriptDir="$($READLINK -f "$ScriptDir")"
# Source Bash utilities
-source $ScriptDir/../ansi_color.sh
+source "$ScriptDir"/../ansi_color.sh
if [[ $? -ne 0 ]]; then echo 1>&2 -e "${COLORED_ERROR} While loading Bash utilities.${ANSI_NOCOLOR}" ; exit 1; fi
@@ -52,7 +52,7 @@ SUPPRESS_WARNINGS=0
HALT_ON_ERROR=0
DestDir=""
SrcDir=""
-while [[ $# -gt 0 ]]; do
+while [[ "$#" -gt 0 ]]; do
case "$1" in
-c|--clean)
COMMAND=3
diff --git a/scripts/vendors/compile-xilinx-ise.sh b/scripts/vendors/compile-xilinx-ise.sh
index 354193501..b904f2f0e 100755
--- a/scripts/vendors/compile-xilinx-ise.sh
+++ b/scripts/vendors/compile-xilinx-ise.sh
@@ -35,10 +35,10 @@ test greadlink --version > /dev/null 2>&1 && READLINK=greadlink || READLINK=read
# Save working directory
WorkingDir=$(pwd)
ScriptDir="$(dirname $0)"
-ScriptDir="$($READLINK -f $ScriptDir)"
+ScriptDir="$($READLINK -f "$ScriptDir")"
# Source Bash utilities
-source $ScriptDir/../ansi_color.sh
+source "$ScriptDir"/../ansi_color.sh
if [[ $? -ne 0 ]]; then echo 1>&2 -e "${COLORED_ERROR} While loading Bash utilities.${ANSI_NOCOLOR}" ; exit 1; fi
@@ -60,7 +60,7 @@ VHDLStandard=93
GHDLBinDir=""
DestDir=""
SrcDir=""
-while [[ $# -gt 0 ]]; do
+while [[ "$#" -gt 0 ]]; do
case "$1" in
-c|--clean)
COMMAND=3
@@ -210,14 +210,14 @@ fi
# Search Xilinx ISE in default installation locations
DefaultDirectories=("/opt/Xilinx" "/opt/xilinx" "/c/Xilinx")
-if [ ! -z $XILINX ]; then
+if [ -n "$XILINX" ]; then
EnvSourceDir="$XILINX/${Xilinx_ISE_Settings[SourceDirectory]}"
else
for DefaultDir in "${DefaultDirectories[@]}"; do
for Major in 14 13; do
for Minor in 7 6 5 4 3 2 1 0; do
- Dir=$DefaultDir/${Major}.${Minor}/ISE_DS
- if [ -d $Dir ]; then
+ Dir="$DefaultDir/${Major}.${Minor}"/ISE_DS
+ if [ -d "$Dir" ]; then
EnvSourceDir="$Dir/${Xilinx_ISE_Settings[SourceDirectory]}"
break 3
fi
diff --git a/scripts/vendors/compile-xilinx-vivado.sh b/scripts/vendors/compile-xilinx-vivado.sh
index 050f0ab4a..334df149f 100755
--- a/scripts/vendors/compile-xilinx-vivado.sh
+++ b/scripts/vendors/compile-xilinx-vivado.sh
@@ -38,7 +38,7 @@ ScriptDir="$(dirname $0)"
ScriptDir="$($READLINK -f $ScriptDir)"
# Source Bash utilities
-source $ScriptDir/../ansi_color.sh
+source "$ScriptDir"/../ansi_color.sh
if [[ $? -ne 0 ]]; then echo 1>&2 -e "${COLORED_ERROR} While loading Bash utilities.${ANSI_NOCOLOR}" ; exit 1; fi
diff --git a/scripts/vendors/filter.analyze.sh b/scripts/vendors/filter.analyze.sh
index dfb99eaa9..a3242df7e 100755
--- a/scripts/vendors/filter.analyze.sh
+++ b/scripts/vendors/filter.analyze.sh
@@ -35,9 +35,9 @@ test greadlink --version > /dev/null 2>&1 && READLINK=greadlink || READLINK=read
# Save working directory
WorkingDir=$(pwd)
ScriptDir="$($READLINK -f $(dirname $0))"
-RootDir="$($READLINK -f $ScriptDir/..)"
+RootDir="$($READLINK -f "$ScriptDir"/..)"
-source $ScriptDir/../ansi_color.sh
+source "$ScriptDir"/../ansi_color.sh
if [[ $? -ne 0 ]]; then echo 1>&2 -e "${COLORED_ERROR} While loading Bash utilities.${ANSI_NOCOLOR}" ; exit 1; fi
# command line argument processing
@@ -45,7 +45,7 @@ COMMAND=2
INDENT=""
VERBOSE=0
DEBUG=0
-while [[ $# > 0 ]]; do
+while [ "$#" -gt 0 ]; do
key="$1"
case $key in
-i|--indent)
diff --git a/scripts/vendors/shared.sh b/scripts/vendors/shared.sh
index 23f99375d..1c620db41 100755
--- a/scripts/vendors/shared.sh
+++ b/scripts/vendors/shared.sh
@@ -56,9 +56,9 @@ VERBOSE=${VERBOSE:-0}
DEBUG=${DEBUG:-0}
CONTINUE_ON_ERROR=${CONTINUE_ON_ERROR:-0}
-test $VERBOSE -eq 1 && echo -e " Declaring Bash procedures for GHDL..."
+test "$VERBOSE" -eq 1 && echo -e " Declaring Bash procedures for GHDL..."
-test $DEBUG -eq 1 && echo -e " ${ANSI_DARK_GRAY}procedure SetupDirectories( <Index> <Name> )${ANSI_NOCOLOR}"
+test "$DEBUG" -eq 1 && echo -e " ${ANSI_DARK_GRAY}procedure SetupDirectories( <Index> <Name> )${ANSI_NOCOLOR}"
# SetupDirectories
# -> $Index
# -> $Name
@@ -108,7 +108,7 @@ SetupDirectories() {
fi
}
-test $DEBUG -eq 1 && echo -e " ${ANSI_DARK_GRAY}procedure CreateDestinationDirectory( undocumented )${ANSI_NOCOLOR}"
+test "$DEBUG" -eq 1 && echo -e " ${ANSI_DARK_GRAY}procedure CreateDestinationDirectory( undocumented )${ANSI_NOCOLOR}"
# CreateDestinationDirectory
# -> undocumented
CreateDestinationDirectory() {
@@ -123,18 +123,18 @@ CreateDestinationDirectory() {
fi
}
-test $DEBUG -eq 1 && echo -e " ${ANSI_DARK_GRAY}procedure GHDLSetup( <VHDLStandard> )${ANSI_NOCOLOR}"
+test "$DEBUG" -eq 1 && echo -e " ${ANSI_DARK_GRAY}procedure GHDLSetup( <VHDLStandard> )${ANSI_NOCOLOR}"
# GHDLSetup
# -> $VHDLStandard
# <= $VHDLVersion
# <= $VHDLStandard
# <= $VHDLFlavor
GHDLSetup() {
- if [ $1 -eq 93 ]; then
+ if [ "$1" -eq 93 ]; then
VHDLVersion="v93"
VHDLStandard="93c"
VHDLFlavor="synopsys"
- elif [ $1 -eq 2008 ]; then
+ elif [ "$1" -eq 2008 ]; then
VHDLVersion="v08"
VHDLStandard="08"
VHDLFlavor="synopsys"
@@ -295,9 +295,9 @@ AnalyzeLibrary() {
echo -e "${ANSI_YELLOW}Analyzing files into library '$LibraryName'...${ANSI_NOCOLOR}"
for File in $Files; do
- test $VERBOSE -eq 1 && echo -e "${ANSI_CYAN} Analyzing '$File'${ANSI_NOCOLOR}"
+ test "$VERBOSE" -eq 1 && echo -e "${ANSI_CYAN} Analyzing '$File'${ANSI_NOCOLOR}"
- AnalyzeVHDL $LibraryName "$SourceDirectory" "$LibraryPath" "$File"
+ AnalyzeVHDL "$LibraryName" "$SourceDirectory" "$LibraryPath" "$File"
done
}