misc: Use /usr/bin/env for a more generic shebang

Use path based SHELL in Makefiles. It was suggested that this is a
better solution for make for cases when there is no /usr/bin/env.

See: https://github.com/purpleidea/mgmt/pull/694#discussion_r1015596204
This commit is contained in:
Karpfen
2025-03-22 14:53:21 -04:00
committed by James Shubin
parent f2d9219218
commit 7e8ced534f
92 changed files with 92 additions and 92 deletions

View File

@@ -27,7 +27,7 @@
# additional permission if he deems it necessary to achieve the goals of this
# additional permission.
SHELL = /usr/bin/env bash
SHELL = bash
.PHONY: all art cleanart version program lang path deps run race generate build build-debug crossbuild clean test gofmt yamlfmt format docs
.PHONY: rpmbuild mkdirs rpm srpm spec tar upload upload-sources upload-srpms upload-rpms upload-releases copr tag
.PHONY: mkosi mkosi_fedora-latest mkosi_fedora-older mkosi_stream-latest mkosi_debian-stable mkosi_ubuntu-latest mkosi_archlinux

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
script_directory="$( cd "$( dirname "$0" )" && pwd )"
project_directory=$script_directory/../..

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Stop on any error
set -e

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# runs command provided as argument inside a development (Linux) Docker container

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Stop on any error
set -e

View File

@@ -27,7 +27,7 @@
# additional permission if he deems it necessary to achieve the goals of this
# additional permission.
SHELL = /usr/bin/env bash
SHELL = bash
.PHONY: clean
.SILENT: clean

View File

@@ -27,7 +27,7 @@
# additional permission if he deems it necessary to achieve the goals of this
# additional permission.
SHELL = /usr/bin/env bash
SHELL = bash
.PHONY: all build clean fuzz
all: build

View File

@@ -794,7 +794,7 @@ class base:host($name, $config) {
# passed into the provisioner. It's just now in a deploy subdir.
# If it's a dir, then this becomes the empty strings.
# XXX: The deploy could instead happen over the network to etcd.
"echo '#!/bin/bash' > ${firstboot_scripts_dir}mgmt-deploy.sh && echo '${handoff_binary_path} deploy lang --seeds=http://127.0.0.1:2379 --no-git --module-path=${deploy_dir_modules} ${deploy_dir}${handoff_code_chunk}' >> ${firstboot_scripts_dir}mgmt-deploy.sh && chmod u+x ${firstboot_scripts_dir}mgmt-deploy.sh"
"echo '#!/usr/bin/env bash' > ${firstboot_scripts_dir}mgmt-deploy.sh && echo '${handoff_binary_path} deploy lang --seeds=http://127.0.0.1:2379 --no-git --module-path=${deploy_dir_modules} ${deploy_dir}${handoff_code_chunk}' >> ${firstboot_scripts_dir}mgmt-deploy.sh && chmod u+x ${firstboot_scripts_dir}mgmt-deploy.sh"
}
# TODO: Do we want to signal an http:flag if we're a "default" host?

View File

@@ -27,7 +27,7 @@
# additional permission if he deems it necessary to achieve the goals of this
# additional permission.
SHELL = /usr/bin/env bash
SHELL = bash
.PHONY: all fuzz
all: fuzz

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
_cli_bash_autocomplete_mgmt() {
local cur prev opts base

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# shitty cpu count control, useful for live demos
minimum=1 # don't decrease below this number of cpus

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script packages rpm, deb, and pacman packages of mgmt with fpm. The
# first argument is the distro type, and the second argument is the version. All
# subsequent arguments are the dependencies.

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if [ "$1" = "" ] || [ "$1" = "--help" ]; then
echo "usage: append standard header to file"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# simple test loop runner, eg: ./looper.sh make test-shell-exec-fail
while true

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Make a new "baddev" branch, start on whatever branch you want to base it on.
git checkout -B baddev # scary -B reset the branch
make

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script generates a deb changelog from the project's git history.
# version we're releasing

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# setup a simple golang environment
XPWD=`pwd`
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" # dir!

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# setup a few environment path values
if ! env | grep -q '^GOPATH='; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script generates an rpm changelog from the project's git history.
# version we're releasing

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This is a helper script to run mgmt and capture and filter stack traces. Any
# time mgmt crashes with a trace, it will first be filtered, and then displayed

View File

@@ -27,7 +27,7 @@
# additional permission if he deems it necessary to achieve the goals of this
# additional permission.
SHELL = /usr/bin/env bash
SHELL = bash
.PHONY: all clean
default: all

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
echo running "$0"
set -o errexit

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it as
# out-of-tree build dir. Otherwise, let's make up our own builddir.

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eEu
set -o pipefail

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# modified slightly, originally from:
# https://raw.githubusercontent.com/dlenski/travis-encrypt-sh/master/travis-encrypt

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# port tests to txtar
for f in */main.mcl; do
echo $f == $(dirname $f)

2
run.sh
View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# simple way to kick off runs of the project, since 'go run' sucks!
make build || exit 1

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
# runs all (or selected) test suite(s) in test/ and aggregates results
# Usage:
# ./test.sh

View File

@@ -27,7 +27,7 @@
# additional permission if he deems it necessary to achieve the goals of this
# additional permission.
SHELL = /usr/bin/env bash
SHELL = bash
.PHONY: all build clean
all: build

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
exit 0 # XXX: disable for now

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
exit 0 # XXX: disable for now

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
# FIXME: test for #124 --- Disabled for now

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
exit 0 # XXX: disable for now

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
# vim: noet:ts=8:sts=8:sw=8
exit 0 # XXX: disable for now

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
# vim: noet:ts=8:sts=8:sw=8
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -xe
#!/usr/bin/env -S bash -xe
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
# NOTES:
# * this is a simple shell based `mgmt` test case
# * it is recommended that you run mgmt wrapped in the timeout command

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check for any bash files that aren't properly formatted
# TODO: this is hardly exhaustive

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e
# tests if commit message conforms to convention
# library of utility functions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e -o pipefail

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check that our documentation still generates, even if we don't use it here
# shellcheck disable=SC1091

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check that our examples still build, even if we don't run them here
# shellcheck disable=SC1091

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# original version of this script from kubernetes project, under ALv2 license
echo running "$0"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check a bunch of linters with the golangci_lint
# TODO: run this from the test-golint.sh file instead to check for deltas

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check that go lint passes or doesn't get worse by some threshold
echo running "$0"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check a bunch of linters with the gometalinter
# TODO: run this from the test-golint.sh file instead to check for deltas

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo running "$0" "$@"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check that go vet passes
echo running "$0"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check that headers are properly formatted
echo running "$0"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# this file exists to that bash completion for test names works

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check for any markdown files that aren't in an ideal format
echo running "$0 $*"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check for any mcl files that aren't properly formatted
# TODO: this is hardly exhaustive

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# simple tests that don't deserve their own testfile
# library of utility functions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check that our modules still build, even if we don't run them here
# shellcheck disable=SC1091

View File

@@ -1,4 +1,4 @@
#!/bin/bash -i
#!/usr/bin/env -S bash -i
# simple test harness for testing mgmt via omv
echo running "$0"
CWD=`pwd`

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# simple test for reproducibility, probably needs major improvements
echo running "$0"
set -o errexit

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# simple test harness for testing mgmt
# NOTE: this will rm -rf /tmp/mgmt/

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# vet a few random things
echo running "$0"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# check for any yaml files that aren't properly formatted
exit 0 # i give up, we're skipping this entirely, help wanted to fix this

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# common settings and functions for test scripts