Skip to content

Commit

Permalink
*.sh: use consistent indentation
Browse files Browse the repository at this point in the history
Almost all of the shell scripts in the repository use tabs for
indentation (or have no indentation at all):

    $ git grep -Il '^\t' -- '*.sh' | wc -l
    19
    $ git grep -Il '^ ' -- '*.sh' | wc -l
    5
    $ git grep -IL '^[ \t]' -- '*.sh' | wc -l
    25

So do the same in the few shell scripts that currently use spaces for
indentation.

Except for the following file:

* platform/rpm/mkrpm.sh

Not sure if it's following a packaging-specific scheme, so just fix the
one indentation inconsistency in it and otherwise leave it as is for
now.

Command used to search for shell scripts using spaces for indentation:

    $ git grep -In '^ ' -- '*.sh'
  • Loading branch information
kmk3 committed Feb 20, 2023
1 parent b406b24 commit 6648a1e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions contrib/gdb-firejail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ set -x
# setuid firejail process from the absolute beginning.

if [ -z "${1##*/firejail}" ]; then
FIREJAIL=$1
FIREJAIL=$1
else
# First argument is not named firejail, then add default unless environment
# variable already set.
set -- ${FIREJAIL:=$(command -v firejail)} "$@"
# First argument is not named firejail, then add default unless environment
# variable already set.
set -- ${FIREJAIL:=$(command -v firejail)} "$@"
fi

bash -c "kill -STOP \$\$; exec \"\$0\" \"\$@\"" "$@" &
Expand Down
34 changes: 17 additions & 17 deletions contrib/syscalls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ SYSCALLS_OUTPUT_FILE="$(pwd)/syscalls.txt"

if [ $# -eq 0 ]
then
echo
echo " *** No program specified!!! ***"
echo
echo -e "Make this file executable and execute it as:\\n"
echo -e "\\e[96m syscalls.sh /full/path/to/program\\n"
echo -e "\\e[39mif you saved this script in a directory in your PATH (e.g., in ${HOME}/bin), otherwise as:\\n"
echo -e "\\e[96m ./syscalls.sh /full/path/to/program\\n"
echo -e "\\e[39mUse the full path to the respective program to avoid executing it sandboxed with Firejail\\n(if a Firejail profile for it already exits and 'sudo firecfg' was executed earlier)\\nin order to determine the necessary system calls."
echo
exit 0
echo
echo " *** No program specified!!! ***"
echo
echo -e "Make this file executable and execute it as:\\n"
echo -e "\\e[96m syscalls.sh /full/path/to/program\\n"
echo -e "\\e[39mif you saved this script in a directory in your PATH (e.g., in ${HOME}/bin), otherwise as:\\n"
echo -e "\\e[96m ./syscalls.sh /full/path/to/program\\n"
echo -e "\\e[39mUse the full path to the respective program to avoid executing it sandboxed with Firejail\\n(if a Firejail profile for it already exits and 'sudo firecfg' was executed earlier)\\nin order to determine the necessary system calls."
echo
exit 0
else
strace -cfo "$STRACE_OUTPUT_FILE" "$@" && awk '{print $NF}' "$STRACE_OUTPUT_FILE" | sed '/syscall\|-\|total/d' | sort -u | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/' > "$SYSCALLS_OUTPUT_FILE"
echo
echo -e "\e[39mThese are the sorted syscalls:\n\e[93m"
cat "$SYSCALLS_OUTPUT_FILE"
echo
echo -e "\e[39mThe sorted syscalls were saved to:\n\e[96m$SYSCALLS_OUTPUT_FILE\n\e[39m"
exit 0
strace -cfo "$STRACE_OUTPUT_FILE" "$@" && awk '{print $NF}' "$STRACE_OUTPUT_FILE" | sed '/syscall\|-\|total/d' | sort -u | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/' > "$SYSCALLS_OUTPUT_FILE"
echo
echo -e "\e[39mThese are the sorted syscalls:\n\e[93m"
cat "$SYSCALLS_OUTPUT_FILE"
echo
echo -e "\e[39mThe sorted syscalls were saved to:\n\e[96m$SYSCALLS_OUTPUT_FILE\n\e[39m"
exit 0
fi
2 changes: 1 addition & 1 deletion platform/rpm/mkrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
tmpdir=$(mktemp -d)
mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
function cleanup {
rm -rf ${tmpdir}
rm -rf ${tmpdir}
}
trap cleanup EXIT

Expand Down

0 comments on commit 6648a1e

Please sign in to comment.