Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit d4c4798

Browse files
authoredMar 25, 2021
Use interpreter from $PATH instead of absolute paths in various scripts using /usr/bin/env (#9689)
On NixOS, `bash` isn't under `/bin/bash` but rather in some directory in `$PATH`. Locally, I've been patching those scripts to make them work. `/usr/bin/env` seems to be the only [portable way](https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my) to use binaries from the PATH as interpreters. Signed-off-by: Quentin Gliech <[email protected]>
1 parent e5801db commit d4c4798

17 files changed

+18
-17
lines changed
 

‎.buildkite/scripts/test_old_deps.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# this script is run by buildkite in a plain `xenial` container; it installs the
44
# minimal requirements for tox and hands over to the py35-old tox environment.

‎.buildkite/scripts/test_synapse_port_db.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Test script for 'synapse_port_db', which creates a virtualenv, installs Synapse along
44
# with additional dependencies needed for the test (such as coverage or the PostgreSQL

‎changelog.d/9689.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use interpreter from `$PATH` via `/usr/bin/env` instead of absolute paths in various scripts.

‎contrib/purge_api/purge_history.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# this script will use the api:
44
# https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_history_api.rst

‎contrib/purge_api/purge_remote_media.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
DOMAIN=yourserver.tld
44
# add this user as admin in your home server:

‎demo/clean.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

‎demo/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
DIR="$( cd "$( dirname "$0" )" && pwd )"
44

‎demo/stop.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
DIR="$( cd "$( dirname "$0" )" && pwd )"
44

‎docker/build_debian.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# The script to build the Debian package, as ran inside the Docker image.
44

‎docker/run_pg_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# This script runs the PostgreSQL tests inside a Docker container. It expects
44
# the relevant source files to be mounted into /src (done automatically by the

‎scripts-dev/check-newsfragment

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# A script which checks that an appropriate news file has been added on this
44
# branch.

‎scripts-dev/config-lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Find linting errors in Synapse's default config file.
33
# Exits with 0 if there are no problems, or another code otherwise.
44

‎scripts-dev/generate_sample_config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Update/check the docs/sample_config.yaml
44

‎scripts-dev/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Runs linting scripts over the local Synapse checkout
44
# isort - sorts import statements

‎scripts-dev/make_full_schema.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# This script generates SQL files for creating a brand new Synapse DB with the latest
44
# schema, on both SQLite3 and Postgres.

‎scripts-dev/next_github_number.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

55
# Fetch the current GitHub issue number, add one to it -- presto! The likely
66
# next PR number.
77
CURRENT_NUMBER=`curl -s "https://api.github.com/repos/matrix-org/synapse/issues?state=all&per_page=1" | jq -r ".[0].number"`
88
CURRENT_NUMBER=$((CURRENT_NUMBER+1))
9-
echo $CURRENT_NUMBER
9+
echo $CURRENT_NUMBER

‎test_postgresql.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# This script builds the Docker image to run the PostgreSQL tests, and then runs
44
# the tests.

0 commit comments

Comments
 (0)
This repository has been archived.