lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev HP-UX sed Problem Solution


From: pg
Subject: Re: lynx-dev HP-UX sed Problem Solution
Date: Sun, 27 Dec 1998 10:22:09 -0700 (MST)

In a recent note, address@hidden said:

> Date: Wed, 23 Dec 1998 13:02:52 -0500 (EST)
> 
> > > I did look at it - but it uses functions, which puts it outside the 
> > > porting 
> > > limits.  (Maybe if restructured, but I haven't done that). 
> >  
> > 1) Replicate the function code in the merely two places it's called. 
> I didn't really want to - since it's a lot of text to keep in sync.
>   
> > 2) Make the function a separate script. 
> 
> ok (it's only called at one point, so repeating it won't be costly).
>   
Well, I took the easy route and went with (1).

-- gil
================================================================
%%% Created Wed Dec 23 15:32:58 MST 1998 by target lynx.patch. %%%
diff -brc orig/lynx2-8-2/cfg_defs.sh lynx2-8-2/cfg_defs.sh
*** orig/lynx2-8-2/cfg_defs.sh  Wed Dec 23 15:05:51 1998
--- lynx2-8-2/cfg_defs.sh       Wed Dec 23 15:12:01 1998
***************
*** 12,46 ****
  } config_cache[] = {
  EOF
  
! # Empirical test for format of config.cache.
! #     I'd welcome a better touchstone.
! # Ideally, "configure" should generate a uniform format config.cache.
! #     -- gil
! case `grep '^ac_cv_func_' config.cache | head -1` in
! 
!     # `set' quotes correctly as required by POSIX, so do not add quotes.
!   *{*'="'* )
!  sed \
        -e '/^#/d'     \
!       -e 's/^.[^=]*_cv_/      { "/' \
!       -e 's/=\${.*=/", /'           \
!       -e 's/}$/ },/'        \
!       config.cache | sort
!   ;;
!     # `set' does not quote correctly, so add quotes
!     #     ( cf. configure script's building config.cache )
!    * )
! sed   -e '/^#/d' \
!       -e 's/"/\\"/g' \
!       -e 's/=}$/=""}/' \
!       -e "s/'/\"/g" \
!       -e 's/^.[^=]*_cv_/      { "/' \
!       -e 's/=${[^=]*="/", "/' \
!       -e 's/=${[^=]*=/", "/' \
!       -e 's/"}$/}/' \
!       -e 's/}$/" },/' \
!       config.cache | sort
!   ;; esac
  
  cat <<EOF
  };
--- 12,38 ----
  } config_cache[] = {
  EOF
  
! sed \
        -e '/^#/d'     \
!       -e 's/^.[^=]*_cv_//' \
!       -e 's/=\${.*=/=/'  \
!       -e 's/}$//'          \
!       config.cache | { ########## QuoteIt()
!     # Strip leading and trailing whitespace
!     # Escape any iternal '\'
!     # Escape any iternal '"'
!     # Entify any iternal '&', '<' or '>'
!     # Append a '=' if none present'
!     # Break into two strings at '='
!     # Prefix ' { "' and suffix '" },'
!     sort |
!     sed -e 's!^[      ]*!!' -e 's![   ]*$!!' \
!         -e 's!\\!\\\\!g'        \
!       -e 's!"!\\"!g'          \
!       -e 's!&!\&amp;!g' -e 's!<!\&lt;!g' -e 's!>!\&gt;!g' \
!       -e 's!^[^=]*$!&=!' \
!       -e 's!=!",      "!'     \
!       -e 's!^!        { "!' -e 's!$!" },!';  }
  
  cat <<EOF
  };
***************
*** 50,65 ****
        CONST char *value;
  } config_defines[] = {
  EOF
! fgrep '#define' lynx_cfg.h |sort |
  sed   -e 's@  @ @g' \
        -e 's@  @ @g' \
!       -e 'address@hidden ]*#define @@' \
        -e 'address@hidden ]*/\*.*\*/@@' \
!       -e 's@"$@@' \
!       -e 's@"@@' \
!       -e 's@ @", "@' \
!       -e 'address@hidden@     { "@' \
!       -e 'address@hidden@" },@'
  cat <<EOF
  };
  
--- 42,63 ----
        CONST char *value;
  } config_defines[] = {
  EOF
! fgrep '#define' lynx_cfg.h |
  sed   -e 's@  @ @g' \
        -e 's@  @ @g' \
!       -e 'address@hidden      ]*#define[      ]*@@' \
        -e 'address@hidden ]*/\*.*\*/@@' \
!       -e 'address@hidden      ][      address@hidden@' \
!     | { ########## QuoteIt()
!         ########## Comments and code same as above -- keep in sync!
!     sort |
!     sed -e 's!^[      ]*!!' -e 's![   ]*$!!' \
!         -e 's!\\!\\\\!g'        \
!       -e 's!"!\\"!g'          \
!       -e 's!&!\&amp;!g' -e 's!<!\&lt;!g' -e 's!>!\&gt;!g' \
!       -e 's!^[^=]*$!&=!' \
!       -e 's!=!",      "!'     \
!       -e 's!^!        { "!' -e 's!$!" },!';  }
  cat <<EOF
  };
  
diff -brc orig/lynx2-8-2/src/LYShowInfo.c lynx2-8-2/src/LYShowInfo.c
*** orig/lynx2-8-2/src/LYShowInfo.c     Wed Dec 23 15:05:51 1998
--- lynx2-8-2/src/LYShowInfo.c  Wed Dec 23 15:07:04 1998
***************
*** 25,34 ****
  #if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_INFO)
  #define HAVE_CFG_DEFS_H
  
! #define PutDefs(table, N) \
!       fprintf(fp0, "%-35s %s\n", \
!                    table[N].name, \
!                    (table[N].value != 0) ? table[N].value : "")
  
  /*
   *  Compile-time definitions info, returns local url
--- 25,31 ----
  #if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_INFO)
  #define HAVE_CFG_DEFS_H
  
! #define PutDefs(table, N) fprintf(fp0, "%-35s %s\n", table[N].name, 
table[N].value)
  
  /*
   *  Compile-time definitions info, returns local url

reply via email to

[Prev in Thread] Current Thread [Next in Thread]