Re: [PATCH 1/2] flex 2.5.39

2015-11-20 Thread Serguey Parkhomovsky
On Thu, Nov 19, 2015 at 06:53:45PM -0500, Ted Unangst wrote:
> Serguey Parkhomovsky wrote:
> > * renamed parse.c, parse.h, scan.c, skel.c with init prefix so compiling
> >   flex outside of obj by accident wouldn't clobber the bootstrap files
> 
> Do you remember what caused you to skip using the in base yacc? The diff below
> seems to work for me.
> 

I skipped using the base yacc because flex would error out on compiling
itself. I'm not sure what was happening there, but I've tested your
patch and it works for me too.



Re: [PATCH 1/2] flex 2.5.39

2015-11-19 Thread Ted Unangst
Serguey Parkhomovsky wrote:
> * renamed parse.c, parse.h, scan.c, skel.c with init prefix so compiling
>   flex outside of obj by accident wouldn't clobber the bootstrap files

Do you remember what caused you to skip using the in base yacc? The diff below
seems to work for me.

Index: Makefile
===
RCS file: /cvs/src/usr.bin/lex/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- Makefile19 Nov 2015 23:46:55 -  1.14
+++ Makefile19 Nov 2015 23:52:40 -
@@ -18,7 +18,7 @@ SRCS= buf.c ccl.c dfa.c ecs.c filter.c g
  scanopt.c skel.c sym.c tables.c tables_shared.c \
  tblcmp.c yylex.c
 
-CLEANFILES+=skel.c parse.h
+CLEANFILES+=skel.c parse.c parse.h
 LDADD+=-lm
 
 MAN = flex.1
@@ -29,10 +29,8 @@ MLINKS= flex.1 lex.1 flex.1 flex++.1
 
 VERSION="2.5.39"
 
-# Our yacc is too old to compile parse.y; use bootstrapped parse.c instead
-parse.h parse.c: parse.y initparse.c initparse.h
-   cp ${.CURDIR}/initparse.c parse.c
-   cp ${.CURDIR}/initparse.h parse.h
+parse.h parse.c: parse.y
+   yacc -d -o parse.c ${.CURDIR}/parse.y
 
 skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
sed -e 's/m4_/m4postproc_/g' -e 's/m4preproc_/m4_/g' \



Re: [PATCH 1/2] flex 2.5.39

2015-11-11 Thread Ted Unangst
Serguey Parkhomovsky wrote:
> Hi tech@,
> 
> There was recent discussion in having a new version of flex in base, as
> our current version (2.5.4) is ancient. I have prepared a patch that
> will update it to 2.5.39, taking a few examples from NetBSD's and
> FreeBSD's flex.
> 
> The patch is organized as follows:
> 
> * [1/2] Flex 2.5.4 -> 2.5.39
> * [2/2] Minor changes to files that wouldn't compile with flex 2.5.39
> 
> This patch has a few changes from the upstream version of flex. They
> are:
> 
> * Removed autotools cruft/localization/texinfo manual/etc
> * Kept the old manpage, as the new manpage is content-free
> * Used safe string handling functions and fixed several compiler warnings
> * pledge(2). Flex 2.5.39 now forks/execs its filter chains and needs proc
>   exec in addition to what was previously pledged
> * Removed register keyword from all variable declarations
> * renamed parse.c, parse.h, scan.c, skel.c with init prefix so compiling
>   flex outside of obj by accident wouldn't clobber the bootstrap files
> * Minor fixes (spelling, accessing buf[strlen(buf) - 1] for zero-length 
>   strings in initscan.c/scan.l, etc) that were already in our tree

Thank you. It's also nice that some local changes were preserved.

I think the diff is too large to meticulosly review, but am of the opinion we
should just drop it in, hope for the best, and then pick at it in the tree as
necessary.

Hopefully development has slowed down to just updating the occasional
translation and we won't have to do this again.



Re: [PATCH 1/2] flex 2.5.39

2015-11-10 Thread Stuart Henderson
On 2015/11/09 08:38, Serguey Parkhomovsky wrote:
> On Sun, Nov 08, 2015 at 01:23:13PM +, Stuart Henderson wrote:
> > On 2015/11/08 11:47, Stuart Henderson wrote:
> > > I'll put this into a ports bulk build.
> 
> Thanks!

No major problems. Fixed 2, removed 1, the only remaining breakage is
x11/amiwm but that port seems to have bigger problems anyway (looks for
files at runtime in a directory where they don't exist). There's a newer
version of amiwm in FreeBSD ports which should be ok with the flex
update. As far as ports is concerned there's no problem with this.

> > Just noticed that it loses the MLINKS line that installs the
> > flex++(1) link.
> 
> Good catch; I've attached an updated diff with the correct MLINKS line.




Re: [PATCH 1/2] flex 2.5.39

2015-11-08 Thread Stuart Henderson
I'll put this into a ports bulk build.



Re: [PATCH 1/2] flex 2.5.39

2015-11-08 Thread Stuart Henderson
On 2015/11/08 11:47, Stuart Henderson wrote:
> I'll put this into a ports bulk build.
> 

Just noticed that it loses the MLINKS line that installs the
flex++(1) link.