Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
2056eb3e
Commit
2056eb3e
authored
Apr 30, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 140664 - checksetup.pl fails on perl 5.005. Patch by bbaetz; r=afranke, daa@rm.incc.net, gerv.
parent
6be616ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
8 deletions
+37
-8
checksetup.pl
checksetup.pl
+37
-8
No files found.
checksetup.pl
View file @
2056eb3e
...
...
@@ -543,6 +543,13 @@ EOF
# Global Utility Library
###########################################################################
# globals.pl clears the PATH, but File::Find uses Cwd::cwd() instead of
# Cwd::getcwd(), which we need to do because `pwd` isn't in the path - see
# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-09/msg00115.html
# As a workaround, since we only use File::Find in checksetup, which doesn't
# run in taint mode anyway, preserve the path...
my
$origPath
=
$::ENV
{
'PATH'
};
# Use the Bugzilla utility library for various functions. We do this
# here rather than at the top of the file so globals.pl doesn't define
# localconfig variables for us before we get a chance to check for
...
...
@@ -550,6 +557,10 @@ EOF
# removes $ENV{'path'}, which we need in order to run `which mysql` above.
require
"globals.pl"
;
# ...and restore it. This doesn't change tainting, so this will still cause
# errors if this script ever does run with -T.
$::ENV
{
'PATH'
}
=
$origPath
;
###########################################################################
# Check data directory
###########################################################################
...
...
@@ -759,7 +770,7 @@ END
# The last time the global template params were changed. Keep in UTC,
# YYYY-MM-DD
my
$lastTemplateParamChange
=
str2time
(
"2002-04-2
4
"
,
"UTC"
);
my
$lastTemplateParamChange
=
str2time
(
"2002-04-2
7
"
,
"UTC"
);
if
(
-
e
'data/template'
)
{
unless
(
-
d
'data/template'
&&
-
e
'data/template/.lastRebuild'
&&
(
stat
(
'data/template/.lastRebuild'
))[
9
]
>=
$lastTemplateParamChange
)
{
...
...
@@ -793,7 +804,7 @@ END
PRE_CHOMP
=>
1
,
TRIM
=>
1
,
COMPILE_DIR
=>
"data"
,
# becomes data/template/en/{custom,default}
COMPILE_DIR
=>
'data/'
,
# becomes data/template/en/{custom,default}
# These don't actually need to do anything here, just exist
FILTERS
=>
...
...
@@ -806,17 +817,34 @@ END
})
||
die
(
"Could not create Template: "
.
Template
->
error
()
.
"\n"
);
sub
compile
{
return
if
(
-
d
$_
);
return
if
(
$_
!~
/\.tmpl$/
);
s!template/en/default/!!
;
# trim the bit we don't pass to TT
# no_chdir doesn't work on perl 5.005
my
$origDir
=
$
File::Find::
dir
;
my
$name
=
$
File::Find::
name
;
return
if
(
-
d
$name
);
return
if
(
$name
=~
/\/CVS\//
);
return
if
(
$name
!~
/\.tmpl$/
);
$name
=~
s!template/en/default/!!
;
# trim the bit we don't pass to TT
chdir
(
$::baseDir
);
$template
->
process
(
$_
,
{})
||
die
"Could not compile $_:"
.
$template
->
error
()
.
"\n"
;
$template
->
process
(
$name
,
{})
||
die
"Could not compile $name:"
.
$template
->
error
()
.
"\n"
;
chdir
(
$origDir
);
}
{
use
File::
Find
;
use
Cwd
;
$::baseDir
=
getcwd
();
# Don't hang on templates which use the CGI library
eval
(
"use CGI qw(-no_debug)"
);
# Disable warnings which come from running the compiled templates
# This way is OK, because they're all runtime warnings.
# The reason we get these warnings here is that none of the required
...
...
@@ -829,8 +857,9 @@ END
# FIXME - if we start doing dynamic INCLUDE_PATH we may have to
# recurse all of template/, changing the INCLUDE_PATH each time
find
(
{
wanted
=>
\&
compile
,
no_chdir
=>
1
}
,
"template/en/default"
);
find
(
\&
compile
,
"template/en/default"
);
}
# update the time on the stamp file
open
FILE
,
'>data/template/.lastRebuild'
;
close
FILE
;
utime
$lastTemplateParamChange
,
$lastTemplateParamChange
,
(
'data/template/.lastRebuild'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment