File: load_rt_generated.diff

package info (click to toggle)
request-tracker5 5.0.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,796 kB
  • sloc: javascript: 191,917; perl: 88,458; sh: 1,433; makefile: 489; python: 37; php: 15
file content (29 lines) | stat: -rw-r--r-- 889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 8cc89309063016b85b39ea918e45b565b5795e86 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Wed, 6 May 2015 22:29:35 +0000
Subject: Load RT::Generated directly from @INC

This allows for the possibility of overriding RT::Generated in test
scenarios.

Patch-Name: load_rt_generated.diff
---
 lib/RT.pm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/RT.pm b/lib/RT.pm
index 07aed505..84420b1b 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -989,10 +989,8 @@ sub InstallMode {
 
 sub LoadGeneratedData {
     my $class = shift;
-    my $pm_path = ( File::Spec->splitpath( $INC{'RT.pm'} ) )[1];
-    $pm_path = File::Spec->rel2abs( $pm_path );
 
-    require "$pm_path/RT/Generated.pm" || die "Couldn't load RT::Generated: $@";
+    require RT::Generated || die "Couldn't load RT::Generated: $@";
     $class->CanonicalizeGeneratedPaths();
 }