From 19bf7f269019666d5286f93db872c54246562f20e73e48945e9fdd6b2aa667fb Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 5 Aug 2008 23:43:20 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/indent?expand=0&rev=3 --- indent-2.2.10-cdw.diff | 85 ++++++++++++++++++++++++++++++ indent-2.2.10-lcall.diff | 11 ++++ indent-2.2.10-man.diff | 51 ++++++++++++++++++ indent-2.2.10-nothing_is_void.diff | 11 ++++ indent-2.2.10-warnings.diff | 25 +++++++++ indent-2.2.10.tar.bz2 | 3 ++ indent-2.2.9-nothing_is_void.diff | 33 ------------ indent-2.2.9-overflow.patch | 10 ---- indent-2.2.9-warnings.diff | 34 ------------ indent-2.2.9.tar.bz2 | 3 -- indent.changes | 11 ++++ indent.spec | 56 ++++++++++++++------ 12 files changed, 236 insertions(+), 97 deletions(-) create mode 100644 indent-2.2.10-cdw.diff create mode 100644 indent-2.2.10-lcall.diff create mode 100644 indent-2.2.10-man.diff create mode 100644 indent-2.2.10-nothing_is_void.diff create mode 100644 indent-2.2.10-warnings.diff create mode 100644 indent-2.2.10.tar.bz2 delete mode 100644 indent-2.2.9-nothing_is_void.diff delete mode 100644 indent-2.2.9-overflow.patch delete mode 100644 indent-2.2.9-warnings.diff delete mode 100644 indent-2.2.9.tar.bz2 diff --git a/indent-2.2.10-cdw.diff b/indent-2.2.10-cdw.diff new file mode 100644 index 0000000..8a8fed9 --- /dev/null +++ b/indent-2.2.10-cdw.diff @@ -0,0 +1,85 @@ +--- indent-2.2.10/src/indent.c ++++ indent-2.2.10/src/indent.c +@@ -1033,13 +1033,10 @@ + + if (!*sp_sw) + { /* if not if for (;;) */ +- do +- { + if (parse (semicolon) != total_success) + { + *file_exit_value = indent_error; + } +- } while(0); + + *force_nl = true; /* force newline after a end of stmt */ + } +@@ -2818,6 +2815,18 @@ + return file_exit_value; /* RETURN */ + } + ++ if (type_code == sp_paren ++ && parser_state_tos->p_stack[parser_state_tos->tos] == dohead ++ && parser_state_tos->last_token == rbrace) ++ { ++ /* This is closing `while' of `do {stuff;} while' ++ statement (not `do stuff; while' command). In -cdw, we ++ want to suppress newline. */ ++ if (settings.cuddle_do_while) ++ force_nl = false; ++ parser_state_tos->in_closing_br_while = true; ++ } ++ + if ((type_code != comment) && + (type_code != cplus_comment) && + (type_code != newline) && +--- indent-2.2.10/src/indent.h ++++ indent-2.2.10/src/indent.h +@@ -420,6 +420,9 @@ + BOOLEAN in_decl; /*!< set to true when we are in a declaration + * statement. The processing of braces is then + * slightly different */ ++ BOOLEAN in_closing_br_while; /*!< set to true when we are parsing ++ * closing while of do {} while ++ * statement*/ + int in_stmt; /*!< set to 1 while in a stmt */ + int in_parameter_declaration; + int ind_level; /*!< the current indentation level in spaces */ +--- indent-2.2.10/src/parse.c ++++ indent-2.2.10/src/parse.c +@@ -69,6 +69,7 @@ + parser_state_tos->cstk = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int)); + parser_state_tos->paren_indents_size = 8; + parser_state_tos->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short)); ++ parser_state_tos->in_closing_br_while = false; + + /* Although these are supposed to grow if we reach the end, + * I can find no place in the code which does this. */ +@@ -428,6 +429,14 @@ + + parser_state_tos->ind_level = parser_state_tos->i_l_follow; + parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow; ++ ++ if (parser_state_tos->in_closing_br_while ++ && settings.cuddle_do_while ++ && !settings.btype_2) ++ { ++ parser_state_tos->ind_level += settings.brace_indent; ++ } ++ parser_state_tos->in_closing_br_while = false; + } + else + { /* it is a while loop */ +@@ -457,6 +466,12 @@ + parser_state_tos->p_stack[parser_state_tos->tos] = elsehead; + /* remember if with else */ + parser_state_tos->search_brace = true; ++ ++ if (settings.cuddle_else ++ && !settings.btype_2) ++ { ++ parser_state_tos->ind_level += settings.brace_indent; ++ } + } + break; + diff --git a/indent-2.2.10-lcall.diff b/indent-2.2.10-lcall.diff new file mode 100644 index 0000000..ced6d9a --- /dev/null +++ b/indent-2.2.10-lcall.diff @@ -0,0 +1,11 @@ +--- src/indent.c ++++ src/indent.c +@@ -3290,7 +3290,7 @@ + exit_values_ty exit_status; + + #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) && defined (HAVE_LCCTYPES) +- setlocale(LC_MESSAGES, ""); ++ setlocale(LC_ALL, ""); + #endif + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); diff --git a/indent-2.2.10-man.diff b/indent-2.2.10-man.diff new file mode 100644 index 0000000..267b927 --- /dev/null +++ b/indent-2.2.10-man.diff @@ -0,0 +1,51 @@ +--- doc/indent.texinfo ++++ doc/indent.texinfo +@@ -776,7 +776,7 @@ + + @kindex -ce + @kindex --cuddle-else +-@kindex -dce ++@kindex -nce + @kindex --dont-cuddle-else + If you are using the @option{-br} option, you probably want to also use + the @option{-ce} option. This causes the @code{else} in an if-then-else +@@ -1805,6 +1805,11 @@ + Leave space between @samp{#} and preprocessor directive.@* + @xref{Indentation}. + ++@item -nlps ++@itemx --remove-preprocessor-space ++Remove space between @samp{#} and preprocessor directive.@* ++@xref{Indentation}. ++ + @item -nbad + @itemx --no-blank-lines-after-declarations + Do not force blank lines after declarations.@* +@@ -1977,6 +1982,11 @@ + Specify the indentation for preprocessor conditional statements. + @xref{Indentation}. + ++@item -ppi@var{n} ++@itemx --preprocessor-indentation@var{n} ++Request indentation of preprocessor conditional statements.@* ++@xref{Indentation}. ++ + @item -prs + @itemx --space-after-parentheses + Put a space after every '(' and before every ')'.@* +@@ -2138,6 +2148,7 @@ + \line{ --preprocessor-indentation \leaderfill -ppi@var{n}\ } + \line{ --preserve-mtime \leaderfill -pmt\ } + \line{ --procnames-start-lines \leaderfill -psl\ } ++\line{ --remove-preprocessor-space \leaderfill -nlps\ } + \line{ --space-after-cast \leaderfill -cs\ \ } + \line{ --space-after-for \leaderfill -saf\ } + \line{ --space-after-if \leaderfill -sai\ } +@@ -2229,6 +2240,7 @@ + --preserve-mtime -pmt + --preprocessor-indentation -ppi@var{n} + --procnames-start-lines -psl ++--remove-preprocessor-space -nlps + --space-after-cast -cs + --space-after-for -saf + --space-after-if -sai diff --git a/indent-2.2.10-nothing_is_void.diff b/indent-2.2.10-nothing_is_void.diff new file mode 100644 index 0000000..ab866c5 --- /dev/null +++ b/indent-2.2.10-nothing_is_void.diff @@ -0,0 +1,11 @@ +--- indent-2.2.9/man/texinfo2man.c ++++ indent-2.2.9/man/texinfo2man.c +@@ -162,7 +162,7 @@ + + static char value_updated[64], value_edition[64], value_version[64]; + +-process_texi (FILE * in) ++void process_texi (FILE * in) + { + char buf[1024]; + int in_block = 0; diff --git a/indent-2.2.10-warnings.diff b/indent-2.2.10-warnings.diff new file mode 100644 index 0000000..4446cbf --- /dev/null +++ b/indent-2.2.10-warnings.diff @@ -0,0 +1,25 @@ +--- src/output.c ++++ src/output.c +@@ -71,7 +71,7 @@ + + RCSTAG_CC ("$Id$"); + +-static FILE * output = NULL; ++ FILE * output = NULL; + static BOOLEAN inhibited = 0; + static buf_break_st_ty * buf_break_list = NULL; + +@@ -749,11 +749,11 @@ + + if (s[0] == '/' && (s[1] == '*' || s[1] == '/')) + { +- fprintf (output, "%.*s", e_lab - s, s); ++ fprintf (output, "%.*s", (int) (e_lab - s), s); + } + else + { +- fprintf (output, "/* %.*s */", e_lab - s, s); ++ fprintf (output, "/* %.*s */", (int) (e_lab - s), s); + } + + /* no need to update cur_col: the very next thing will diff --git a/indent-2.2.10.tar.bz2 b/indent-2.2.10.tar.bz2 new file mode 100644 index 0000000..f871537 --- /dev/null +++ b/indent-2.2.10.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37e60cae161071fb68739fffbe3e518d8a17dab4b0209d84e6ad1e5f4007394b +size 531877 diff --git a/indent-2.2.9-nothing_is_void.diff b/indent-2.2.9-nothing_is_void.diff deleted file mode 100644 index f80db5d..0000000 --- a/indent-2.2.9-nothing_is_void.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- indent-2.2.9/man/texinfo2man.c -+++ indent-2.2.9/man/texinfo2man.c -@@ -162,7 +162,7 @@ - - static char value_updated[64], value_edition[64], value_version[64]; - --process_texi (FILE * in) -+void process_texi (FILE * in) - { - char buf[1024]; - int in_block = 0; ---- indent-2.2.9/src/output.c -+++ indent-2.2.9/src/output.c -@@ -1206,7 +1206,7 @@ - } - } - --extern inhibit_indenting( -+extern void inhibit_indenting( - BOOLEAN flag) - { - inhibited = flag; ---- indent-2.2.9/src/output.h -+++ indent-2.2.9/src/output.h -@@ -47,7 +47,7 @@ - struct stat * file_stats, - const char * filename); - --extern inhibit_indenting( -+extern void inhibit_indenting( - BOOLEAN flag); - - diff --git a/indent-2.2.9-overflow.patch b/indent-2.2.9-overflow.patch deleted file mode 100644 index 73044a0..0000000 --- a/indent-2.2.9-overflow.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/indent.c 2002-10-28 21:00:56.000000000 +0100 -+++ src/indent.c 2004-03-04 19:55:14.000000000 +0100 -@@ -875,6 +875,7 @@ - * imply we are in a stmt */ - for (t_ptr = s_code; *t_ptr; ++t_ptr) - { -+ check_lab_size(); - *e_lab++ = *t_ptr; /* turn everything so far into a label */ - } - diff --git a/indent-2.2.9-warnings.diff b/indent-2.2.9-warnings.diff deleted file mode 100644 index 6454846..0000000 --- a/indent-2.2.9-warnings.diff +++ /dev/null @@ -1,34 +0,0 @@ ---- src/output.c -+++ src/output.c -@@ -15,6 +15,8 @@ - #include - #include - #include -+#include -+#include - - #include "indent.h" - #include "sys.h" -@@ -23,7 +25,7 @@ - - RCSTAG_CC ("$Id: output.c,v 1.5 2002/12/12 17:36:49 david Exp $"); - --static FILE * output = NULL; -+FILE * output = NULL; - static BOOLEAN inhibited = 0; - static buf_break_st_ty * buf_break_list = NULL; - -@@ -737,11 +739,11 @@ - - if (s[0] == '/' && (s[1] == '*' || s[1] == '/')) - { -- fprintf (output, "%.*s", e_lab - s, s); -+ fprintf (output, "%.*s", (int) (e_lab - s), s); - } - else - { -- fprintf (output, "/* %.*s */", e_lab - s, s); -+ fprintf (output, "/* %.*s */", (int) (e_lab - s), s); - } - - /* no need to update cur_col: the very next thing will diff --git a/indent-2.2.9.tar.bz2 b/indent-2.2.9.tar.bz2 deleted file mode 100644 index cdff81a..0000000 --- a/indent-2.2.9.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9c35b553ed67f186765645344788739cbaf01f3f69a0a9273fe5f9f5e6f5257 -size 497615 diff --git a/indent.changes b/indent.changes index f838a6c..8571fda 100644 --- a/indent.changes +++ b/indent.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Aug 5 12:09:45 CEST 2008 - prusnak@suse.cz + +- updated to 2.2.10 + * added --indent-label and --linux-style options to control + indentation of goto labels and supply a canned set of settings + that closely matches the preferred style for the linux kernel + * GPLv3 is used now +- removed obsoleted patches: + * overflow.patch (included in update) + ------------------------------------------------------------------- Sun Feb 24 18:10:35 CET 2008 - crrodriguez@suse.de diff --git a/indent.spec b/indent.spec index 7b95a49..7bba98f 100644 --- a/indent.spec +++ b/indent.spec @@ -1,10 +1,17 @@ # -# spec file for package indent (Version 2.2.9) +# spec file for package indent (Version 2.2.10) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. -# This file and all modifications and additions to the pristine -# package are under the same license as the package itself. # +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -12,15 +19,17 @@ Name: indent -License: GPL v2 or later +License: GPL v3 or later Group: Development/Languages/C and C++ AutoReqProv: on -Version: 2.2.9 -Release: 288 +Version: 2.2.10 +Release: 1 Source: %{name}-%{version}.tar.bz2 -Patch: %{name}-%{version}-overflow.patch -Patch1: %{name}-%{version}-nothing_is_void.diff -Patch2: %{name}-%{version}-warnings.diff +Patch0: %{name}-%{version}-nothing_is_void.diff +Patch1: %{name}-%{version}-warnings.diff +Patch2: %{name}-%{version}-lcall.diff +Patch3: %{name}-%{version}-cdw.diff +Patch4: %{name}-%{version}-man.diff Url: ftp://ftp.gnu.org/pub/gnu/indent/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: Indent Formats C Source Code @@ -36,24 +45,29 @@ incomplete and malformed syntax. %prep %setup -q -%patch -%patch1 -p1 +%patch0 -p1 +%patch1 %patch2 +%patch3 -p1 +%patch4 %build -export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %configure --with-pic +# Parallel make doesn't work make %install -make DESTDIR=$RPM_BUILD_ROOT/ install +make DESTDIR=$RPM_BUILD_ROOT install # indent.html is installed with %doc below -rm $RPM_BUILD_ROOT/usr/doc/indent/indent.html -rm $RPM_BUILD_ROOT/usr/bin/texinfo2man -mv $RPM_BUILD_ROOT/usr/share/locale/zh_TW.Big5 \ - $RPM_BUILD_ROOT/usr/share/locale/zh_TW +rm -f $RPM_BUILD_ROOT/usr/doc/indent/indent.html $RPM_BUILD_ROOT%{_bindir}/texinfo2man $RPM_BUILD_ROOT/%{_infodir}/dir +mv $RPM_BUILD_ROOT%{_datadir}/locale/zh_TW.Big5 $RPM_BUILD_ROOT%{_datadir}/locale/zh_TW %find_lang %{name} +%check +echo =============== TEST BEGIN =============== +make -C regression +echo =============== TEST END =============== + %clean rm -rf $RPM_BUILD_ROOT @@ -71,6 +85,14 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/indent.1.gz %changelog +* Tue Aug 05 2008 prusnak@suse.cz +- updated to 2.2.10 + * added --indent-label and --linux-style options to control + indentation of goto labels and supply a canned set of settings + that closely matches the preferred style for the linux kernel + * GPLv3 is used now +- removed obsoleted patches: + * overflow.patch (included in update) * Sun Feb 24 2008 crrodriguez@suse.de - use find_lang macro * Wed Jan 25 2006 mls@suse.de