Skip to content

Commit

Permalink
Quote shell vars
Browse files Browse the repository at this point in the history
  • Loading branch information
asdil12 committed Jul 7, 2023
1 parent 6a6d3e1 commit ca0494f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions script/fetchneedles
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
printf "Get %s tests and needles from:\n\t\t%s\n" "${dist_name}" "${giturl}"
if [ 1 = ${needles_separate} ] ; then
if [ "$needles_separate" = 1 ] ; then
printf "\tand\t%s\n" "${needles_giturl}"
fi
printf "\n(environment variables mentioned in '%s' can be set to change these values)\n" "$0"
Expand All @@ -34,7 +34,7 @@ if [ -w / ]; then
chown "$dbuser:$dbgroup" "$dir/$dist"
fi
echo "running as root, re-exec as $dbuser ..."
exec sudo -u $dbuser env \
exec sudo -u "$dbuser" env \
dist="$dist" \
giturl="$giturl" \
branch="$branch" \
Expand Down Expand Up @@ -85,12 +85,12 @@ git_update() {
# For needles repos because of needle saving we might end up in conflict, i.e.
# detached HEAD so we need to repair this
git_update_needles() {
git_update $needles_branch
git_update "$needles_branch"
if [ "$(git rev-parse --abbrev-ref --symbolic-full-name HEAD)" = "HEAD" ]; then
git branch -D $needles_branch
git checkout -b $needles_branch
git branch --set-upstream-to=origin/$needles_branch $needles_branch
git push origin HEAD:$needles_branch
git branch -D "$needles_branch"
git checkout -b "$needles_branch"
git branch "--set-upstream-to=origin/$needles_branch" "$needles_branch"
git push origin "HEAD:$needles_branch"
fi
}

Expand Down
4 changes: 2 additions & 2 deletions script/openqa-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if [ -z "$running_systemd" ]; then
else
systemctl enable --now postgresql
fi
su postgres -c "/usr/share/openqa/script/setup-db" $dbuser $dbname
su postgres -c "/usr/share/openqa/script/setup-db" "$dbuser" "$dbname"

# setup webserver and fake-auth
[[ -n "$setup_web_proxy" ]] && proxy_args="--proxy=$setup_web_proxy"
Expand Down Expand Up @@ -92,7 +92,7 @@ if [ -z "$skip_suse_tests" ]; then
echo "cloning $sles_needles_giturl shallow. Call 'git fetch --unshallow' for full history"
git clone --depth 1 "$sles_needles_giturl" "$sles_needles_directory"
fi
chown -R $dbuser: /var/lib/openqa/tests/opensuse/products/sle/needles
chown -R "$dbuser:" /var/lib/openqa/tests/opensuse/products/sle/needles
fi
fi

Expand Down

0 comments on commit ca0494f

Please sign in to comment.