From ba9f18e2b87a1dc6b9f7fea304379c4e41aaaa85 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Mon, 17 Aug 2020 09:18:02 +0200 Subject: Use `bash` binary from env instead of /bin/bash for scripts It's not possible to run any of the scripts on distributions which do have `bash` not in `/bin`. This is being fixed by using `/usr/bin/env bash` instead. Signed-off-by: Sascha Grunert --- hack/apparmor_tag.sh | 2 +- hack/btrfs_installed_tag.sh | 2 +- hack/btrfs_tag.sh | 2 +- hack/check_root.sh | 2 +- hack/get_ci_vm.sh | 2 +- hack/get_release_info.sh | 2 +- hack/golangci-lint.sh | 3 ++- hack/install_bats.sh | 2 +- hack/install_catatonit.sh | 3 ++- hack/install_golangci.sh | 2 +- hack/libdm_tag.sh | 2 +- hack/man-page-checker | 2 +- hack/podman-commands.sh | 2 +- hack/podmanv2-retry | 2 +- hack/selinux_tag.sh | 2 +- hack/tree_status.sh | 2 +- 16 files changed, 18 insertions(+), 16 deletions(-) (limited to 'hack') diff --git a/hack/apparmor_tag.sh b/hack/apparmor_tag.sh index 0fd222210..794370e79 100755 --- a/hack/apparmor_tag.sh +++ b/hack/apparmor_tag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if pkg-config libapparmor 2> /dev/null ; then echo apparmor fi diff --git a/hack/btrfs_installed_tag.sh b/hack/btrfs_installed_tag.sh index 357f33b8b..c4d99f377 100755 --- a/hack/btrfs_installed_tag.sh +++ b/hack/btrfs_installed_tag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cc -E - > /dev/null 2> /dev/null << EOF #include EOF diff --git a/hack/btrfs_tag.sh b/hack/btrfs_tag.sh index cc48504ab..59cb969ad 100755 --- a/hack/btrfs_tag.sh +++ b/hack/btrfs_tag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cc -E - > /dev/null 2> /dev/null << EOF #include EOF diff --git a/hack/check_root.sh b/hack/check_root.sh index 203eae9d3..1f53887ff 100755 --- a/hack/check_root.sh +++ b/hack/check_root.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if ! [ $(id -u) = 0 ]; then echo "Please run as root! '$@' requires root privileges." exit 1 diff --git a/hack/get_ci_vm.sh b/hack/get_ci_vm.sh index 05b7a4a6d..b37dba508 100755 --- a/hack/get_ci_vm.sh +++ b/hack/get_ci_vm.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/hack/get_release_info.sh b/hack/get_release_info.sh index c1c694a44..69cf8cd57 100755 --- a/hack/get_release_info.sh +++ b/hack/get_release_info.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script produces various bits of metadata needed by Makefile. Using # a script allows uniform behavior across multiple environments and diff --git a/hack/golangci-lint.sh b/hack/golangci-lint.sh index 8c81a3743..03c29c89a 100755 --- a/hack/golangci-lint.sh +++ b/hack/golangci-lint.sh @@ -1,6 +1,7 @@ -#!/bin/bash -e +#!/usr/bin/env bash # Need to run linter twice to cover all the build tags code paths +set -e declare -A BUILD_TAGS # TODO: add systemd tag diff --git a/hack/install_bats.sh b/hack/install_bats.sh index 00ded07a9..d30e3daf8 100755 --- a/hack/install_bats.sh +++ b/hack/install_bats.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/hack/install_catatonit.sh b/hack/install_catatonit.sh index 7fd7592a9..8837db3a8 100755 --- a/hack/install_catatonit.sh +++ b/hack/install_catatonit.sh @@ -1,7 +1,8 @@ -#!/bin/bash -e +#!/usr/bin/env bash BASE_PATH="/usr/libexec/podman" CATATONIT_PATH="${BASE_PATH}/catatonit" CATATONIT_VERSION="v0.1.4" +set -e if [ -f $CATATONIT_PATH ]; then echo "skipping ... catatonit is already installed" diff --git a/hack/install_golangci.sh b/hack/install_golangci.sh index 6ef8ce823..57cdd2e4d 100755 --- a/hack/install_golangci.sh +++ b/hack/install_golangci.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/hack/libdm_tag.sh b/hack/libdm_tag.sh index d1f83ba10..d3668aab1 100755 --- a/hack/libdm_tag.sh +++ b/hack/libdm_tag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash tmpdir="$PWD/tmp.$RANDOM" mkdir -p "$tmpdir" trap 'rm -fr "$tmpdir"' EXIT diff --git a/hack/man-page-checker b/hack/man-page-checker index d2cc6c6e1..45f9edbd1 100755 --- a/hack/man-page-checker +++ b/hack/man-page-checker @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # man-page-checker - validate and cross-reference man page names # diff --git a/hack/podman-commands.sh b/hack/podman-commands.sh index da4d446aa..587cac782 100755 --- a/hack/podman-commands.sh +++ b/hack/podman-commands.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Compare commands listed by 'podman help' against those in 'man podman'. # Recurse into subcommands as well. diff --git a/hack/podmanv2-retry b/hack/podmanv2-retry index ea77486ff..1f3be0731 100755 --- a/hack/podmanv2-retry +++ b/hack/podmanv2-retry @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # podman-try - try running a command via PODMAN1; use PODMAN2 as fallback # diff --git a/hack/selinux_tag.sh b/hack/selinux_tag.sh index ff80fda04..993630ad6 100755 --- a/hack/selinux_tag.sh +++ b/hack/selinux_tag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if pkg-config libselinux 2> /dev/null ; then echo selinux fi diff --git a/hack/tree_status.sh b/hack/tree_status.sh index ac874a347..2f56cdcd3 100755 --- a/hack/tree_status.sh +++ b/hack/tree_status.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e SUGGESTION="${SUGGESTION:-sync the vendor.conf and commit all changes.}" -- cgit v1.2.3-54-g00ecf