Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 2002 15:10:04 -0700 (PDT)
From:      Thierry Thomas <thierry@pompo.net>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/40782: New port: www/tidy-devel (latest version of Tidy)
Message-ID:  <200208062210.g76MA4hX033726@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/40782; it has been noted by GNATS.

From: Thierry Thomas <thierry@pompo.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/40782: New port: www/tidy-devel (latest version of Tidy)
Date: Tue, 6 Aug 2002 23:46:30 +0200

 Le 19/07/2002 à 18:55:31 +0200, Thierry Thomas <thierry@pompo.net> écrivait :
 > 
 > >Number:         40782
 > >Category:       ports
 > >Synopsis:       New port: www/tidy-devel (latest version of Tidy)
 
 The following patch upgrades the submitted port to the version of 5
 August, 2002.
 
 I have added patches (from port www/tidy) to be buildable in -Current +
 PreserveEntities to be used in docproj.
 
 
 diff -urN /usr/ports/www/tidy-devel.orig/Makefile /usr/ports/www/tidy-devel/Makefile
 --- /usr/ports/www/tidy-devel.orig/Makefile	Fri Jul 19 18:13:25 2002
 +++ /usr/ports/www/tidy-devel/Makefile	Tue Aug  6 23:16:25 2002
 @@ -6,7 +6,7 @@
  #
  
  PORTNAME=	tidy
 -PORTVERSION=	020718
 +PORTVERSION=	020805
  CATEGORIES=	www
  MASTER_SITES=	http://tidy.sourceforge.net/src/%SUBDIR%/	\
  		http://tidy.sourceforge.net/docs/
 diff -urN /usr/ports/www/tidy-devel.orig/distinfo /usr/ports/www/tidy-devel/distinfo
 --- /usr/ports/www/tidy-devel.orig/distinfo	Fri Jul 19 18:15:08 2002
 +++ /usr/ports/www/tidy-devel/distinfo	Tue Aug  6 23:18:20 2002
 @@ -1,2 +1,2 @@
 -MD5 (tidy_src_020718.tgz) = 7694dcdb7d451b17477292d60186f477
 +MD5 (tidy_src_020805.tgz) = fdcb7b146aa42bd7549c068bca257877
  MD5 (tidy_docs.tgz) = b00b66264fafbca56aba0bf74a6ecc30
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-Makefile /usr/ports/www/tidy-devel/files/patch-Makefile
 --- /usr/ports/www/tidy-devel.orig/files/patch-Makefile	Sun Jun 23 01:25:13 2002
 +++ /usr/ports/www/tidy-devel/files/patch-Makefile	Sat Jul 27 10:49:06 2002
 @@ -1,6 +1,14 @@
  --- Makefile.orig	Sat Jun  1 08:50:02 2002
 -+++ Makefile	Sun Jun 23 01:24:35 2002
 -@@ -59,7 +59,7 @@
 ++++ Makefile	Sat Jul 27 10:48:18 2002
 +@@ -52,14 +52,14 @@
 + #  acknowledgment is not required but would be appreciated.
 + #
 + 
 +-CC= gcc
 ++#CC= gcc
 + 
 + INCLDIR= ./include/
 + SRCDIR= ./src/
   OBJDIR= ./
   
   DEBUGFLAGS=-g -DDMALLOC
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-include_html.h /usr/ports/www/tidy-devel/files/patch-include_html.h
 --- /usr/ports/www/tidy-devel.orig/files/patch-include_html.h	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-include_html.h	Sat Jul 27 11:21:33 2002
 @@ -0,0 +1,31 @@
 +--- include/html.h.orig	Sat Jun  1 08:50:02 2002
 ++++ include/html.h	Sat Jul 27 11:20:43 2002
 +@@ -11,6 +11,12 @@
 + 
 + */
 + 
 ++/* Requested for FreeBSD >= 5 */
 ++
 ++#if defined(__FreeBSD__)
 ++#include <sys/types.h>
 ++#endif
 ++
 + /* indentation modes */
 + 
 + #define NO_INDENT      0
 +@@ -461,6 +467,7 @@
 + 
 + void FatalError(char *msg);
 + void FileError(FILE *fp, const char *file);
 ++int  FileExists(const char *file);
 + 
 + void AddByte(Lexer *lexer, uint c);
 + 
 +@@ -956,6 +963,7 @@
 + extern Bool OutputBOM;
 + extern Bool SmartBOM;
 + extern Bool ReplaceColor; /* #477643 - replace hex color attribute values with names */
 ++extern Bool PreserveEntities;
 + extern char *CSSPrefix;   /* #508936 - CSS class naming for -clean option */
 + 
 + /* TRT */
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-include_platform.h /usr/ports/www/tidy-devel/files/patch-include_platform.h
 --- /usr/ports/www/tidy-devel.orig/files/patch-include_platform.h	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-include_platform.h	Sat Jul 27 10:57:06 2002
 @@ -0,0 +1,11 @@
 +--- ./include/platform.h.orig	Mon Jul  8 08:50:02 2002
 ++++ ./include/platform.h	Sat Jul 27 10:55:37 2002
 +@@ -28,7 +28,7 @@
 +   variable is not set. Contributed by Todd Lewis.
 + */
 + 
 +-/* #define SUPPORT_GETPWNAM */
 ++#define SUPPORT_GETPWNAM
 + 
 + /* Enable/disable support for Big5 and Shift_JIS character encodings */
 + #ifndef SUPPORT_ASIAN_ENCODINGS
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-man_page.txt /usr/ports/www/tidy-devel/files/patch-man_page.txt
 --- /usr/ports/www/tidy-devel.orig/files/patch-man_page.txt	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-man_page.txt	Sat Jul 27 11:45:09 2002
 @@ -0,0 +1,20 @@
 +--- man_page.txt.orig	Tue Jan  1 00:49:06 2002
 ++++ man_page.txt	Sat Jul 27 11:44:30 2002
 +@@ -12,6 +12,7 @@
 + .IR column ]
 + .RB [ -upper ]
 + .RB [ -clean ]
 ++.RB [ -preserve ]
 + .RB [ -raw
 + |
 + .B -ascii
 +@@ -106,6 +107,9 @@
 + .TP
 + .B -slides
 + Burst into slides on <H2> elements.
 ++.TP
 ++.B -preserve
 ++Preserve source file entities as is.
 + .TP
 + .BR -help ", " -h
 + List command-line options.
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-src_config.c /usr/ports/www/tidy-devel/files/patch-src_config.c
 --- /usr/ports/www/tidy-devel.orig/files/patch-src_config.c	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-src_config.c	Sat Jul 27 11:10:48 2002
 @@ -0,0 +1,35 @@
 +--- src/config.c.orig	Mon Jul  8 08:50:02 2002
 ++++ src/config.c	Sat Jul 27 11:09:37 2002
 +@@ -130,6 +130,7 @@
 + Bool OutputBOM = no;        /* output a Byte Order Mark (BOM) when using UTF-8/UTF-16 encodings */
 + Bool SmartBOM = yes;        /* if input stream has BOM, do we automatically output a BOM? */
 + Bool ReplaceColor = no;     /* #477643 - replace hex color attribute values with names */
 ++Bool PreserveEntities = no; /* if yes don't convert entities to chars */
 + char *CSSPrefix = null;     /* #508936 - CSS class naming for -clean option */
 + 
 + /* TRT */
 +@@ -519,7 +520,10 @@
 +     /* open the file and parse its contents */
 + 
 +     if ((fin = fopen(fname, "r")) == null)
 +-        FileError(stderr, fname);
 ++    {
 ++        if (FileExists(fname))		/* quiet file open error on */
 ++            FileError(stderr, fname);   /* non-existent file */
 ++    }
 +     else
 +     {
 +         config_text = null;
 +@@ -748,6 +752,12 @@
 +     {
 +         QuoteAmpersand = yes;
 +         HideEndTags = no;
 ++    }
 ++
 ++ /* Avoid &amp;copy; in preserve-entities case */
 ++    if (PreserveEntities)
 ++    {
 ++        QuoteAmpersand = no;
 +     }
 + 
 + #if SUPPORT_UTF16_ENCODINGS
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-src_lexer.c /usr/ports/www/tidy-devel/files/patch-src_lexer.c
 --- /usr/ports/www/tidy-devel.orig/files/patch-src_lexer.c	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-src_lexer.c	Sat Jul 27 11:29:41 2002
 @@ -0,0 +1,14 @@
 +--- src/lexer.c.orig	Mon Jul  8 08:50:03 2002
 ++++ src/lexer.c	Sat Jul 27 11:28:50 2002
 +@@ -2349,8 +2349,10 @@
 + 
 +                     continue;
 +                 }
 +-                else if (c == '&' && mode != IgnoreMarkup)
 ++                else if (c == '&' && mode != IgnoreMarkup
 ++                                  && !PreserveEntities) {
 +                     ParseEntity(lexer, mode);
 ++		}
 + 
 +                 /* this is needed to avoid trimming trailing whitespace */
 +                 if (mode == IgnoreWhitespace)
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-src_localize.c /usr/ports/www/tidy-devel/files/patch-src_localize.c
 --- /usr/ports/www/tidy-devel.orig/files/patch-src_localize.c	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-src_localize.c	Sat Jul 27 11:39:20 2002
 @@ -0,0 +1,41 @@
 +--- src/localize.c.orig	Mon Jul  8 08:50:03 2002
 ++++ src/localize.c	Sat Jul 27 11:38:51 2002
 +@@ -15,6 +15,13 @@
 + 
 + */
 + 
 ++/* Requested for FreeBSD >= 5 */
 ++
 ++#if defined(__FreeBSD__)
 ++#include <sys/types.h>
 ++#include <sys/stat.h>
 ++#endif
 ++
 + #include "platform.h"
 + #include "html.h"
 + 
 +@@ -66,6 +73,16 @@
 +     tidy_out(fp, "Can't open \"%s\"\n", file);
 + }
 + 
 ++int FileExists(const char *file)
 ++{
 ++    struct stat st;
 ++
 ++    if (stat(file, &st) < 0)
 ++        return (0);
 ++    else
 ++        return (1);
 ++}
 ++
 + static void ReportTag(Lexer *lexer, Node *tag)
 + {
 +     if (tag)
 +@@ -1055,6 +1072,7 @@
 +     tidy_out(out, "  -asxhtml          to convert HTML to well formed XHTML\n");
 +     tidy_out(out, "  -ashtml           to force XHTML to well formed HTML\n");
 +     tidy_out(out, "  -slides           to burst into slides on H2 elements\n");
 ++    tidy_out(out, "  -preserve         to preserve entities from source file\n");
 + 
 + /* TRT */
 + #if SUPPORT_ACCESSIBILITY_CHECKS
 diff -urN /usr/ports/www/tidy-devel.orig/files/patch-src_tidy.c /usr/ports/www/tidy-devel/files/patch-src_tidy.c
 --- /usr/ports/www/tidy-devel.orig/files/patch-src_tidy.c	Thu Jan  1 01:00:00 1970
 +++ /usr/ports/www/tidy-devel/files/patch-src_tidy.c	Sat Jul 27 11:49:14 2002
 @@ -0,0 +1,11 @@
 +--- src/tidy.c.orig	Mon Jul  8 08:50:03 2002
 ++++ src/tidy.c	Sat Jul 27 11:48:48 2002
 +@@ -1911,6 +1911,8 @@
 +                 Quiet = yes;
 +             else if (wstrcasecmp(arg, "slides") == 0)
 +                 BurstSlides = yes;
 ++            else if (wstrcasecmp(arg, "preserve") == 0)
 ++                PreserveEntities = yes;
 +             else if (wstrcasecmp(arg, "help") == 0 ||
 +                      wstrcasecmp(arg,    "h") == 0 ||
 +                                  *arg == '?')
 
 
 
 -- 
 Th. Thomas.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208062210.g76MA4hX033726>