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
cf90f796
Commit
cf90f796
authored
Sep 10, 2016
by
Frédéric Buclin
Committed by
Dylan William Hardison
Sep 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1260020 - Use Win32::GetConsoleOutputCP() instead of Win32::Console::OutputCP()
parent
1e2027a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
Util.pm
Bugzilla/Install/Util.pm
+8
-11
Makefile.PL
Makefile.PL
+5
-2
No files found.
Bugzilla/Install/Util.pm
View file @
cf90f796
...
...
@@ -24,6 +24,8 @@ use POSIX qw(setlocale LC_CTYPE);
use
Scalar::
Util
qw(tainted)
;
use
Term::
ANSIColor
qw(colored)
;
use
PerlIO
;
use
if
ON_WINDOWS
,
'Win32'
;
use
if
ON_WINDOWS
,
'Win32::API'
;
use
parent
qw(Exporter)
;
our
@EXPORT_OK
=
qw(
...
...
@@ -73,10 +75,8 @@ sub get_version_and_os {
my
@os_details
=
POSIX::
uname
;
# 0 is the name of the OS, 2 is the major version,
my
$os_name
=
$os_details
[
0
]
.
' '
.
$os_details
[
2
];
if
(
ON_WINDOWS
)
{
require
Win32
;
$os_name
=
Win32::
GetOSName
();
}
$os_name
=
Win32::
GetOSName
()
if
ON_WINDOWS
;
# $os_details[3] is the minor version.
return
{
bz_ver
=>
BUGZILLA_VERSION
,
perl_ver
=>
sprintf
(
'%vd'
,
$
^
V
),
...
...
@@ -582,11 +582,10 @@ sub set_output_encoding {
return
if
grep
(
/^encoding/
,
@stdout_layers
);
my
$encoding
;
if
(
ON_WINDOWS
and
eval
{
require
Win32::
Console
}
)
{
if
(
ON_WINDOWS
)
{
# Although setlocale() works on Windows, it doesn't always return
# the current *console's* encoding. So we use OutputCP here instead,
# when we can.
$encoding
=
Win32::Console::
OutputCP
();
# the current *console's* encoding.
$encoding
=
Win32::
GetConsoleOutputCP
();
}
else
{
my
$locale
=
setlocale
(
LC_CTYPE
);
...
...
@@ -643,9 +642,7 @@ sub prevent_windows_dialog_boxes {
# during checksetup (since loading DBD::Oracle during checksetup when
# Oracle isn't installed causes a scary popup and pauses checksetup).
#
# Win32::API ships with ActiveState by default, though there could
# theoretically be a Windows installation without it, I suppose.
if
(
ON_WINDOWS
and
eval
{
require
Win32::
API
})
{
if
(
ON_WINDOWS
)
{
# Call kernel32.SetErrorMode with arguments that mean:
# "The system does not display the critical-error-handler message box.
# Instead, the system sends the error to the calling process." and
...
...
Makefile.PL
View file @
cf90f796
...
...
@@ -87,8 +87,11 @@ my %all_features = (
# Windows requires some additional modules.
if
(
$^O
eq
'MSWin32'
)
{
$requires
{
'Win32'
}
=
'0.35'
;
$requires
{
'Win32::API'
}
=
'0.55'
;
# 0.45 implements the GetConsoleOutputCP() method.
# It also supports Windows 7. Set this to 0.52 to support Windows 10.
$requires
{
'Win32'
}
=
'0.45'
;
# 0.63 fixes a problem with Strawberry Perl 5.14.1.
$requires
{
'Win32::API'
}
=
'0.63'
;
$requires
{
'DateTime::TimeZone::Local::Win32'
}
=
'1.64'
;
}
...
...
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