From 9ae2e7cdec9ddbb96230701a488ec494ce93b7a7 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" Date: Fri, 30 Jul 1999 01:28:32 +0000 Subject: [PATCH] Fixed bug 10812 -- LXR paths were not getting generated correctly. git-svn-id: svn://10.0.0.236/trunk@41571 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bonsai/defparams.pl | 5 +++++ mozilla/webtools/bonsai/globals.pl | 16 +++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/mozilla/webtools/bonsai/defparams.pl b/mozilla/webtools/bonsai/defparams.pl index 26609a7c341..5407429671b 100644 --- a/mozilla/webtools/bonsai/defparams.pl +++ b/mozilla/webtools/bonsai/defparams.pl @@ -212,6 +212,11 @@ DefParam("lxr_base", "http://lxr.mozilla.org/", \&check_urlbase); +DefParam("lxr_mungeregexp", + 'A regexp to use to munge a pathname from the $CVSROOT into a valid LXR pathname. So, for example, if we tend to have a lot of pathnames that start with "mozilla/", and the LXR URLs should not contain that leading mozilla/, then you would use something like: s@^mozilla/@@', + "t", + ""); + DefParam("bugs_base", "The URL that is the common initial leading part of all Bugzilla URLs.", "t", diff --git a/mozilla/webtools/bonsai/globals.pl b/mozilla/webtools/bonsai/globals.pl index 5df69b16724..d55d9d447dd 100644 --- a/mozilla/webtools/bonsai/globals.pl +++ b/mozilla/webtools/bonsai/globals.pl @@ -1208,17 +1208,11 @@ sub GenerateUserLookUp { sub Fix_LxrLink { my ($lxr_path) = @_; my $lxr_base = Param('lxr_base'); - -# # total kludge!! lxr omits the top-level "mozilla" directory... -# if (mozilla_lxr_kludge) { -# $lxr_path =~ s@^ns/@@; -# $lxr_path =~ s@^mozilla/@@; -# } - - $lxr_path =~ s!.*/(r+src/)!$1!; - $lxr_path =~ s!(r+src)/!device/$1/!; - - return "$lxr_base/$lxr_path"; + my $munge = Param('lxr_mungeregexp'); + if ($munge ne "") { + eval("\$lxr_path =~ $munge"); + } + return "$lxr_base$lxr_path"; } #