[Python-modules-commits] r19024 - in packages/python-django/trunk/debian (4 files)

hertzog at users.alioth.debian.org hertzog at users.alioth.debian.org
Sat Oct 22 07:43:02 UTC 2011


    Date: Saturday, October 22, 2011 @ 07:43:01
  Author: hertzog
Revision: 19024

Add 06_use_debian_geoip_database_as_default.diff to use the default
location of the GeoIP database used by the Debian package
geoip-database-contrib. Closes: #645094
Add this package to suggests. Thanks to Tapio Rantala
<tapio.rantala at iki.fi> for the patch.

Added:
  packages/python-django/trunk/debian/patches/06_use_debian_geoip_database_as_default.diff
Modified:
  packages/python-django/trunk/debian/changelog
  packages/python-django/trunk/debian/control
  packages/python-django/trunk/debian/patches/series

Modified: packages/python-django/trunk/debian/changelog
===================================================================
--- packages/python-django/trunk/debian/changelog	2011-10-21 18:54:58 UTC (rev 19023)
+++ packages/python-django/trunk/debian/changelog	2011-10-22 07:43:01 UTC (rev 19024)
@@ -1,3 +1,13 @@
+python-django (1.3.1-3) UNRELEASED; urgency=low
+
+  * Add 06_use_debian_geoip_database_as_default.diff to use the default
+    location of the GeoIP database used by the Debian package
+    geoip-database-contrib. Closes: #645094
+    Add this package to suggests. Thanks to Tapio Rantala
+    <tapio.rantala at iki.fi> for the patch.
+
+ -- Raphaël Hertzog <hertzog at debian.org>  Sat, 22 Oct 2011 09:39:28 +0200
+
 python-django (1.3.1-2) unstable; urgency=low
 
   * Update Build-Depends on locales to included a version requirement

Modified: packages/python-django/trunk/debian/control
===================================================================
--- packages/python-django/trunk/debian/control	2011-10-21 18:54:58 UTC (rev 19023)
+++ packages/python-django/trunk/debian/control	2011-10-22 07:43:01 UTC (rev 19024)
@@ -14,7 +14,7 @@
 Architecture: all
 Depends: ${misc:Depends}, ${python:Depends}
 Recommends: libjs-jquery
-Suggests: python-psycopg2, python-psycopg, python-mysqldb, python-flup, python-sqlite, python-yaml
+Suggests: python-psycopg2, python-psycopg, python-mysqldb, python-flup, python-sqlite, python-yaml, geoip-database-contrib
 Description: High-level Python web development framework
  Django is a high-level web application framework that loosely follows the
  model-view-controller design pattern.

Added: packages/python-django/trunk/debian/patches/06_use_debian_geoip_database_as_default.diff
===================================================================
--- packages/python-django/trunk/debian/patches/06_use_debian_geoip_database_as_default.diff	                        (rev 0)
+++ packages/python-django/trunk/debian/patches/06_use_debian_geoip_database_as_default.diff	2011-10-22 07:43:01 UTC (rev 19024)
@@ -0,0 +1,58 @@
+Description: Use Debian GeoIP database path as default
+ Default to Debian standard path for GeoIP directory and for GeoIP city
+ file. Avoids the need to declare them in each project.
+ .
+ This is a Debian specific patch.
+Bug-Debian: http://bugs.debian.org/645094
+Forwarded: not-needed
+Author: Tapio Rantala <tapio.rantala at iki.fi>
+
+--- a/django/contrib/gis/utils/geoip.py
++++ b/django/contrib/gis/utils/geoip.py
+@@ -164,7 +164,8 @@ class GeoIP(object):
+         * path: Base directory to where GeoIP data is located or the full path
+             to where the city or country data files (*.dat) are located.
+             Assumes that both the city and country data sets are located in
+-            this directory; overrides the GEOIP_PATH settings attribute.
++            this directory. Overrides the GEOIP_PATH settings attribute.
++            If neither is set, defaults to '/usr/share/GeoIP'.
+ 
+         * cache: The cache settings when opening up the GeoIP datasets,
+             and may be an integer in (0, 1, 2, 4) corresponding to
+@@ -173,11 +174,13 @@ class GeoIP(object):
+             respectively.  Defaults to 0, meaning that the data is read
+             from the disk.
+ 
+-        * country: The name of the GeoIP country data file.  Defaults to
+-            'GeoIP.dat'; overrides the GEOIP_COUNTRY settings attribute.
++        * country: The name of the GeoIP country data file. Overrides
++            the GEOIP_COUNTRY settings attribute. If neither is set,
++            defaults to 'GeoIP.dat'
+ 
+-        * city: The name of the GeoIP city data file.  Defaults to
+-            'GeoLiteCity.dat'; overrides the GEOIP_CITY settings attribute.
++        * city: The name of the GeoIP city data file. Overrides the
++            GEOIP_CITY settings attribute. If neither is set, defaults
++            to 'GeoIPCity.dat'.
+         """
+         # Checking the given cache option.
+         if cache in self.cache_options:
+@@ -187,8 +190,7 @@ class GeoIP(object):
+ 
+         # Getting the GeoIP data path.
+         if not path:
+-            path = GEOIP_SETTINGS.get('GEOIP_PATH', None)
+-            if not path: raise GeoIPException('GeoIP path must be provided via parameter or the GEOIP_PATH setting.')
++            path = GEOIP_SETTINGS.get('GEOIP_PATH', '/usr/share/GeoIP')
+         if not isinstance(path, basestring):
+             raise TypeError('Invalid path type: %s' % type(path).__name__)
+ 
+@@ -201,7 +203,7 @@ class GeoIP(object):
+                 self._country = geoip_open(country_db, cache)
+                 self._country_file = country_db
+ 
+-            city_db = os.path.join(path, city or GEOIP_SETTINGS.get('GEOIP_CITY', 'GeoLiteCity.dat'))
++            city_db = os.path.join(path, city or GEOIP_SETTINGS.get('GEOIP_CITY', 'GeoIPCity.dat'))
+             if os.path.isfile(city_db):
+                 self._city = geoip_open(city_db, cache)
+                 self._city_file = city_db

Modified: packages/python-django/trunk/debian/patches/series
===================================================================
--- packages/python-django/trunk/debian/patches/series	2011-10-21 18:54:58 UTC (rev 19023)
+++ packages/python-django/trunk/debian/patches/series	2011-10-22 07:43:01 UTC (rev 19024)
@@ -3,3 +3,4 @@
 03_manpage.diff
 04_hyphen-manpage.diff
 05_fix_djangodocs_sphinx_ext.diff
+06_use_debian_geoip_database_as_default.diff




More information about the Python-modules-commits mailing list