From f96510c2f721abe937a8c951fc5d24f9baa15c02 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Mon, 22 Aug 2011 23:59:21 +0400 Subject: [PATCH] devel/lxr: upgrade to 0.9.10 Finally, LXR is stable enough to be workable with PostgreSQL: 0.9.7 through 0.9.9 were unstable. Database upgrade scripts were created manually and only PostgreSQL flavor was tested in production. Signed-off-by: Eygene Ryabinkin --- devel/lxr/Makefile | 11 ++++++----- devel/lxr/distinfo | 4 ++-- devel/lxr/files/patch-CVE-2009-4497 | 14 -------------- devel/lxr/files/patch-fix-clean_identifier | 20 -------------------- devel/lxr/files/pkg_message.mysql.in | 7 +++++++ devel/lxr/files/pkg_message.postgresql.in | 8 ++++++++ devel/lxr/files/upgrade-0.9.10-mysql.in | 4 ++++ devel/lxr/files/upgrade-0.9.10-postgres.in | 1 + devel/lxr/pkg-plist | 13 +++++++------ 9 files changed, 35 insertions(+), 47 deletions(-) delete mode 100644 devel/lxr/files/patch-CVE-2009-4497 delete mode 100644 devel/lxr/files/patch-fix-clean_identifier create mode 100644 devel/lxr/files/upgrade-0.9.10-mysql.in create mode 100644 devel/lxr/files/upgrade-0.9.10-postgres.in diff --git a/devel/lxr/Makefile b/devel/lxr/Makefile index 6a92eda..4b3991e 100644 --- a/devel/lxr/Makefile +++ b/devel/lxr/Makefile @@ -6,8 +6,7 @@ # PORTNAME= lxr -PORTVERSION= 0.9.6 -PORTREVISION= 1 +PORTVERSION= 0.9.10 CATEGORIES= devel MASTER_SITES= SF/${PORTNAME}/stable/${PORTNAME}-${PORTVERSION} EXTRACT_SUFX= .tgz @@ -43,6 +42,7 @@ LXRDIR= ${LXRTOPDIR}/lxr PLIST_SUB+= LXRDIR=${LXRDIR:S!^${PREFIX}/!!} PLIST_SUB+= LXRTOPDIR=${LXRTOPDIR:S!^${PREFIX}/!!} SUB_LIST+= LXRDIR=${LXRDIR} +SUB_FILES+= upgrade-0.9.10-postgres upgrade-0.9.10-mysql .include @@ -67,7 +67,6 @@ MSG_FILES+= pkg_message SUB_FILES+= ${MSG_FILES} LXR_SCRIPTS= diff \ - find \ genxref \ ident \ search \ @@ -83,8 +82,7 @@ LXR_DOCS= BUGS \ HACKING \ INSTALL \ LICENSE \ - RELEASING \ - notes + RELEASING post-patch: @${REINPLACE_CMD} \ @@ -121,9 +119,12 @@ do-install: .endif # !defined(NOPORTDOCS) ${MKDIR} ${PREFIX}/${SITE_PERL_REL} ${INSTALL_DATA} ${WRKSRC}/Local.pm ${PREFIX}/${SITE_PERL_REL} + ${INSTALL_DATA} ${WRKSRC}/LXRversion.pm ${PREFIX}/${SITE_PERL_REL} ${TAR} -C ${WRKSRC}/lib -cf - --exclude '*.orig' LXR | ${TAR} -C ${PREFIX}/${SITE_PERL_REL} -xf - ${TAR} -C ${WRKSRC} -cf - --exclude '*.orig' templates | ${TAR} -C ${LXRDIR} -xf - ${CHMOD} 640 ${LXRDIR}/templates/lxr.conf + ${INSTALL_DATA} ${WRKDIR}/upgrade-0.9.10-postgres ${LXRDIR} + ${INSTALL_DATA} ${WRKDIR}/upgrade-0.9.10-mysql ${LXRDIR} post-install: @${ECHO} diff --git a/devel/lxr/distinfo b/devel/lxr/distinfo index bf77322..648be5e 100644 --- a/devel/lxr/distinfo +++ b/devel/lxr/distinfo @@ -1,2 +1,2 @@ -SHA256 (lxr-0.9.6.tgz) = 18c02e814da196b4d66809fb14ff260b20f2dd52c36e2453147a6a4609a1180d -SIZE (lxr-0.9.6.tgz) = 97109 +SHA256 (lxr-0.9.10.tgz) = dbbad73ebde6ea734b5bc299cfe7545a5b371e62cdff0605691e7f0498b6ca18 +SIZE (lxr-0.9.10.tgz) = 115993 diff --git a/devel/lxr/files/patch-CVE-2009-4497 b/devel/lxr/files/patch-CVE-2009-4497 deleted file mode 100644 index 5c844f4..0000000 --- a/devel/lxr/files/patch-CVE-2009-4497 +++ /dev/null @@ -1,14 +0,0 @@ -Obtained-From: http://lxr.cvs.sourceforge.net/viewvc/lxr/lxr/lib/LXR/Common.pm?r1=1.63&r2=1.64&view=patch -Modified-As: two first hunks containing $Id$ were removed to allow clean patching - ---- a/lib/LXR/Common.pm 2010/01/05 17:59:38 1.63 -+++ b/lib/LXR/Common.pm 2010/01/15 23:23:20 1.64 -@@ -633,6 +633,8 @@ - return $config->sourcerootname . ' identifier search' . ($i ? ": $i" : ''); - } elsif ($who eq 'search') { - my $s = $HTTP->{'param'}->{'string'}; -+ $s =~ s//>/g; - return $config->sourcerootname . ' general search' . ($s ? ": $s" : ''); - } - } diff --git a/devel/lxr/files/patch-fix-clean_identifier b/devel/lxr/files/patch-fix-clean_identifier deleted file mode 100644 index 5751a87..0000000 --- a/devel/lxr/files/patch-fix-clean_identifier +++ /dev/null @@ -1,20 +0,0 @@ -Obtained-From: http://lxr.cvs.sourceforge.net/viewvc/lxr/lxr/lib/LXR/Common.pm?r1=1.62&r2=1.63&view=patch -Modified-As: two first hunks containing $Id$ changes were removed to allow clean patching - ---- a/lib/LXR/Common.pm 2009/05/10 11:54:29 1.62 -+++ b/lib/LXR/Common.pm 2010/01/05 17:59:38 1.63 -@@ -526,9 +526,13 @@ - } - - sub clean_identifier { -+ # Cleans up the identifier parameter -+ # Result should be HTML-safe and a valid identifier in -+ # any supported language... -+ # Well, not Lisp symbols since they can contain anything - my $id = shift; - -- $id =~ s/(^[\w`:.,]+).*/$1/ if defined $id; -+ $id =~ s/[^\w`:.,\-_ ]//g if defined $id; - - return $id; - } diff --git a/devel/lxr/files/pkg_message.mysql.in b/devel/lxr/files/pkg_message.mysql.in index e57a83a..d4696d1 100644 --- a/devel/lxr/files/pkg_message.mysql.in +++ b/devel/lxr/files/pkg_message.mysql.in @@ -7,3 +7,10 @@ Run 'mysql' and then read in the initdb-mysql file using This will create the database and a user called lxr with access rights to the database. + +Database upgrade between releases +================================= + +0.9.6 -> 0.9.10: run 'mysql' and then execute upgrade sequence: +'\. %%LXRDIR%%/upgrade-0.9.10-mysql'. + diff --git a/devel/lxr/files/pkg_message.postgresql.in b/devel/lxr/files/pkg_message.postgresql.in index 01fe9c7..dcc2286 100644 --- a/devel/lxr/files/pkg_message.postgresql.in +++ b/devel/lxr/files/pkg_message.postgresql.in @@ -10,3 +10,11 @@ Initialise the database: \i %%LXRDIR%%/initdb-postgres Just ignore the errors about unimplemented functions. + +Database upgrade between releases +================================= + +0.9.6 -> 0.9.10: + psql -U lxrr lxr + \i %%LXRDIR%%/upgrade-0.9.10-postgres + diff --git a/devel/lxr/files/upgrade-0.9.10-mysql.in b/devel/lxr/files/upgrade-0.9.10-mysql.in new file mode 100644 index 0000000..cd91c33 --- /dev/null +++ b/devel/lxr/files/upgrade-0.9.10-mysql.in @@ -0,0 +1,4 @@ +ALTER TABLE lxr_releases CHANGE rel releaseid char(255) binary not null; +DROP INDEX lxr_useageindex on lxr_useage; +RENAME TABLE lxr_useage TO lxr_usage; +CREATE INDEX lxr_usageindex ON lxr_usage (symid); diff --git a/devel/lxr/files/upgrade-0.9.10-postgres.in b/devel/lxr/files/upgrade-0.9.10-postgres.in new file mode 100644 index 0000000..e533add --- /dev/null +++ b/devel/lxr/files/upgrade-0.9.10-postgres.in @@ -0,0 +1 @@ +ALTER TABLE lxr_releases RENAME COLUMN release TO releaseid; diff --git a/devel/lxr/pkg-plist b/devel/lxr/pkg-plist index abdbb19..674073c 100644 --- a/devel/lxr/pkg-plist +++ b/devel/lxr/pkg-plist @@ -1,5 +1,4 @@ %%LXRDIR%%/diff -%%LXRDIR%%/find %%LXRDIR%%/genxref %%LXRDIR%%/ident %%LXRDIR%%/search @@ -7,8 +6,13 @@ %%LXRDIR%%/swish-e.conf %%LXRDIR%%/initdb-postgres %%LXRDIR%%/initdb-mysql +%%LXRDIR%%/upgrade-0.9.10-postgres +%%LXRDIR%%/upgrade-0.9.10-mysql +%%LXRDIR%%/templates/html-head-btn.html +%%LXRDIR%%/templates/valid-html401.png +%%LXRDIR%%/templates/diff-head-btn.html +%%LXRDIR%%/templates/html-fatal.html %%LXRDIR%%/templates/html-dir.html -%%LXRDIR%%/templates/html-find.html %%LXRDIR%%/templates/html-head.html %%LXRDIR%%/templates/html-ident-refs.html %%LXRDIR%%/templates/html-ident.html @@ -24,8 +28,8 @@ %%PORTDOCS%%%%DOCSDIR%%/INSTALL %%PORTDOCS%%%%DOCSDIR%%/LICENSE %%PORTDOCS%%%%DOCSDIR%%/RELEASING -%%PORTDOCS%%%%DOCSDIR%%/notes %%SITE_PERL%%/Local.pm +%%SITE_PERL%%/LXRversion.pm %%SITE_PERL%%/LXR/Files/Plain.pm %%SITE_PERL%%/LXR/Files/BK.pm %%SITE_PERL%%/LXR/Files/CVS.pm @@ -38,15 +42,12 @@ %%SITE_PERL%%/LXR/SimpleParse.pm %%SITE_PERL%%/LXR/Tagger.pm %%SITE_PERL%%/LXR/Index/Mysql.pm -%%SITE_PERL%%/LXR/Index/DB.pm %%SITE_PERL%%/LXR/Index/DBI.pm %%SITE_PERL%%/LXR/Index/Oracle.pm %%SITE_PERL%%/LXR/Index/Postgres.pm %%SITE_PERL%%/LXR/Lang/Cobol.pm %%SITE_PERL%%/LXR/Lang/Generic.pm %%SITE_PERL%%/LXR/Lang/Java.pm -%%SITE_PERL%%/LXR/Lang/Perl.pm -%%SITE_PERL%%/LXR/Lang/Python.pm %%SITE_PERL%%/LXR/Lang/ectags.conf %%SITE_PERL%%/LXR/Lang/ectags.conf.documentation %%SITE_PERL%%/LXR/Lang/generic.conf -- 1.7.5.4