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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
4768da33
Commit
4768da33
authored
Mar 21, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 192054: Bugzilla dependencies upgrade messages in wrong order
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
parent
0a18cfa0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
50 deletions
+65
-50
Requirements.pm
Bugzilla/Install/Requirements.pm
+65
-50
No files found.
Bugzilla/Install/Requirements.pm
View file @
4768da33
...
@@ -107,6 +107,12 @@ sub OPTIONAL_MODULES {
...
@@ -107,6 +107,12 @@ sub OPTIONAL_MODULES {
feature
=>
'Graphical Reports, New Charts, Old Charts'
feature
=>
'Graphical Reports, New Charts, Old Charts'
},
},
{
{
package
=>
'Chart'
,
module
=>
'Chart::Base'
,
version
=>
'1.0'
,
feature
=>
'New Charts, Old Charts'
},
{
package
=>
'Template-GD'
,
package
=>
'Template-GD'
,
# This module tells us whether or not Template-GD is installed
# This module tells us whether or not Template-GD is installed
# on Template-Toolkits after 2.14, and still works with 2.14 and lower.
# on Template-Toolkits after 2.14, and still works with 2.14 and lower.
...
@@ -115,12 +121,6 @@ sub OPTIONAL_MODULES {
...
@@ -115,12 +121,6 @@ sub OPTIONAL_MODULES {
feature
=>
'Graphical Reports'
feature
=>
'Graphical Reports'
},
},
{
{
package
=>
'Chart'
,
module
=>
'Chart::Base'
,
version
=>
'1.0'
,
feature
=>
'New Charts, Old Charts'
},
{
package
=>
'GDGraph'
,
package
=>
'GDGraph'
,
module
=>
'GD::Graph'
,
module
=>
'GD::Graph'
,
version
=>
0
,
version
=>
0
,
...
@@ -264,7 +264,7 @@ sub check_requirements {
...
@@ -264,7 +264,7 @@ sub check_requirements {
print
"\n"
,
install_string
(
'checking_modules'
),
"\n"
if
$output
;
print
"\n"
,
install_string
(
'checking_modules'
),
"\n"
if
$output
;
my
$root
=
ROOT_USER
;
my
$root
=
ROOT_USER
;
my
%
missing
=
_check_missing
(
REQUIRED_MODULES
,
$output
);
my
$
missing
=
_check_missing
(
REQUIRED_MODULES
,
$output
);
print
"\n"
,
install_string
(
'checking_dbd'
),
"\n"
if
$output
;
print
"\n"
,
install_string
(
'checking_dbd'
),
"\n"
if
$output
;
my
$have_one_dbd
=
0
;
my
$have_one_dbd
=
0
;
...
@@ -275,19 +275,19 @@ sub check_requirements {
...
@@ -275,19 +275,19 @@ sub check_requirements {
}
}
print
"\n"
,
install_string
(
'checking_optional'
),
"\n"
if
$output
;
print
"\n"
,
install_string
(
'checking_optional'
),
"\n"
if
$output
;
my
%
missing_optional
=
_check_missing
(
OPTIONAL_MODULES
,
$output
);
my
$
missing_optional
=
_check_missing
(
OPTIONAL_MODULES
,
$output
);
# If we're running on Windows, reset the input line terminator so that
# If we're running on Windows, reset the input line terminator so that
# console input works properly - loading CGI tends to mess it up
# console input works properly - loading CGI tends to mess it up
$/
=
"\015\012"
if
ON_WINDOWS
;
$/
=
"\015\012"
if
ON_WINDOWS
;
my
$pass
=
!
scalar
(
keys
%
missing
)
&&
$have_one_dbd
;
my
$pass
=
!
scalar
(
@$
missing
)
&&
$have_one_dbd
;
return
{
return
{
pass
=>
$pass
,
pass
=>
$pass
,
one_dbd
=>
$have_one_dbd
,
one_dbd
=>
$have_one_dbd
,
missing
=>
\%
missing
,
missing
=>
$
missing
,
optional
=>
\%
missing_optional
,
optional
=>
$
missing_optional
,
any_missing
=>
!
$pass
||
scalar
(
keys
%
missing_optional
),
any_missing
=>
!
$pass
||
scalar
(
@$
missing_optional
),
};
};
}
}
...
@@ -295,14 +295,14 @@ sub check_requirements {
...
@@ -295,14 +295,14 @@ sub check_requirements {
sub
_check_missing
{
sub
_check_missing
{
my
(
$modules
,
$output
)
=
@_
;
my
(
$modules
,
$output
)
=
@_
;
my
%
missing
;
my
@
missing
;
foreach
my
$module
(
@$modules
)
{
foreach
my
$module
(
@$modules
)
{
unless
(
have_vers
(
$module
,
$output
))
{
unless
(
have_vers
(
$module
,
$output
))
{
$missing
{
$module
->
{
package
}}
=
$module
;
push
(
@missing
,
$module
)
;
}
}
}
}
return
%
missing
;
return
\
@
missing
;
}
}
sub
print_module_instructions
{
sub
print_module_instructions
{
...
@@ -337,7 +337,7 @@ EOT
...
@@ -337,7 +337,7 @@ EOT
}
}
# Required Modules
# Required Modules
if
(
my
%
missing
=
%
{
$check_results
->
{
missing
}})
{
if
(
my
@missing
=
@
{
$check_results
->
{
missing
}})
{
print
<<EOT;
print
<<EOT;
***********************************************************************
***********************************************************************
* REQUIRED MODULES *
* REQUIRED MODULES *
...
@@ -351,8 +351,8 @@ EOT
...
@@ -351,8 +351,8 @@ EOT
EOT
EOT
print
"COMMANDS:\n\n"
;
print
"COMMANDS:\n\n"
;
foreach
my
$package
(
keys
%
missing
)
{
foreach
my
$package
(
@
missing
)
{
my
$command
=
install_command
(
$
missing
{
$package
}
);
my
$command
=
install_command
(
$
package
);
print
" $command\n"
;
print
" $command\n"
;
}
}
print
"\n"
;
print
"\n"
;
...
@@ -386,7 +386,7 @@ EOT
...
@@ -386,7 +386,7 @@ EOT
return
unless
$output
;
return
unless
$output
;
if
(
my
%
missing
=
%
{
$check_results
->
{
optional
}})
{
if
(
my
@missing
=
@
{
$check_results
->
{
optional
}})
{
print
<<EOT;
print
<<EOT;
**********************************************************************
**********************************************************************
* OPTIONAL MODULES *
* OPTIONAL MODULES *
...
@@ -402,12 +402,8 @@ EOT
...
@@ -402,12 +402,8 @@ EOT
**********************************************************************
**********************************************************************
EOT
EOT
# We want to sort them so that they are ordered by feature.
my
@missing_names
=
sort
{
$missing
{
$a
}
->
{
feature
}
cmp
$missing
{
$b
}
->
{
feature
}}
(
keys
%
missing
);
# Now we have to determine how large the table cols will be.
# Now we have to determine how large the table cols will be.
my
$longest_name
=
max
(
map
(
length
(
$_
),
@missing_names
));
my
$longest_name
=
max
(
map
(
length
(
$_
->
{
package
}),
@missing
));
# The first column header is at least 11 characters long.
# The first column header is at least 11 characters long.
$longest_name
=
11
if
$longest_name
<
11
;
$longest_name
=
11
if
$longest_name
<
11
;
...
@@ -420,16 +416,16 @@ EOT
...
@@ -420,16 +416,16 @@ EOT
printf
"* \%${longest_name}s * %-${remaining_space}s *\n"
,
printf
"* \%${longest_name}s * %-${remaining_space}s *\n"
,
'MODULE NAME'
,
'ENABLES FEATURE(S)'
;
'MODULE NAME'
,
'ENABLES FEATURE(S)'
;
print
'*'
x
71
.
"\n"
;
print
'*'
x
71
.
"\n"
;
foreach
my
$
name
(
@missing_names
)
{
foreach
my
$
package
(
@missing
)
{
printf
"* \%${longest_name}s * %-${remaining_space}s *\n"
,
printf
"* \%${longest_name}s * %-${remaining_space}s *\n"
,
$
name
,
$missing
{
$name
}
->
{
feature
};
$
package
->
{
package
},
$package
->
{
feature
};
}
}
print
'*'
x
71
.
"\n"
;
print
'*'
x
71
.
"\n"
;
print
"COMMANDS TO INSTALL:\n\n"
;
print
"COMMANDS TO INSTALL:\n\n"
;
foreach
my
$module
(
@missing
_names
)
{
foreach
my
$module
(
@missing
)
{
my
$command
=
install_command
(
$m
issing
{
$module
}
);
my
$command
=
install_command
(
$m
odule
);
printf
"%15s: $command\n"
,
$module
;
printf
"%15s: $command\n"
,
$module
->
{
package
}
;
}
}
}
}
}
}
...
@@ -549,7 +545,6 @@ sub install_command {
...
@@ -549,7 +545,6 @@ sub install_command {
return
sprintf
$command
,
$package
;
return
sprintf
$command
,
$package
;
}
}
1
;
1
;
__END__
__END__
...
@@ -581,26 +576,46 @@ represent the name of the module and the version that we require.
...
@@ -581,26 +576,46 @@ represent the name of the module and the version that we require.
=over 4
=over 4
=item C<check_requirements($output)>
=item C<check_requirements>
Description: This checks what optional or required perl modules
=over
are installed, like C<checksetup.pl> does.
=item B<Description>
Params: C<$output> - C<true> if you want the function to print
out information about what it's doing,
This checks what optional or required perl modules are installed, like
and the versions of everything installed.
C<checksetup.pl> does.
If you don't pass the minimum requirements,
the will always print out something,
=item B<Params>
regardless of this parameter.
=over
Returns: A hashref containing three values:
C<pass> - Whether or not we have all the mandatory
=item C<$output> - C<true> if you want the function to print out information
requirements.
about what it's doing, and the versions of everything installed.
C<missing> - A hash showing which mandatory requirements
are missing. The key is the module name,
=back
and the value is the version we require.
C<optional> - Which optional modules are installed and
=item B<Returns>
up-to-date enough for Bugzilla.
A hashref containing these values:
=over
=item C<pass> - Whether or not we have all the mandatory requirements.
=item C<missing> - An arrayref containing any required modules that
are not installed or that are not up-to-date. Each item in the array is
a hashref in the format of items from L</REQUIRED_MODULES>.
=item C<optional> - The same as C<missing>, but for optional modules.
=item C<have_one_dbd> - True if at least one C<DBD::> module is installed.
=item C<any_missing> - True if there are any missing modules, even optional
modules.
=back
=back
=item C<check_graphviz($output)>
=item C<check_graphviz($output)>
...
...
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