Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Feb 2002 16:40:08 +0100 (CET)
From:      Thierry Thomas <thierry@pompo.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/35048: devel/chora: fix wrong date display + add syntax highlighting
Message-ID:  <20020217154008.23A847523@graf.pompo.net>

next in thread | raw e-mail | index | archive | help

>Number:         35048
>Category:       ports
>Synopsis:       devel/chora: fix wrong date display + add syntax highlighting
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 17 07:50:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thierry Thomas
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Kabbale Eros
>Environment:
System: FreeBSD graf.pompo.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Sun Feb 3 16:21:08 CET 2002 root@graf.pompo.net:/usr/obj/mntsrc/src/sys/GRAF010429 i386


	
>Description:
	The date display in Chora 1.0 is incorrect.

	+ adding support of enscript for syntax highlighting.

>How-To-Repeat:
	If you committed files at 13:00 EST, cvs would store the date in UTC format,
or 18:00 UTC. Chora would then call mktime on the UTC date that cvs gave it.
mktime uses your local TZ setting, so now 18:00 (which was UTC, but treated
as EST) became 23:00. Then chora calls gmdate on this value, which treats it
as if it were UTC, and displays a file modification time of 23:00 EST, even though
the file was committed at 13:00 EST. (description and fixes from CVS).

>Fix:

	Pre-requisite: please commit PR ports/35047 on www/horde-devel before this one.

	Then apply the following patch:

diff -urN /usr/ports/devel/chora.orig/Makefile /usr/ports/devel/chora/Makefile
--- /usr/ports/devel/chora.orig/Makefile	Sat Feb  9 09:50:30 2002
+++ /usr/ports/devel/chora/Makefile	Sat Feb 16 19:05:45 2002
@@ -7,13 +7,32 @@
 
 PORTNAME=	chora
 PORTVERSION=	1.0
+PORTREVISION=	1
 CATEGORIES=	devel www
 MASTER_SITES=	ftp://ftp.horde.org/pub/chora/tarballs/	\
 		ftp://ftp.uk.horde.org/mirrors/ftp.horde.org/pub/chora/tarballs/
 
 MAINTAINER=	thierry@pompo.net
 
+#-----------------------------------------------------------------------
+# You may define these options:
+#
+# - WITHOUT_ENSCRIPT	: if you do not need syntax highlighting;
+#
+# - A4 or DJ		: if you run enscript with this paper size.
+#
+#-----------------------------------------------------------------------
+
 RUN_DEPENDS=	${LOCALBASE}/www/horde/index.php:${PORTSDIR}/www/horde-devel
+.if !defined(WITHOUT_ENSCRIPT)
+.if defined(A4)
+RUN_DEPENDS=	${LOCALBASE}/bin/enscript:${PORTSDIR}/print/enscript-a4
+.elif defined(DJ)
+RUN_DEPENDS=	${LOCALBASE}/bin/enscript:${PORTSDIR}/print/enscript-letterdj
+.else
+RUN_DEPENDS=	${LOCALBASE}/bin/enscript:${PORTSDIR}/print/enscript-letter
+.endif
+.endif
 
 NO_BUILD=	yes
 
@@ -58,6 +77,10 @@
 		${HORDE_INC}/httpd.conf.chora
 	@${PERL} -pi -e "s://UNCOMMENTWHENINSTCHORA::" \
 		${HORDEDIR}/config/registry.php
+.if !defined(WITHOUT_ENSCRIPT)
+	@${PERL} -pi -e "s://UNCOMMENTWHENINSTCHORA::" \
+		${HORDEDIR}/config/mime_drivers.php
+.endif
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 .for FILE in ${DOCS}
diff -urN /usr/ports/devel/chora.orig/files/patch-cvs.php /usr/ports/devel/chora/files/patch-cvs.php
--- /usr/ports/devel/chora.orig/files/patch-cvs.php	Thu Jan  1 01:00:00 1970
+++ /usr/ports/devel/chora/files/patch-cvs.php	Sat Feb 16 20:30:01 2002
@@ -0,0 +1,11 @@
+--- cvs.php.orig	Wed Jan  2 18:05:18 2002
++++ cvs.php	Sat Feb 16 20:29:37 2002
+@@ -176,7 +176,7 @@
+         }
+ 
+         $textURL= Chora::url('co', $where, array('r'=>$rev));
+-        $commitDate = gmdate('jS F Y, g:ia', $lg->date);
++        $commitDate = date('jS F Y, g:ia', $lg->date);
+         $readableDate = CVSLib_File::readableTime($lg->date, true);
+ 
+         $aid = $lg->queryAuthor();
diff -urN /usr/ports/devel/chora.orig/files/patch-history.php /usr/ports/devel/chora/files/patch-history.php
--- /usr/ports/devel/chora.orig/files/patch-history.php	Thu Jan  1 01:00:00 1970
+++ /usr/ports/devel/chora/files/patch-history.php	Sat Feb 16 19:37:21 2002
@@ -0,0 +1,11 @@
+--- history.php.orig	Wed Jan  2 18:05:19 2002
++++ history.php	Sat Feb 16 19:36:54 2002
+@@ -197,7 +197,7 @@
+             $bg = isset($branchColours[$bgbr]) ? $branchColours[$bgbr] : 'white';
+             $log = $fl->logs[$rev]; 
+             $author = Chora::showAuthorName($log->queryAuthor());
+-            $date = gmdate('jS M Y', $log->queryDate());
++            $date = strftime('%e %b %Y', $log->queryDate());
+             $lines = $log->queryChangedLines();
+             include $registry->getTemplatePath() . '/history/rev.inc';
+ 
diff -urN /usr/ports/devel/chora.orig/files/patch-lib_CVSLib_Log.php /usr/ports/devel/chora/files/patch-lib_CVSLib_Log.php
--- /usr/ports/devel/chora.orig/files/patch-lib_CVSLib_Log.php	Thu Jan  1 01:00:00 1970
+++ /usr/ports/devel/chora/files/patch-lib_CVSLib_Log.php	Sat Feb 16 19:40:39 2002
@@ -0,0 +1,11 @@
+--- lib/CVSLib/Log.php.orig	Sat Aug 11 22:59:31 2001
++++ lib/CVSLib/Log.php	Sat Feb 16 19:39:47 2002
+@@ -45,7 +45,7 @@
+             case CVSLIB_LOG_DATE:
+                 $line = array_shift($raw);
+                 if (preg_match("|^date:\s+(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+);\s+author:\s+(\S+);\s+state:\s+(\S+);(\s+lines:\s+([0-9\s+-]+))?|", $line, $parts)) {
+-                    $this->date = mktime($parts[4], $parts[5], $parts[6], $parts[2], $parts[3], $parts[1]);
++                    $this->date = gmmktime($parts[4], $parts[5], $parts[6], $parts[2], $parts[3], $parts[1]);
+                     $this->author = $parts[7];
+                     $this->state = $parts[8];
+                     $this->lines = isset($parts[10])?$parts[10]:'';
diff -urN /usr/ports/devel/chora.orig/pkg-plist /usr/ports/devel/chora/pkg-plist
--- /usr/ports/devel/chora.orig/pkg-plist	Tue Feb  5 23:17:25 2002
+++ /usr/ports/devel/chora/pkg-plist	Sat Feb 16 20:31:27 2002
@@ -40,6 +40,7 @@
 %%CHORADIR%%/lib/CVSLib/Error.php
 %%CHORADIR%%/lib/CVSLib/File.php
 %%CHORADIR%%/lib/CVSLib/Log.php
+%%CHORADIR%%/lib/CVSLib/Log.php.orig
 %%CHORADIR%%/lib/CVSLib/Rev.php
 %%CHORADIR%%/lib/Chora.php
 %%CHORADIR%%/lib/MIME/Viewer/text.php


>Release-Note:
>Audit-Trail:
>Unformatted:

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?20020217154008.23A847523>