Accepting request 557376 from devel:tools

OBS-URL: https://build.opensuse.org/request/show/557376
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/indent?expand=0&rev=20
This commit is contained in:
Dominique Leuenberger 2017-12-19 09:48:24 +00:00 committed by Git OBS Bridge
commit 5c05cc2b86
9 changed files with 31 additions and 164 deletions

View File

@ -1,85 +0,0 @@
--- 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;

View File

@ -1,11 +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;

View File

@ -1,4 +1,6 @@
--- src/output.c Index: src/output.c
===================================================================
--- src/output.c.orig
+++ src/output.c +++ src/output.c
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
@ -9,17 +11,3 @@
static BOOLEAN inhibited = 0; static BOOLEAN inhibited = 0;
static buf_break_st_ty * buf_break_list = NULL; 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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a9b41be5bfcab5d8c1be74204b10ae78789fc3deabea0775fdced8677292639
size 702667

View File

@ -1,7 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEABECAAYFAkmX5YMACgkQV4UaJNn8jXMKzwCg0mz1BvCS6WGbVJ0C97hjZNsp
SR8An0g84eSAFDkXCyJwoQbiaQwwgrgS
=z0xr
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Fri Dec 15 12:19:22 UTC 2017 - kstreitova@suse.com
- update to 2.2.11
* fixed Debian Bug report logs - #485764, Regression with
--blank-lines-after-declarations in 2.2.10
* fail instead of removing embedded NULLs in input files
* fixed handling of '...' range 'operator in C++ language
* fixed -nlps option.
- remove indent-2.2.10-nothing_is_void.diff that is no longer
needed
- remove indent-2.2.10-cdw.diff that is useless now
- refresh indent-2.2.10-warnings.diff
- re-enable parallel build
- ship COPYING NEWS README and ChangeLog files
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 23 15:15:13 UTC 2017 - kstreitova@suse.com Thu Mar 23 15:15:13 UTC 2017 - kstreitova@suse.com

View File

@ -1,30 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQGiBElSMsARBADZTJJDm8dR12eMorXmagsHQDkXZ88FjSnKVwlmBAf/gPNAaGhc
jxyV07ceTLBFh+rqVO5KTTIgsrxcuoZdA7wJceU1Wsy3czaqrouJAFtwTSlXNPr7
nT7IOoE3mygmjhmlNgkvO7SyJUzR/Aew8DXcvbw0SOtI+fR76W46K4yemwCg6NRN
JppoTpmLwHoRQQBNJwzG26UEAILVpr8dBZtkrZoKhqbnJtU4NbVmaxOq8998uEj6
rHNrKlYd0GOSQL8KBcqO60KABePOioHSyDalBQqs8eRE/4FZIBIW6TWD13TV2Ken
bwnryqn5d9UGf9FuQrhgbcYD4B6L53LriFmCRJouT6tRpYCsq5KCXikFEM4sX601
sg8eA/9ySAORRNqLx/QrtFkVU0cCcE3f6jtdImbRVQ1kAlGefO2Zqlp9Co4RdktJ
rVqlyeyYUazpznNQKUJh5XBIlueH0+bdFnafCKD/b0TCtmLeORmJSmXkut8nSq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vGicB4A==
=e6az
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -17,25 +17,25 @@
Name: indent Name: indent
Version: 2.2.10 Version: 2.2.11
Release: 0 Release: 0
Summary: Indent Formats C Source Code Summary: Indent Formats C Source Code
License: GPL-3.0+ License: GPL-3.0+
Group: Development/Languages/C and C++ Group: Development/Languages/C and C++
Url: http://www.gnu.org/software/indent Url: http://www.gnu.org/software/indent
Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz #Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
Source1: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz.sig #Source1: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz.sig
Source2: %{name}.keyring #Source2: %{name}.keyring
Patch0: indent-2.2.10-nothing_is_void.diff # Version 2.2.11 is not available at ftp.gnu.org as it has been developed outside the GNU project
# see https://lists.gnu.org/archive/html/bug-indent/2015-11/msg00004.html
Source0: http://debian.lagis.at/debian/pool/main/i/indent/indent_%{version}.orig.tar.gz
Patch1: indent-2.2.10-warnings.diff Patch1: indent-2.2.10-warnings.diff
Patch2: indent-2.2.10-lcall.diff Patch2: indent-2.2.10-lcall.diff
Patch3: indent-2.2.10-cdw.diff
Patch4: indent-2.2.10-man.diff Patch4: indent-2.2.10-man.diff
Patch5: indent-texi2html-5.0.patch Patch5: indent-texi2html-5.0.patch
BuildRequires: makeinfo BuildRequires: makeinfo
BuildRequires: texi2html BuildRequires: texi2html
Requires(pre): %{install_info_prereq} Requires(pre): %{install_info_prereq}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
Indent can be used to make code easier to read. It can also convert Indent can be used to make code easier to read. It can also convert
@ -45,17 +45,14 @@ incomplete and malformed syntax.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 %patch1
%patch2 %patch2
%patch3 -p1
%patch4 %patch4
%patch5 -p1 %patch5 -p1
%build %build
%configure %configure
# parallel builds are broken make %{?_smp_mflags}
make -j 1
%install %install
%make_install %make_install
@ -74,9 +71,8 @@ make %{?_smp_mflags} -C regression
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%files -f %{name}.lang %files -f %{name}.lang
%defattr(-, root, root)
%{_bindir}/* %{_bindir}/*
%doc doc/indent.html %doc COPYING NEWS README ChangeLog doc/indent.html
%{_infodir}/%{name}.info%{ext_info} %{_infodir}/%{name}.info%{ext_info}
%{_mandir}/man1/indent.1%{ext_man} %{_mandir}/man1/indent.1%{ext_man}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aaff60ce4d255efb985f0eb78cca4d1ad766c6e051666073050656b6753a0893
size 778563