OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src openpkg-web          Date:   24-Jul-2003 10:32:11
  Branch: HEAD                             Handle: 2003072409321001

  Added files:
    openpkg-src/flex        flex.patch
  Modified files:
    openpkg-src/flex        flex.spec
    openpkg-web             news.txt

  Log:
    apply patch to get Flex beta version building on Solaris and similar
    platforms where std{in,out} cannot be used as an lvalue

  Summary:
    Revision    Changes     Path
    1.5         +39 -0      openpkg-src/flex/flex.patch
    1.58        +5  -1      openpkg-src/flex/flex.spec
    1.5781      +1  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/flex/flex.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.5 flex.patch
  --- /dev/null 2003-07-24 10:32:11.000000000 +0200
  +++ flex.patch        2003-07-24 10:32:11.000000000 +0200
  @@ -0,0 +1,39 @@
  +It is not portable to use "std{in,out}" as "lvalues" (for instance,
  +building under Sun Solaris breaks here). The portable solution is to use
  +freopen(3). Unfortunately, to achieve the same effect than fdopen(3) on
  +"std{in,out}", one has to use "/dev/std{in,out}" (which in turn is not
  +really portable, but at least more portable than using "std{in,out}"
  +as "lvalues"). The only "we know it better" alternative would be to
  +just replace the code with a fflush(3) on the streams and know that the
  +stream has not recognized the changed underlying filedescriptor. But
  +this again is not really portable, although also working for mostly all
  +Unix platforms.
  +
  +--- filter.c.orig    2003-03-25 17:39:08.000000000 +0100
  ++++ filter.c 2003-07-24 10:05:02.000000000 +0200
  +@@ -158,10 +158,10 @@
  +                     int     r;
  + 
  +                     /* setup streams again */
  +-                    if ((stdin = fdopen (0, "r")) == NULL)
  +-                            flexfatal (_("fdopen(0) failed"));
  +-                    if ((stdout = fdopen (1, "w")) == NULL)
  +-                            flexfatal (_("fdopen(1) failed"));
  ++                    if ((freopen ("/dev/stdin", "r", stdin)) == NULL)
  ++                            flexfatal (_("freopen(stdin) failed"));
  ++                    if ((freopen ("/dev/stdout", "w", stdout)) == NULL)
  ++                            flexfatal (_("freopen(stdout) failed"));
  + 
  +                     if ((r = chain->filter_func (chain)) == -1)
  +                             flexfatal (_("filter_func failed"));
  +@@ -181,8 +181,8 @@
  +     if (dup2 (pipes[1], 1) == -1)
  +             flexfatal (_("dup2(pipes[1],1)"));
  +     close (pipes[1]);
  +-    if ((stdout = fdopen (1, "w")) == NULL)
  +-            flexfatal (_("fdopen(1) failed"));
  ++    if ((freopen ("/dev/stdout", "w", stdout)) == NULL)
  ++            flexfatal (_("freopen(stdout) failed"));
  + 
  +     return true;
  + }
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/flex/flex.spec
  ============================================================================
  $ cvs diff -u -r1.57 -r1.58 flex.spec
  --- openpkg-src/flex/flex.spec        23 Jul 2003 19:09:37 -0000      1.57
  +++ openpkg-src/flex/flex.spec        24 Jul 2003 08:32:11 -0000      1.58
  @@ -38,7 +38,7 @@
   Group:        Language
   License:      BSD
   Version:      %{V_release}
  -Release:      20030723
  +Release:      20030724
   
   #   package options
   %option       with_beta  yes
  @@ -46,6 +46,7 @@
   #   list of sources
   Source0:      ftp://ftp.gnu.org/non-gnu/flex/flex-%{V_release}.tar.gz
   Source1:      http://osdn.dl.sourceforge.net/sourceforge/lex/flex-%{V_beta}.tar.gz
  +Patch0:       flex.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -69,6 +70,9 @@
       %setup0 -q -c -n flex-%{version}
   %if "%{with_beta}" == "yes"
       %setup1 -q -T -D -a 1
  +    ( cd flex-%{V_beta}
  +      %patch0 -p0
  +    ) || exit $?
   %endif
   
   %build
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.5780 -r1.5781 news.txt
  --- openpkg-web/news.txt      24 Jul 2003 08:27:45 -0000      1.5780
  +++ openpkg-web/news.txt      24 Jul 2003 08:32:10 -0000      1.5781
  @@ -1,3 +1,4 @@
  +24-Jul-2003: Upgraded package: P<flex-2.5.4a-20030724>
   24-Jul-2003: Upgraded package: P<delegate-8.5.7-20030724>
   24-Jul-2003: Upgraded package: P<ethereal-0.9.14-20030724>
   24-Jul-2003: Upgraded package: P<uvscan-4.1.6.4279-20030724>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to