Skip to content

Commit

Permalink
Merge pull request #691 from saschagrunert/bashify
Browse files Browse the repository at this point in the history
Use `bash` binary from env instead of /bin/bash for scripts
  • Loading branch information
rhatdan authored Aug 17, 2020
2 parents bb31b67 + c71eadb commit 1933777
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion contrib/cirrus/add_second_partition.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# N/B: This script could mega f*!@up your disks if run by mistake.
# it is left without the execute-bit on purpose!
Expand Down
2 changes: 1 addition & 1 deletion contrib/cirrus/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion contrib/cirrus/lib.sh.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Unit tests for some functions in lib.sh
#
Expand Down
2 changes: 1 addition & 1 deletion contrib/cirrus/ooe.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# This script executes a command while logging all output to a temporary
# file. If the command exits non-zero, then all output is sent to the console,
Expand Down
2 changes: 1 addition & 1 deletion contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
20 changes: 10 additions & 10 deletions hack/btrfs_tag.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
if test $(${GO:-go} env GOOS) != "linux" ; then
exit 0
#!/usr/bin/env bash
if test $(${GO:-go} env GOOS) != "linux"; then
exit 0
fi
cc -E - > /dev/null 2> /dev/null <<- EOF
cc -E - >/dev/null 2>/dev/null <<-EOF
#include <btrfs/ioctl.h>
EOF
if test $? -ne 0 ; then
echo exclude_graphdriver_btrfs
if test $? -ne 0; then
echo exclude_graphdriver_btrfs
else
cc -E - > /dev/null 2> /dev/null <<- EOF
cc -E - >/dev/null 2>/dev/null <<-EOF
#include <btrfs/version.h>
EOF
if test $? -ne 0 ; then
echo btrfs_noversion
fi
if test $? -ne 0; then
echo btrfs_noversion
fi
fi
2 changes: 1 addition & 1 deletion hack/gccgo-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Work around, based on one described in https://github.com/golang/go/issues/15628
#
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-authors.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."
Expand Down
2 changes: 1 addition & 1 deletion hack/get_ci_vm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion hack/git-validation.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
export PATH=${GOPATH%%:*}/bin:${PATH}
export GIT_VALIDATION=tests/tools/build/git-validation
if [ ! -x "$GIT_VALIDATION" ]; then
Expand Down
2 changes: 1 addition & 1 deletion hack/gofmt.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if test $(find -name "*.go" -not -path "*/vendor/*" -print0 | xargs -n 1 -0 gofmt -s -l | wc -l) -ne 0 ; then
echo Error: source files are not formatted according to recommendations. Run \"gofmt -s -w\" on:
find -name "*.go" -not -path "*/vendor/*" -print0 | xargs -n 1 -0 gofmt -s -l
Expand Down
2 changes: 1 addition & 1 deletion hack/govet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
for package in $(go list ./... | grep -v /vendor/) ; do
if ! go vet ${package} ; then
echo Error: source package ${package} does not pass go vet.
Expand Down
2 changes: 1 addition & 1 deletion hack/libdm_tag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if test $(${GO:-go} env GOOS) != "linux" ; then
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

STORAGE_BINARY=${STORAGE_BINARY:-$(dirname ${BASH_SOURCE})/../containers-storage}
TESTSDIR=${TESTSDIR:-$(dirname ${BASH_SOURCE})}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_drivers.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

TMPDIR=${TMPDIR:-/var/tmp}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_runner.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
Expand Down
2 changes: 1 addition & 1 deletion vagrant/provision.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -xe

source /etc/os-release
Expand Down
2 changes: 1 addition & 1 deletion vagrant/runinvm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
export PKG='github.com/containers/storage'
export VAGRANT_MACHINES="fedora debian"
Expand Down

0 comments on commit 1933777

Please sign in to comment.