summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-10-20 09:10:31 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-10-20 09:10:31 +0200
commit42ab13ada931882e9aab25085aed98bb76f970e6 (patch)
tree66ba8c301c429aac2940d939dda896c5e983c542
parentb0f7b339307050ce5a52c3dfda97aa50a901e5b8 (diff)
downloadpostgresql-setup-tests-42ab13ada931882e9aab25085aed98bb76f970e6.tar.gz
postgresql-setup-tests-42ab13ada931882e9aab25085aed98bb76f970e6.tar.xz
postgresql-setup-tests-42ab13ada931882e9aab25085aed98bb76f970e6.zip
lib: lint bash constructs
* lib.sh: Mostly fix double-quoting and back-tick removal. * lib_pgsql.sh: Likewise.
-rw-r--r--lib.sh23
-rw-r--r--lib_pgsql.sh2
2 files changed, 9 insertions, 16 deletions
diff --git a/lib.sh b/lib.sh
index a0ba819..b8ef034 100644
--- a/lib.sh
+++ b/lib.sh
@@ -1,23 +1,23 @@
# package-agnostic function library. The "dtf_" prefix stands for
# "destructive test framework".
-. `dirname $BASH_SOURCE`/lib_pgsql.sh
+. "$(dirname "$BASH_SOURCE")/lib_pgsql.sh"
dtf_die() { echo >&2 "$@"; exit 1; }
dtf_generate_results_tarball()
{
- local dir=$(dirname $1)
- local name=$(basename $1)
+ local dir="$(dirname "$1")"
+ local name="$(basename "$1")"
local tarball=$dir/$name.tar.gz
- pushd $dir >/dev/null
+ pushd "$dir" >/dev/null
- local oumask=`umask`
+ local oumask="$(umask)"
umask 0077
- tar -czf $tarball $name
- umask $oumask
+ tar -czf "$tarball" "$name"
+ umask "$oumask"
export DTF_RESULT_TARBALL=$tarball
}
@@ -32,7 +32,7 @@ dtf_resultxml_init()
{
___dtf_resultxml_cache=""
___dtf_resultxml_file="$1"
- dtf_resultxml_cache "<run><date>`date --rfc-3339=seconds`</date>"
+ dtf_resultxml_cache "<run><date>$(date --rfc-3339=seconds)</date>"
if test ! -f "$___dtf_resultxml_file"; then
echo '<?xml version="1.0" encoding="utf-8"?>' > "$___dtf_resultxml_file" \
@@ -40,13 +40,6 @@ dtf_resultxml_init()
fi
}
-dtf_resultxml_task_result()
-{
- local id="$1"
- local desc="$2"
- local result="$3"
-}
-
dtf_resultxml_finish()
{
dtf_resultxml_cache "</run>"
diff --git a/lib_pgsql.sh b/lib_pgsql.sh
index f1ebe5f..08f8142 100644
--- a/lib_pgsql.sh
+++ b/lib_pgsql.sh
@@ -35,7 +35,7 @@ dtf_postgresql_checkphase()
rlAssertNotExists "/var/lib/pgsql/data/PG_VERSION"
- rlAssert0 "run under root user" `id -u`
+ rlAssert0 "run under root user" "$(id -u)"
rlGetPhaseState
test $? -gt 0 \