fix up function style
The "function" keyword is superfluous, not in POSIX, is inconsistent
between bash files, and generally makes me angry. So convert every
instance to the form:
foo() {
BUG=None
TEST=`cbuildbot x86-generic-paladin` works
Change-Id: I97f5ca30a3edfef7222b1e08ac23917dc613b556
Reviewed-on: https://gerrit.chromium.org/gerrit/22467
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh
index 0d27870..5846dc1 100755
--- a/sdk_lib/enter_chroot.sh
+++ b/sdk_lib/enter_chroot.sh
@@ -57,7 +57,7 @@
"
# Version of info from common.sh that only echos if --verbose is set.
-function debug {
+debug() {
if [ $FLAGS_verbose -eq $FLAGS_TRUE ]; then
info "$*"
fi
@@ -96,11 +96,11 @@
MOUNTED_PATH=$(readlink -f "$FLAGS_chroot")
-function mount_queue_init {
+mount_queue_init() {
MOUNT_QUEUE=()
}
-function queue_mount {
+queue_mount() {
# If necessary, mount $source in the host FS at $target inside the
# chroot directory with $mount_args.
local source="$1"
@@ -123,7 +123,7 @@
esac
}
-function process_mounts {
+process_mounts() {
if [[ ${#MOUNT_QUEUE[@]} -eq 0 ]]; then
return 0
fi
@@ -131,7 +131,7 @@
mount_queue_init
}
-function env_sync_proc {
+env_sync_proc() {
# This function runs and performs periodic updates to the chroot env, if
# necessary.
@@ -161,7 +161,7 @@
done
}
-function copy_ssh_config {
+copy_ssh_config() {
# Copy user .ssh/config into the chroot filtering out strings not supported
# by the chroot ssh. The chroot .ssh directory is passed in as the first
# parameter.
@@ -195,13 +195,13 @@
sed "/^.*\(${filter}\).*$/d" "${sshc}" > "${chroot_ssh_dir}/config"
}
-function copy_into_chroot_if_exists {
+copy_into_chroot_if_exists() {
# $1 is file path outside of chroot to copy to path $2 inside chroot.
[ -e "$1" ] || return
cp "$1" "${FLAGS_chroot}/$2"
}
-function setup_env {
+setup_env() {
# Validate sudo timestamp before entering the critical section so that we
# don't stall for a password while we have the lockfile.
# Don't use sudo -v since that has issues on machines w/ no password.
@@ -455,7 +455,7 @@
) 200>>"$LOCKFILE" || die "setup_env failed"
}
-function teardown_env {
+teardown_env() {
# Validate sudo timestamp before entering the critical section so that we
# don't stall for a password while we have the lockfile.
# Don't use sudo -v since that has issues on machines w/ no password.