From e70fb560f77563f78029bd2859781047ea291396 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Sat, 28 Jan 2012 12:12:08 +1000 Subject: [PATCH] Whitespace cleanup in contrib Signed-off-by: Steve Youngs --- contrib/do_builds.sh | 19 ++++---- contrib/git-post-receive-hook.sample | 8 ++-- contrib/git-to-steve.sh | 4 +- contrib/make-pkg.sh | 4 +- contrib/report-build-failure.sh | 16 +++---- contrib/tar-build-failure.sh | 4 +- contrib/tty-colors.c | 70 ++++++++++++++-------------- 7 files changed, 62 insertions(+), 63 deletions(-) diff --git a/contrib/do_builds.sh b/contrib/do_builds.sh index ef4d2c5..4e82ab0 100755 --- a/contrib/do_builds.sh +++ b/contrib/do_builds.sh @@ -3,8 +3,8 @@ # A script to do automatic builds with several different configurations # # (C) 2008 Nelson Ferreira -# -# +# +# # This program is free software; you can redistribute it and/or modify it # under a BSD-like licence. # @@ -64,7 +64,7 @@ MAKE_TAGS="" # Yes or Y REMOVE_ON_SUCCESS="" # -# Report the build status with an email? +# Report the build status with an email? # Yes or Y (All) # Failures or F (Failures only) # Success or S (Successes only) @@ -96,7 +96,7 @@ fi STATUS="" if [ -n "${AUTOGEN}" ]; then CURDIR="$(pwd)" - cd "${SOURCE}" + cd "${SOURCE}" PREFIX=$(pwd) if [ -n "${HAMMER}" ]; then echo HAMMER: ${HAMMER} @@ -112,7 +112,7 @@ if [ -n "${BUILD_TAGS}" ]; then # Let's build ourselfs the tags for this source tree, mkdir -p ./++TAGS CURDIR="$(pwd)" - cd ./++TAGS + cd ./++TAGS eval "${PREFIX}/configure" || STATUS="FAIL_CONFIGURE_$?" if [ -z "${STATUS}" ]; then make tags || STATUS="FAIL_TAGS_$?" @@ -137,19 +137,19 @@ for f in *.conf; do fi mkdir -p "./${build_name}" CURDIR="$(pwd)" - cd "./${build_name}" + cd "./${build_name}" eval "${PREFIX}/configure ${CONF_OPTS}" || STATUS="FAIL_CONFIGURE_$?" if [ "${STATUS}" = "FAIL_CONFIGURE_127" -a -f "./Installation" -a -f "./config.log" ]; then if [ $(tail -1 ./config.log) = "configure: exit 0" ]; then STATUS="FAIL_CONFIGURE_0" - fi + fi fi if [ -z "${STATUS}" -o "${STATUS}" = "FAIL_CONFIGURE_0" ]; then STATUS="Success" make ${MAKE_ARGS} || STATUS="FAIL_MAKE_$?" if [ "${STATUS}" = "FAIL_MAKE_0" ]; then STATUS="Success" - fi + fi if egrep '^make.*:.*Error' ,,beta.out; then STATUS="${STATUS}_ERROR_IN_BUILD" else @@ -184,7 +184,7 @@ for f in *.conf; do CLI="${CLI} -eval '(setq build-rpt-email \"${MAIL_SUCCESS_TO}\")'" fi CLI="${CLI} -eval '(if (send-build-rpt \"${STATUS}\") (kill-emacs 0) (kill-emacs 1))'" - eval "src/sxemacs -batch ${CLI}" || DO_REPORT_FAILURE="YES" STATUS="${STATUS}-Build-Rpt-Failed-$?" + eval "src/sxemacs -batch ${CLI}" || DO_REPORT_FAILURE="YES" STATUS="${STATUS}-Build-Rpt-Failed-$?" else DO_REPORT_FAILURE="YES" fi @@ -200,4 +200,3 @@ for f in *.conf; do fi do_log "Finished building ${build_name}: ${STATUS}" done - diff --git a/contrib/git-post-receive-hook.sample b/contrib/git-post-receive-hook.sample index 4be5840..cef2077 100644 --- a/contrib/git-post-receive-hook.sample +++ b/contrib/git-post-receive-hook.sample @@ -3,8 +3,8 @@ # An example hook script for the "post-receive" event. # # (C) 2012 Nelson Ferreira -# -# +# +# # This program is free software; you can redistribute it and/or modify it # under a BSD-like licence. # @@ -32,7 +32,7 @@ # POSSIBILITY OF SUCH DAMAGE. # # -------- -# +# # You might need to adjust the GIT_CONTRIB_HOOKS location. # Recent versions of git will have post-receive-email. # Check at http://git-scm.org for the latest version @@ -51,6 +51,6 @@ read oldrev newrev refname if [ "$refname" = "refs/heads/for-steve" ]; then diff=$(git diff ${oldrev}..${newrev} | head -1) if [ -n "$diff" ]; then - echo "$oldrev $newrev $refname" | . ${GIT_CONTRIB_HOOKS}/post-receive-email + echo "$oldrev $newrev $refname" | . ${GIT_CONTRIB_HOOKS}/post-receive-email fi fi diff --git a/contrib/git-to-steve.sh b/contrib/git-to-steve.sh index 7e59376..fbc4c21 100755 --- a/contrib/git-to-steve.sh +++ b/contrib/git-to-steve.sh @@ -3,7 +3,7 @@ # A script to setup your git area to contribute back to SXEmacs # # (C) 2008 Nelson Ferreira -# +# # This program is free software; you can redistribute it and/or modify it # under a BSD-like licence. # @@ -29,7 +29,7 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -# +# USER_EMAIL=$(git config user.email) if [ -z "$USER_EMAIL" ]; then echo "You need to setup your email address with:" diff --git a/contrib/make-pkg.sh b/contrib/make-pkg.sh index 7f1fc36..e7615e8 100755 --- a/contrib/make-pkg.sh +++ b/contrib/make-pkg.sh @@ -1,7 +1,7 @@ #!/bin/sh # # (C) 2008 Nelson Ferreira -# +# # This program is free software; you can redistribute it and/or modify it # under a BSD-like licence. # @@ -89,4 +89,4 @@ tar --create --owner=0 --group=0 --gzip --file "${DEST}" "${BASE}" md5sum "${DEST}" > "${DEST}.md5" /bin/rm -rf "${BASE}" cd "$CURDIR" -echo "Done" \ No newline at end of file +echo "Done" diff --git a/contrib/report-build-failure.sh b/contrib/report-build-failure.sh index ff126a4..749156b 100755 --- a/contrib/report-build-failure.sh +++ b/contrib/report-build-failure.sh @@ -1,11 +1,11 @@ #!/bin/sh # -# Send email to sxemacs-builds list about build failure. +# Send email to sxemacs-builds list about build failure. # NOTE: At the time of last change, you HAVE to be a subscriber for # your email to actually be delivered to the list # # (C) 2008 Nelson Ferreira -# +# # This program is free software; you can redistribute it and/or modify it # under a BSD-like licence. # @@ -208,14 +208,14 @@ if [ -n "${MSRCDIR}" -a -d "${MSRCDIR}/{arch}" -a -n "${TLA}" -a -n "${GREP}" cd "${MSRCDIR}" TREE="$(${TLA} tree-version)" PATCH="$(${TLA} revisions | ${TAIL} -1)" - echo "Tree : ${TREE}" - echo "Patch: ${PATCH}" + echo "Tree : ${TREE}" + echo "Patch: ${PATCH}" echo "" LAST_MAIN="$(${TLA} log-versions | ${GREP} -- '--main--' | ${TAIL} -1)" LAST_MAIN_PATCH="$(${TLA} revisions $LAST_MAIN | ${TAIL} -1)" if [ "${TREE}" != "${LAST_MAIN}" -o "${PATCH}" != "${LAST_MAIN_PATCH}" ]; then - echo "Main : $LAST_MAIN" - echo "Patch: $LAST_MAIN_PATCH" + echo "Main : $LAST_MAIN" + echo "Patch: $LAST_MAIN_PATCH" echo "" fi DIFF_NAME=/tmp/tla-changes-${USER}-$$-${attachment}.log @@ -237,7 +237,7 @@ echo "" if [ -n "${SRCDIR}" ]; then echo " Source in ${SRCDIR}" fi -if [ -n "${BLDDIR}" -a "${SRCDIR}" != "${BLDDIR}" ]; then +if [ -n "${BLDDIR}" -a "${SRCDIR}" != "${BLDDIR}" ]; then echo " Build in ${BLDDIR}" fi @@ -258,7 +258,7 @@ for f in beta make-all make-check-temacs make-check make-install; do if [ -f "./,,${f}.out" ]; then echo "> Contents of $(pwd)/,,${f}.out" echo "" - ${GREP} "$KREGEXP" ./,,${f}.out | ${GREP} -v "$RREGEXP" + ${GREP} "$KREGEXP" ./,,${f}.out | ${GREP} -v "$RREGEXP" fi done diff --git a/contrib/tar-build-failure.sh b/contrib/tar-build-failure.sh index 45e71d8..061de3c 100755 --- a/contrib/tar-build-failure.sh +++ b/contrib/tar-build-failure.sh @@ -3,7 +3,7 @@ # Build a tar of valuable information to figure out why the build failed. # # (C) 2008 Nelson Ferreira -# +# # This program is free software; you can redistribute it and/or modify it # under a BSD-like licence. # @@ -29,7 +29,7 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -# +# type tar >/dev/null 2>&1 && TAR=tar EXT=gz type gzip >/dev/null 2>&1 && COMPRESS=gzip diff --git a/contrib/tty-colors.c b/contrib/tty-colors.c index 54a6a6f..295d321 100644 --- a/contrib/tty-colors.c +++ b/contrib/tty-colors.c @@ -1,10 +1,10 @@ /* Visually check 256 color capability of terminal * * (C) 2008 Nelson Ferreira - * + * * This program is free software; you can redistribute it and/or modify it * under a BSD-like licence. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this @@ -45,20 +45,20 @@ static char term_buffer[8192]; /* * For the capabilities */ -char *setfore = NULL, - *setback = NULL, - *resetcolor = NULL, - *standstr = NULL, +char *setfore = NULL, + *setback = NULL, + *resetcolor = NULL, + *standstr = NULL, *exit_stand = NULL, - *inicolor_str = NULL, + *inicolor_str = NULL, *clrnames = NULL, - *bold = NULL, + *bold = NULL, *dim = NULL, *reverse = NULL, *blinking = NULL, - *exit_attr = NULL, + *exit_attr = NULL, *opair = NULL; - + int maxcolors = 0, maxpairs = 0, do_force_16 = 0; @@ -94,7 +94,7 @@ void init_terminal_data () /******************* * Print a band with background of all available colors */ -void colormap( int do_boldstand ) +void colormap( int do_boldstand ) { int back; for( back = 0; back < maxcolors; back++ ) { @@ -134,13 +134,13 @@ void colormap( int do_boldstand ) /********************* - * Print a table with all the fore and background + * Print a table with all the fore and background * color combinations, with bold and optionally standout */ -void combinations_of_colors(int do_standout, int do_boldstand) +void combinations_of_colors(int do_standout, int do_boldstand) { int fore, back; - for( fore = 0; fore < maxcolors; fore ++ ) + for( fore = 0; fore < maxcolors; fore ++ ) for( back = 0; back < maxcolors; back ++ ) { char *strF, *strB; char *sstrF, *sstrB; @@ -160,11 +160,11 @@ void combinations_of_colors(int do_standout, int do_boldstand) printf( "\n" ); } printf( "\n" ); - + } -/** Query and assign a capability +/** Query and assign a capability */ void capability(char**buf,char*code,char**var,char*message) { @@ -196,7 +196,7 @@ void get_capabilities() if (maxpairs <= 0 ) { printf("I am sorry, your terminal does not have the max color pairs information\n"); } - + capability(&buf,"AF",&setfore, "I am sorry, your terminal does not have the set foreground color string in the capabilities"); capability(&buf,"AB",&setback, @@ -234,14 +234,14 @@ void query_rgb() int i, fd=fileno(stdin); long mode; struct termios ts; - - if ( ! isatty(fd) || ! isatty(fileno(stdout)) ) + + if ( ! isatty(fd) || ! isatty(fileno(stdout)) ) printf("Sorry, but stdin and/or stdout is not the terminal tty so I cannot query it\n"); else { - if ( ! inicolor_str ) + if ( ! inicolor_str ) printf("According to your terminal info this terminal rgb query will hang. Press ^C to abort the query.\n"); - /* + /* * We need to do the equivalent of cbreak() */ tcgetattr(fd,&ts); @@ -252,14 +252,14 @@ void query_rgb() /* Ask for the colors */ for ( i = 0 ; 1 ; i ++ ) { - char buffer[1000], - *buf=buffer, + char buffer[1000], + *buf=buffer, *end=buffer+sizeof(buffer)-1; int interrupted = 0; - + /* This is a string retrieved from Noah * Friedmans xterm-frobs.el. I could not find - * any termcap entry that verifies it + * any termcap entry that verifies it */ printf("\e]4;%d;?;\e\\",i); fflush(stdout); @@ -268,7 +268,7 @@ void query_rgb() fd_set fdsr, fdse,fdsw; int fds; struct timeval t; - + t.tv_sec = 0; t.tv_usec = 100000; /* 100ms */ @@ -288,14 +288,14 @@ void query_rgb() } read(fd,buf,1); if ( *buf == '\\') { - /* The response sequence ends with the only "\" + /* The response sequence ends with the only "\" of the response */ break; } if ( *buf == '' ) { - /* - If the terminal did not reply, chances are + /* + If the terminal did not reply, chances are this is not supported and the user used ^C */ interrupted=1; @@ -359,15 +359,15 @@ void force_ansi() int main( int argc, char *argv[] ) { - int do_colormap = 0, - do_combinations = 0, - do_standout = 0, + int do_colormap = 0, + do_combinations = 0, + do_standout = 0, do_boldstand = 0, do_query = 0; { /* Process arguments */ int i; - + for( i = 1; i < argc; i++ ) { if( ! strcmp(argv[i],"-m") ) do_colormap = 1; @@ -410,8 +410,8 @@ main( int argc, char *argv[] ) if ( inicolor_str ) printf("To init color : ^[%s\n", inicolor_str+1); if ( clrnames ) printf("To color names : ^[%s\n", clrnames+1); if ( opair ) printf("To original pairs: ^[%s\n", opair+1); - - + + /* * Let's try the ANSI defaults -- 2.34.1