diff options
author | Jean Delvare <jdelvare@suse.de> | 2014-02-28 10:52:22 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2014-02-28 10:52:22 +0100 |
commit | 72ae6ed73cc17ce6f6f0f0c4950453e1f881c039 (patch) | |
tree | 18a60a929f555ac3e29f5d21366b4949dc2fef42 | |
parent | ede7ccaf359f6b673b6f72af33c0645c62c1b237 (diff) | |
download | quilt-72ae6ed73cc17ce6f6f0f0c4950453e1f881c039.tar.gz |
Use consistent brace placement
Use the same brace placement for all bash functions through the whole
tree.
-rwxr-xr-x | bin/patch-wrapper.in | 6 | ||||
-rw-r--r-- | quilt/diff.in | 3 | ||||
-rw-r--r-- | quilt/grep.in | 9 | ||||
-rw-r--r-- | quilt/mail.in | 12 | ||||
-rw-r--r-- | quilt/push.in | 3 | ||||
-rw-r--r-- | quilt/scripts/backup-files.in | 9 | ||||
-rw-r--r-- | quilt/scripts/inspect.in | 33 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 12 | ||||
-rw-r--r-- | quilt/setup.in | 9 |
9 files changed, 64 insertions, 32 deletions
diff --git a/bin/patch-wrapper.in b/bin/patch-wrapper.in index 358856a..6cbdc31 100755 --- a/bin/patch-wrapper.in +++ b/bin/patch-wrapper.in @@ -26,7 +26,8 @@ then set -- --posix "$@" fi -backup_files() { +backup_files() +{ declare dir=${QUILT_PC:-.pc}/$patch if [ "$backup_mode" = --backup-if-mismatch ] @@ -64,7 +65,8 @@ backup_files() { fi } -find_pipe_patch() { +find_pipe_patch() +{ declare patch=$1 patch=${patch//\[/\\[} patch=${patch//\]/\\]} diff --git a/quilt/diff.in b/quilt/diff.in index 639d273..548cb94 100644 --- a/quilt/diff.in +++ b/quilt/diff.in @@ -79,7 +79,8 @@ included. fi } -colorize() { +colorize() +{ if [ -n "$opt_color" ] then sed -e ' diff --git a/quilt/grep.in b/quilt/grep.in index 0c32fcf..d6ff669 100644 --- a/quilt/grep.in +++ b/quilt/grep.in @@ -38,7 +38,8 @@ tree is searched. Please see the grep(1) manual page for options. fi } -get_options() { +get_options() +{ getopt -o EFGPe:f:iwxzsvVm:bHnhqoaId:D:RrlLcB:ZA:C:Uu \ --long extended-regexp,fixed-strings,basic-regexp,perl-regexp \ --long regexp:,file:,ignore-case,word-regexp \ @@ -53,13 +54,15 @@ get_options() { -- "$@" } -shift_myargs() { +shift_myargs() +{ set -- "${myargs[@]}" shift myargs=( "$@" ) } -shift_args() { +shift_args() +{ while true do case "${myargs[0]}" in diff --git a/quilt/mail.in b/quilt/mail.in index fae9e8e..d88bea7 100644 --- a/quilt/mail.in +++ b/quilt/mail.in @@ -84,7 +84,8 @@ msgid() # See RFC 2822 Internet Message Format for how the In-Reply-To and # References headers are generated... -in_reply_to_header() { +in_reply_to_header() +{ local message=$1 message_id message_id=$(formail -x Message-ID: < "$message") @@ -92,7 +93,8 @@ in_reply_to_header() { [ -n "$message_id" ] && echo "In-Reply-To: $message_id" } -references_header() { +references_header() +{ local message=$1 message_id references in_reply_to message_id=$(formail -x Message-ID: < "$message") @@ -152,7 +154,8 @@ process_mail() rm -f $tmpfile } -join_lines() { +join_lines() +{ awk ' BEGIN { RS="\n\n" } { gsub(/[ \t\n]+/, " ") @@ -321,7 +324,8 @@ fi if [ "$(type -t quilt_mail_patch_filter 2> /dev/null)" != function ] then - quilt_mail_patch_filter() { + quilt_mail_patch_filter() + { local tmpdir=$(gen_tempfile -d) cat > $tmpdir/patch patch_header < $tmpdir/patch > $tmpdir/header diff --git a/quilt/push.in b/quilt/push.in index 1035f03..fde9472 100644 --- a/quilt/push.in +++ b/quilt/push.in @@ -145,7 +145,8 @@ rollback_patch() $QUILT_DIR/scripts/backup-files $silent_unless_verbose -r -B "$QUILT_PC/$patch/" - } -cleanup_patch_output() { +cleanup_patch_output() +{ if [ -z "$opt_leave_rejects" ] then if [ -n "$opt_quiet" ]; then diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in index 07557e7..aec7cc5 100644 --- a/quilt/scripts/backup-files.in +++ b/quilt/scripts/backup-files.in @@ -22,7 +22,8 @@ exec 4> /dev/null # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301, USA. -usage () { +usage () +{ echo "Usage: $0 -B prefix {-b|-r|-c|-L} [-s] [-k] [-t] [-L] {-f {file|-}|-|file ...} Create or restore backup copies of a list of files. @@ -55,7 +56,8 @@ usage () { : ${QUILT_DIR=@QUILT_DIR@} . $QUILT_DIR/scripts/utilfns -ensure_nolinks() { +ensure_nolinks() +{ local filename=$1 local link_count tmpname @@ -78,7 +80,8 @@ notify_action() done < "$filename" } -backup() { +backup() +{ local file=$1 local backup=$OPT_PREFIX$file local dir diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in index 30b3590..bf8221e 100644 --- a/quilt/scripts/inspect.in +++ b/quilt/scripts/inspect.in @@ -16,7 +16,8 @@ fi . $QUILT_DIR/scripts/patchfns cd ${SUBDIR:-.} -usage() { +usage() +{ echo "Usage: ${0##*/} [--fuzz=N] specfile" exit 1 } @@ -143,7 +144,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper #! @BASH@ # find original data file by md5sum - original_file() { + original_file() + { local file=$1 md5sum set -- $(md5sum < $file) @@ -180,7 +182,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper } # Extract a command line option with or without argument - cmdline_option() { + cmdline_option() + { local letter=$1 no_arg=$2 shift @@ -200,24 +203,28 @@ cat <<-'EOF' > $tmpdir/bin/wrapper } # Extract the -p option from the command line - strip_option() { + strip_option() + { set -- $(cmdline_option p "$@") [ "$1" != -p1 ] && echo $1 } # Extract the -R option from the command line - reverse_option() { + reverse_option() + { set -- $(cmdline_option R no_arg "$@") echo $1 } - patch_opt_d() { + patch_opt_d() + { local subdir=$(cmdline_option d "$@") [ -z "$subdir" ] || echo "${subdir:2}" } - patch_input_file() { + patch_input_file() + { while [ $# -gt 0 ]; do case "$1" in -i|--input) @@ -240,7 +247,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper return 1 } - tar_input_file() { + tar_input_file() + { case "$1" in *C*f*) echo "$3" @@ -251,7 +259,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper esac } - unzip_input_file() { + unzip_input_file() + { while [ $# -gt 0 ]; do case "$1" in -*) @@ -266,7 +275,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper return 1 } - tar_opt_C() { + tar_opt_C() + { case "$1" in *C*f*) echo "$2" @@ -274,7 +284,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper esac } - pwd_to_dir() { + pwd_to_dir() + { local subdir=$1 dir if [ -n "$subdir" ] diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index 34e995e..b11b9cd 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -47,7 +47,8 @@ fi declare -a exit_handlers -add_exit_handler() { +add_exit_handler() +{ exit_handlers[${#exit_handlers[@]}]=$1 } @@ -911,7 +912,8 @@ next_filename() echo "${base%-$num}-$((num+1))${patch#$base}" } -create_db() { +create_db() +{ if ! [ -e $QUILT_PC ] then mkdir -p $QUILT_PC @@ -927,7 +929,8 @@ create_db() { fi } -version_check() { +version_check() +{ [ -e $QUILT_PC ] || return 0 if [ -e $QUILT_PC/.version ] @@ -945,7 +948,8 @@ version_check() { return 1 } -print_patch() { +print_patch() +{ echo -n "${QUILT_PATCHES_PREFIX:+$SUBDIR_DOWN$QUILT_PATCHES/}$1" } diff --git a/quilt/setup.in b/quilt/setup.in index 679a6fe..36d0d24 100644 --- a/quilt/setup.in +++ b/quilt/setup.in @@ -22,7 +22,8 @@ then fi fi -check_for_existing_directories() { +check_for_existing_directories() +{ local tag dir last_dir arg status=0 while read tag dir arg @@ -41,7 +42,8 @@ check_for_existing_directories() { return $status } -check_for_existing_files() { +check_for_existing_files() +{ local tag dir last_dir arg status=0 while read tag dir arg @@ -66,7 +68,8 @@ check_for_existing_files() { return $status } -create_symlink() { +create_symlink() +{ local target=$1 link=$2 up if [ "${target:0:1}" = / -o "${link:0:1}" = / ] then |