Skip to content

Commit f578158

Browse files
Merge branch 'release/4.2.2'
2 parents 25f9682 + 97fc41f commit f578158

File tree

4 files changed

+74
-20
lines changed

4 files changed

+74
-20
lines changed

docs/release-notes/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Notes
55
.. toctree::
66
:maxdepth: 2
77

8+
version-4.2.2.rst
89
version-4.2.1.rst
910
version-4.2.0.rst
1011

docs/release-notes/version-4.2.2.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
=============
2+
Version 4.2.2
3+
=============
4+
5+
Version 4.2.2 of mod_wsgi can be obtained from:
6+
7+
https://github.com/GrahamDumpleton/mod_wsgi/archive/4.2.2.tar.gz
8+
9+
Known Issues
10+
------------
11+
12+
1. The makefiles for building mod_wsgi on Windows are currently broken and
13+
need updating. As most new changes relate to mod_wsgi daemon mode, which is
14+
not supported under Windows, you should keep using the last available
15+
binary for version 3.X on Windows instead.
16+
17+
Bugs Fixed
18+
----------
19+
20+
1. The ``envvars`` file was being overwritten even if it existed and had
21+
been modified.
22+
23+
New Features
24+
------------
25+
26+
1. Output the location of the ``envvars`` file when using the
27+
``setup-server`` command for ``mod_wsgi-express`` or if using the
28+
``start-server`` command and the ``--envars-script`` option was being used.
29+
30+
2. Output the location of the ``apachectl`` script when using the
31+
``setup-server`` command for ``mod_wsgi-express``.

src/server/__init__.py

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ def generate_apache_config(options):
402402
mount_point=mount_point, directory=directory,
403403
filename=filename), file=fp)
404404

405-
print(APACHE_ALIAS_DOCUMENTATION % options, file=fp)
405+
if options['enable_docs']:
406+
print(APACHE_ALIAS_DOCUMENTATION % options, file=fp)
406407

407408
if options['error_documents']:
408409
for status, document in options['error_documents']:
@@ -781,9 +782,15 @@ def generate_control_scripts(options):
781782
os.chmod(path, 0o755)
782783

783784
path = os.path.join(options['server_root'], 'envvars')
784-
with open(path, 'w') as fp:
785-
if options['envvars_script']:
786-
print(APACHE_ENVVARS_FILE.lstrip() % options, file=fp)
785+
786+
if options['envvars_script']:
787+
with open(path, 'w') as fp:
788+
if options['envvars_script']:
789+
print(APACHE_ENVVARS_FILE.lstrip() % options, file=fp)
790+
791+
elif not os.path.isfile(path):
792+
with open(path, 'w') as fp:
793+
pass
787794

788795
def check_percentage(option, opt_str, value, parser):
789796
if value is not None and value < 0 or value > 1:
@@ -1055,17 +1062,17 @@ def check_percentage(option, opt_str, value, parser):
10551062
'be made available at the /__wsgi__/docs sub URL.'),
10561063
)
10571064

1058-
def cmd_setup_server(params, usage=None):
1065+
def cmd_setup_server(params):
10591066
formatter = optparse.IndentedHelpFormatter()
10601067
formatter.set_long_opt_delimiter(' ')
10611068

1062-
usage = usage or '%prog setup-server script [options]'
1069+
usage = '%prog setup-server script [options]'
10631070
parser = optparse.OptionParser(usage=usage, option_list=option_list,
10641071
formatter=formatter)
10651072

10661073
(options, args) = parser.parse_args(params)
10671074

1068-
return _cmd_setup_server(args, vars(options))
1075+
_cmd_setup_server('setup-server', args, vars(options))
10691076

10701077
def _mpm_module_defines(modules_directory):
10711078
result = []
@@ -1076,7 +1083,7 @@ def _mpm_module_defines(modules_directory):
10761083
result.append('-DWSGI_MPM_%s_MODULE' % name.upper())
10771084
return result
10781085

1079-
def _cmd_setup_server(args, options):
1086+
def _cmd_setup_server(command, args, options):
10801087
options['mod_wsgi_so'] = where()
10811088

10821089
options['working_directory'] = options['working_directory'] or os.getcwd()
@@ -1326,29 +1333,44 @@ def _cmd_setup_server(args, options):
13261333
generate_apache_config(options)
13271334
generate_control_scripts(options)
13281335

1329-
print('Server URL :', options['url'])
1336+
print('Server URL :', options['url'])
13301337

13311338
if options['server_status']:
1332-
print('Server Status :', '%sserver-status' % options['url'])
1339+
print('Server Status :', '%sserver-status' % options['url'])
13331340

1334-
print('Server Root :', options['server_root'])
1335-
print('Server Conf :', options['httpd_conf'])
1341+
print('Server Root :', options['server_root'])
1342+
print('Server Conf :', options['httpd_conf'])
13361343

1337-
print('Error Log :', options['error_log'])
1344+
print('Error Log File :', options['error_log'])
13381345

13391346
if options['access_log']:
1340-
print('Access Log :', os.path.join(options['log_directory'],
1341-
'access_log'))
1347+
print('Access Log File :', os.path.join(options['log_directory'],
1348+
'access_log'))
1349+
1350+
if options['envvars_script']:
1351+
print('Environ Variables :', options['envvars_script'])
1352+
1353+
if command == 'setup-server':
1354+
if not options['envvars_script']:
1355+
print('Environ Variables :', options['server_root'] + '/envvars')
1356+
print('Control Script :', options['server_root'] + '/apachectl')
13421357

13431358
return options
13441359

13451360
def cmd_start_server(params):
1361+
formatter = optparse.IndentedHelpFormatter()
1362+
formatter.set_long_opt_delimiter(' ')
1363+
13461364
usage = '%prog start-server script [options]'
1365+
parser = optparse.OptionParser(usage=usage, option_list=option_list,
1366+
formatter=formatter)
1367+
1368+
(options, args) = parser.parse_args(params)
13471369

1348-
options = cmd_setup_server(params, usage)
1370+
config = _cmd_setup_server('start-server', args, vars(options))
13491371

1350-
executable = os.path.join(options['server_root'], 'apachectl')
1351-
name = executable.ljust(len(options['process_name']))
1372+
executable = os.path.join(config['server_root'], 'apachectl')
1373+
name = executable.ljust(len(config['process_name']))
13521374
os.execl(executable, name, 'start', '-DNO_DETACH')
13531375

13541376
def cmd_install_module(params):

src/server/wsgi_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 4
2727
#define MOD_WSGI_MINORVERSION_NUMBER 2
28-
#define MOD_WSGI_MICROVERSION_NUMBER 1
29-
#define MOD_WSGI_VERSION_STRING "4.2.1"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 2
29+
#define MOD_WSGI_VERSION_STRING "4.2.2"
3030

3131
/* ------------------------------------------------------------------------- */
3232

0 commit comments

Comments
 (0)