From 5e82ebb33cf0dd7b944543b19337ebda78710dba Mon Sep 17 00:00:00 2001 From: nasirhm Date: Fri, 4 Dec 2020 02:42:10 +0500 Subject: [PATCH] :wrench: Modified Scripts to use env for shebang. The current shebang statements work fine on a Fedora host, But while trying to setup a development environment on non-Fedora host, It seems to cause an issue as bash doesn't always live on /bin/bash in some operating systems. The usage /usr/bin/env bash makes sure, we're pointing towards the environment. It improves our portability for the scripts for non-fedora-like hosts. Signed-off-by: nasirhm --- .travis/archlinux/travis-tasks.sh | 2 +- .travis/centos/travis-tasks.sh | 2 +- .travis/coverity/travis-tasks.sh | 2 +- .travis/coverity_prep.sh | 2 +- .travis/docs/travis-tasks.sh | 2 +- .travis/fedora/travis-tasks.sh | 2 +- .travis/get_rawhide_version.py | 2 +- .travis/mageia/travis-tasks.sh | 2 +- .travis/openmandriva/travis-tasks.sh | 2 +- .travis/opensuse/travis-tasks.sh | 2 +- .travis/retry-command.sh | 2 +- .travis/scanbuild.sh | 2 +- .travis/travis-archlinux.sh | 2 +- .travis/travis-centos.sh | 2 +- .travis/travis-common.inc | 2 +- .travis/travis-coverity.sh | 2 +- .travis/travis-docs.sh | 2 +- .travis/travis-fedora.sh | 2 +- .travis/travis-mageia.sh | 2 +- .travis/travis-openmandriva.sh | 2 +- .travis/travis-opensuse.sh | 2 +- run_ci_tests.sh | 2 +- setup_dev_container.sh | 2 +- spec_tmpl.sh | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.travis/archlinux/travis-tasks.sh b/.travis/archlinux/travis-tasks.sh index ca6d4980c..fcfcf5489 100755 --- a/.travis/archlinux/travis-tasks.sh +++ b/.travis/archlinux/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/centos/travis-tasks.sh b/.travis/centos/travis-tasks.sh index b68986ca4..80c8af9de 100755 --- a/.travis/centos/travis-tasks.sh +++ b/.travis/centos/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/coverity/travis-tasks.sh b/.travis/coverity/travis-tasks.sh index c26c50f21..6bad09d59 100755 --- a/.travis/coverity/travis-tasks.sh +++ b/.travis/coverity/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/coverity_prep.sh b/.travis/coverity_prep.sh index 0512d2bbe..087aef710 100755 --- a/.travis/coverity_prep.sh +++ b/.travis/coverity_prep.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -x diff --git a/.travis/docs/travis-tasks.sh b/.travis/docs/travis-tasks.sh index 6fc0dbd35..849c5433d 100755 --- a/.travis/docs/travis-tasks.sh +++ b/.travis/docs/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/fedora/travis-tasks.sh b/.travis/fedora/travis-tasks.sh index f12ac16d2..6bf272663 100755 --- a/.travis/fedora/travis-tasks.sh +++ b/.travis/fedora/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/get_rawhide_version.py b/.travis/get_rawhide_version.py index 9500b7b89..2fb5e853f 100755 --- a/.travis/get_rawhide_version.py +++ b/.travis/get_rawhide_version.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of libmodulemd # Copyright (C) 2020 Stephen Gallagher diff --git a/.travis/mageia/travis-tasks.sh b/.travis/mageia/travis-tasks.sh index 30f2ad23e..9130ded19 100755 --- a/.travis/mageia/travis-tasks.sh +++ b/.travis/mageia/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/openmandriva/travis-tasks.sh b/.travis/openmandriva/travis-tasks.sh index a4e025b85..1485cff47 100755 --- a/.travis/openmandriva/travis-tasks.sh +++ b/.travis/openmandriva/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/opensuse/travis-tasks.sh b/.travis/opensuse/travis-tasks.sh index 72665f903..de190ef21 100755 --- a/.travis/opensuse/travis-tasks.sh +++ b/.travis/opensuse/travis-tasks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Exit on failures set -e diff --git a/.travis/retry-command.sh b/.travis/retry-command.sh index 9642af129..311ab0e53 100755 --- a/.travis/retry-command.sh +++ b/.travis/retry-command.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash function retry_command { local usage="Usage: ${FUNCNAME[0]} [-b backoff-factor] [-d delay] [-n numtries]" diff --git a/.travis/scanbuild.sh b/.travis/scanbuild.sh index c558a93f1..fddf2fa65 100755 --- a/.travis/scanbuild.sh +++ b/.travis/scanbuild.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of libmodulemd # Copyright (C) 2018 Stephen Gallagher # diff --git a/.travis/travis-archlinux.sh b/.travis/travis-archlinux.sh index cfc097a1c..f3755eb03 100755 --- a/.travis/travis-archlinux.sh +++ b/.travis/travis-archlinux.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/.travis/travis-centos.sh b/.travis/travis-centos.sh index d9108f3dc..9db7a3981 100755 --- a/.travis/travis-centos.sh +++ b/.travis/travis-centos.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/.travis/travis-common.inc b/.travis/travis-common.inc index 58b29a3c4..5c0b27e15 100644 --- a/.travis/travis-common.inc +++ b/.travis/travis-common.inc @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -x diff --git a/.travis/travis-coverity.sh b/.travis/travis-coverity.sh index 263bb4438..68e27236c 100755 --- a/.travis/travis-coverity.sh +++ b/.travis/travis-coverity.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/.travis/travis-docs.sh b/.travis/travis-docs.sh index 48bb46713..61c56d6b9 100755 --- a/.travis/travis-docs.sh +++ b/.travis/travis-docs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/.travis/travis-fedora.sh b/.travis/travis-fedora.sh index aee28356c..252c414db 100755 --- a/.travis/travis-fedora.sh +++ b/.travis/travis-fedora.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/.travis/travis-mageia.sh b/.travis/travis-mageia.sh index 0a016c210..0549c2dd4 100755 --- a/.travis/travis-mageia.sh +++ b/.travis/travis-mageia.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/.travis/travis-openmandriva.sh b/.travis/travis-openmandriva.sh index 816d5ced9..54156c030 100755 --- a/.travis/travis-openmandriva.sh +++ b/.travis/travis-openmandriva.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $SCRIPT_DIR diff --git a/.travis/travis-opensuse.sh b/.travis/travis-opensuse.sh index 90b7f1b67..bd931c5e2 100755 --- a/.travis/travis-opensuse.sh +++ b/.travis/travis-opensuse.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd $SCRIPT_DIR diff --git a/run_ci_tests.sh b/run_ci_tests.sh index b6e93e6ce..0860b2bf5 100755 --- a/run_ci_tests.sh +++ b/run_ci_tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/setup_dev_container.sh b/setup_dev_container.sh index 7588c0594..13d2b0197 100755 --- a/setup_dev_container.sh +++ b/setup_dev_container.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$SOURCE_DIR/.travis" diff --git a/spec_tmpl.sh b/spec_tmpl.sh index f182b51b5..5e45848f7 100755 --- a/spec_tmpl.sh +++ b/spec_tmpl.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash function main { local template version release