[pycsw] 01/02: Add patch to support overriding PYCSW_ROOT via environment variable.

Bas Couwenberg sebastic at debian.org
Mon Jul 11 21:21:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pycsw.

commit 47139693197aad23db3d7f5eaaee5eb2ece6903b
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Mon Jul 11 21:42:18 2016 +0200

    Add patch to support overriding PYCSW_ROOT via environment variable.
    
    Fixes path to config files for tests installed by wsgi package.
---
 debian/changelog                |  8 ++++++++
 debian/patches/pycsw-root.patch | 33 +++++++++++++++++++++++++++++++++
 debian/patches/series           |  1 +
 debian/pycsw.conf               |  1 +
 4 files changed, 43 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2c2a5f9..49f1fac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pycsw (2.0.0+dfsg-1~exp2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Add patch to support overriding PYCSW_ROOT via environment variable.
+    Fixes path to config files for tests installed by wsgi package.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 11 Jul 2016 21:39:09 +0200
+
 pycsw (2.0.0+dfsg-1~exp1) experimental; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/pycsw-root.patch b/debian/patches/pycsw-root.patch
new file mode 100644
index 0000000..f1e6523
--- /dev/null
+++ b/debian/patches/pycsw-root.patch
@@ -0,0 +1,33 @@
+Description: Support overriding PYCSW_ROOT via environment variable.
+ Relative paths from wsgi.py to tests are different between build and
+ installation environment. The defaults work for the build environment only.
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/pycsw/wsgi.py
++++ b/pycsw/wsgi.py
+@@ -70,18 +70,23 @@ def application(env, start_response):
+     if 'PYCSW_CONFIG' in env:
+         config = env['PYCSW_CONFIG']
+ 
++    root = PYCSW_ROOT
++
++    if 'PYCSW_ROOT' in env:
++        root = env['PYCSW_ROOT']
++
+     if env['QUERY_STRING'].lower().find('config') != -1:
+         for kvp in env['QUERY_STRING'].split('&'):
+             if kvp.lower().find('config') != -1:
+                 config = unquote(kvp.split('=')[1])
+ 
+     if not os.path.isabs(config):
+-        config = os.path.join(PYCSW_ROOT, config)
++        config = os.path.join(root, config)
+ 
+     if 'HTTP_HOST' in env and ':' in env['HTTP_HOST']:
+         env['HTTP_HOST'] = env['HTTP_HOST'].split(':')[0]
+ 
+-    env['local.app_root'] = PYCSW_ROOT
++    env['local.app_root'] = root
+ 
+     csw = server.Csw(config, env)
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 6c39d05..e9bdbc2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 0006-Don-t-include-external-references-to-images.patch
 pavement.patch
 offline-tests.patch
+pycsw-root.patch
diff --git a/debian/pycsw.conf b/debian/pycsw.conf
index 4d037f2..2f706d2 100644
--- a/debian/pycsw.conf
+++ b/debian/pycsw.conf
@@ -4,5 +4,6 @@ Alias /pycsw/tests /usr/share/pycsw/tests
 <LocationMatch /pycsw>
   Options +FollowSymLinks 
   Require all granted
+  SetEnv PYCSW_ROOT /usr/share/pycsw
 </LocationMatch>
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pycsw.git



More information about the Pkg-grass-devel mailing list