Skip to content

Commit

Permalink
Fix shell location / finding
Browse files Browse the repository at this point in the history
POSIX says a bourne shell is available in `/bin/sh`.  For any other
command, `/usr/bin/env` can be used to locate the binary in $PATH.

Fix all scripts to use `/bin/sh` when applicable, and rely on
`/usr/bin/env` to locate `bash` when necessary.
  • Loading branch information
smortex committed Sep 19, 2017
1 parent 0412468 commit 65a838d
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion autogen.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Run this to generate all the initial makefiles, etc.

usage() {
Expand Down
2 changes: 1 addition & 1 deletion src/try
@@ -1,4 +1,4 @@
#! /bin/bash
#!/usr/bin/env bash

topdir=$(cd $(dirname $0)/.. && pwd)
export AUGEAS_LENS_LIB=${topdir}/lenses
Expand Down
2 changes: 1 addition & 1 deletion tests/test-augtool-empty-line.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test for BZ 566844. Make sure we don't spew nonsense when the input
# contains empty lines
Expand Down
2 changes: 1 addition & 1 deletion tests/test-augtool-modify-root.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Make sure changing the value of root works

Expand Down
2 changes: 1 addition & 1 deletion tests/test-augtool.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

TOP_DIR=$(cd $(dirname $0)/.. && pwd)
TOP_BUILDDIR="$abs_top_builddir"
Expand Down
2 changes: 1 addition & 1 deletion tests/test-bug-1.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test for bug https://fedorahosted.org/augeas/ticket/1
#
Expand Down
2 changes: 1 addition & 1 deletion tests/test-events-saved.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Check that saving preserves mode and ownership; for this test to make
# much sense (if any) the user running it should have at least one
Expand Down
2 changes: 1 addition & 1 deletion tests/test-get.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Check that reading the files in tests/root/ with augtool does not lead to
# any errors
Expand Down
2 changes: 1 addition & 1 deletion tests/test-idempotent.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test that saving changes that don't really change the underlying file
# leave the original file intact
Expand Down
2 changes: 1 addition & 1 deletion tests/test-interpreter.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Run test modules that make sure the interpreter fails/succeeds in
# various hairy situations.
Expand Down
4 changes: 2 additions & 2 deletions tests/test-nonwritable.sh
@@ -1,10 +1,10 @@
#! /bin/bash
#!/bin/sh

# Test that an attempt to save into a non-writable file does not leave a
# temporary file behind.
# See https://github.com/hercules-team/augeas/issues/479

if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
if [ "$UID" != 0 -o "$(uname -s)" != "Linux" ]; then
echo "Test can only be run as root on Linux as it uses chattr"
exit 77
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/test-preserve.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Check that saving preserves mode and ownership; for this test to make
# much sense (if any) the user running it should have at least one
Expand Down
4 changes: 2 additions & 2 deletions tests/test-put-mount-augnew.sh
@@ -1,11 +1,11 @@
#! /bin/bash
#!/bin/sh

# Test that we can write into a bind mount placed at PATH.augnew with the
# copy_if_rename_fails flag.
# This requires that EXDEV or EBUSY is returned from rename(2) to activate the
# code path, so set up a bind mount on Linux.

if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
if [ "$UID" != 0 -o "$(uname -s)" != "Linux" ]; then
echo "Test can only be run as root on Linux to create bind mounts"
exit 77
fi
Expand Down
4 changes: 2 additions & 2 deletions tests/test-put-mount-augsave.sh
@@ -1,10 +1,10 @@
#! /bin/bash
#!/bin/sh

# Test that we don't follow bind mounts when writing to .augsave.
# This requires that EXDEV or EBUSY is returned from rename(2) to activate the
# code path, so set up a bind mount on Linux.

if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
if [ "$UID" != 0 -o "$(uname -s)" != "Linux" ]; then
echo "Test can only be run as root on Linux to create bind mounts"
exit 77
fi
Expand Down
4 changes: 2 additions & 2 deletions tests/test-put-mount.sh
@@ -1,10 +1,10 @@
#! /bin/bash
#!/bin/sh

# Test that we can write into a bind mount with the copy_if_rename_fails flag.
# This requires that EXDEV or EBUSY is returned from rename(2) to activate the
# code path, so set up a bind mount on Linux.

if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
if [ "$UID" != 0 -o "$(uname -s)" != "Linux" ]; then
echo "Test can only be run as root on Linux to create bind mounts"
exit 77
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/test-put-symlink-augnew.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test that we don't follow symlinks when writing to .augnew

Expand Down
2 changes: 1 addition & 1 deletion tests/test-put-symlink-augsave.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test that we don't follow .augsave symlinks

Expand Down
2 changes: 1 addition & 1 deletion tests/test-put-symlink-augtemp.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test that we don't follow .augnew symlinks (regression test)

Expand Down
2 changes: 1 addition & 1 deletion tests/test-put-symlink.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test that we correctly preserve symlinks when saving a file

Expand Down
2 changes: 1 addition & 1 deletion tests/test-save-empty.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test that we report an error when writing to nonexistant dirs
# but that we do create new files correctly
Expand Down
2 changes: 1 addition & 1 deletion tests/test-save-mode.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Test manipulating the save flags in /augeas/save

Expand Down
2 changes: 1 addition & 1 deletion tests/test-unlink-error.sh
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/sh

# Make sure we don't delete files simply because there was an error reading
# them in
Expand Down
6 changes: 3 additions & 3 deletions tests/test-valgrind.sh
@@ -1,11 +1,11 @@
#! /bin/bash
#!/bin/sh

# Run the tests in lenses/tests through valgrind and report which ones leak
set -e

TOPDIR=$(cd $(dirname $0)/.. && pwd)
[[ -n "$top_builddir" ]] || top_builddir=$TOPDIR
[[ -n "$top_srcdir" ]] || top_srcdir=$TOPDIR
[ -n "$top_builddir" ] || top_builddir=$TOPDIR
[ -n "$top_srcdir" ] || top_srcdir=$TOPDIR


AUGPARSE="libtool --mode=execute valgrind -q --leak-check=full ${top_builddir}/src/augparse"
Expand Down

0 comments on commit 65a838d

Please sign in to comment.