Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  1 May 2007 11:29:22 +0300 (EEST)
From:      Sergey Prikhodko <sergey@network-asp.biz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        vivek@khera.org
Subject:   ports/112287: www/rt36: add missed patches for MULTIPLE_INSTANCES
Message-ID:  <20070501082922.E686768F006@master.network-asp.biz>
Resent-Message-ID: <200705010830.l418U2jo090757@freefall.freebsd.org>

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

>Number:         112287
>Category:       ports
>Synopsis:       www/rt36: add missed patches for MULTIPLE_INSTANCES
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 01 08:30:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Prikhodko
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
Network-APS
>Environment:
System: FreeBSD master.network-asp.biz 5.4-STABLE FreeBSD 5.4-STABLE #2: Fri Nov 4 15:03:13 EET 2005 root@master.network-asp.biz:/usr/obj/usr/src/sys/ROUTER i386

>Description:
	Patches for instances was missed in ports/99660 but MULTIPLE_INSTANCES 
	configuration knob still exists.

>How-To-Repeat:
	Try to upgrade rt34->rt36 and look at broken ticket system instances.

>Fix:

--- patch-rt36 begins here ---
diff -ruN rt36.orig/Makefile rt36/Makefile
--- rt36.orig/Makefile	Fri Dec 22 19:07:38 2006
+++ rt36/Makefile	Mon Apr 30 23:04:03 2007
@@ -108,6 +108,9 @@
 		${SITE_PERL}/${PERL_ARCH}/Apache/Request.pm:${PORTSDIR}/www/p5-libapreq
 .endif
 .endif
+.if defined(MULTIPLE_INSTANCES)
+EXTRA_PATCHES+=	${FILESDIR}/multiple*
+.endif
 
 DB_TYPE?=	mysql
 
diff -ruN rt36.orig/files/multiple-bin-webmux_pl_in rt36/files/multiple-bin-webmux_pl_in
--- rt36.orig/files/multiple-bin-webmux_pl_in	Thu Jan  1 03:00:00 1970
+++ rt36/files/multiple-bin-webmux_pl_in	Mon Apr 30 23:05:37 2007
@@ -0,0 +1,15 @@
+--- bin/webmux.pl.in.orig	Tue Sep 26 18:06:31 2006
++++ bin/webmux.pl.in	Mon Apr 30 23:04:45 2007
+@@ -63,6 +63,12 @@
+ }
+ 
+ use lib ( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@" );
++if ($ENV{RT_INSTANCE_PATH}) {
++    lib->import("$ENV{RT_INSTANCE_PATH}/local/lib");
++}
++if ($ENV{RT_VENDOR_PATH}) {
++    lib->import($ENV{RT_VENDOR_PATH});
++}
+ use RT;
+ 
+ package RT::Mason;
diff -ruN rt36.orig/files/multiple-lib-RT_pm_in rt36/files/multiple-lib-RT_pm_in
--- rt36.orig/files/multiple-lib-RT_pm_in	Thu Jan  1 03:00:00 1970
+++ rt36/files/multiple-lib-RT_pm_in	Mon Apr 30 23:07:18 2007
@@ -0,0 +1,63 @@
+--- lib/RT.pm.in.orig	Mon Nov  6 21:09:32 2006
++++ lib/RT.pm.in	Mon Apr 30 23:04:45 2007
+@@ -98,6 +98,60 @@
+ # via the web interface)
+ $MasonSessionDir = '@MASON_SESSION_PATH@';
+ 
++=item import
++
++Allow override of various internal paths.
++
++    RT->import (
++            RT_INSTANCE_PATH => '/usr/local/rt/stuff',
++            SITE_CONFIG_FILE => '/etc/stuff.pm',
++              ...
++    );
++
++If RT_INSTANCE_PATH is set in the arguments (or in %ENV)
++then it replaces the old value of $BasePath in the following
++variables:
++  $SITE_CONFIG_FILE
++  $LocalPath
++  $LocalEtcPath
++  $LocalLexiconPath
++  $MasonLocalComponentRoot
++  $MasonDataDir
++  $MasonSessionDir
++
++Beyond that, those individual values can be set explicitly
++by arguments.
++
++=cut
++
++sub import {
++no strict 'refs';
++    shift;
++    my %args = @_;
++    return unless ( scalar (keys %args) || $ENV{RT_INSTANCE_PATH} );
++
++    my @variables = qw (
++        SITE_CONFIG_FILE
++        LocalPath
++        LocalEtcPath
++        LocalLexiconPath
++        MasonLocalComponentRoot
++        MasonDataDir
++        MasonSessionDir
++    );
++
++    my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || $ENV{RT_INSTANCE_PATH};
++    if ($RT_INSTANCE_PATH) {
++        foreach my $vref (@variables) {
++            $$vref =~ s/^\Q$BasePath\E/$RT_INSTANCE_PATH/;
++        }
++    }
++    foreach my $vref (@variables) {
++        $$vref = $args{$vref} if defined ( $args{$vref} );
++    }
++
++use strict 'refs';
++}
+ 
+ 
+ =head1 NAME
diff -ruN rt36.orig/files/multiple-sbin-rt-setup-database_in rt36/files/multiple-sbin-rt-setup-database_in
--- rt36.orig/files/multiple-sbin-rt-setup-database_in	Thu Jan  1 03:00:00 1970
+++ rt36/files/multiple-sbin-rt-setup-database_in	Mon Apr 30 23:30:39 2007
@@ -0,0 +1,21 @@
+--- sbin/rt-setup-database.in.orig	Fri Dec  1 20:59:26 2006
++++ sbin/rt-setup-database.in	Mon Apr 30 23:04:45 2007
+@@ -51,11 +51,17 @@
+ 
+ use lib "@LOCAL_LIB_PATH@";
+ use lib "@RT_LIB_PATH@";
++## RT_INSTANCE_PATH can be passed in environment.
++## Can change where RT_SiteConfig is read from.
++my $RT_INSTANCE_PATH;
++BEGIN {
++    $RT_INSTANCE_PATH = $ENV{RT_INSTANCE_PATH};
++}
+ 
+ #This drags in  RT's config.pm
+ # We do it in a begin block because RT::Handle needs to know the type to do its
+ # inheritance
+-use RT;
++use RT (RT_INSTANCE_PATH => $RT_INSTANCE_PATH);
+ use Carp;
+ use RT::User;
+ use RT::CurrentUser;
--- patch-rt36 ends here ---


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



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