[packages/python-pytz] - updated to 2013d - updated zoneinfo patch
qboosh
qboosh at pld-linux.org
Sun Sep 15 18:09:12 CEST 2013
commit 0dbea9c1886ad922ea3e2a5e8c6f62b777d78562
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Sep 15 18:09:21 2013 +0200
- updated to 2013d
- updated zoneinfo patch
python-pytz.spec | 11 +++++------
zoneinfo.patch | 28 ++++++++++++++--------------
2 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/python-pytz.spec b/python-pytz.spec
index 397d9bb..ac100c9 100644
--- a/python-pytz.spec
+++ b/python-pytz.spec
@@ -10,14 +10,15 @@
Summary: pytz - Olson timezone database in Python
Summary(pl.UTF-8): pytz - baza stref czasowych Olsona w Pythonie
Name: python-%{module}
-Version: 2013b
+Version: 2013d
Release: 1
License: MIT
Group: Libraries/Python
Source0: http://pypi.python.org/packages/source/p/pytz/%{module}-%{version}.tar.bz2
-# Source0-md5: 34f47470eedd5cd1faf6c3da2741967b
+# Source0-md5: 634c5fab45c6ebaf35985acf0080011f
Patch0: zoneinfo.patch
URL: http://pytz.sourceforge.net/
+BuildRequires: sed >= 4.0
%if %{with python2}
BuildRequires: python-devel >= 1:2.3
BuildRequires: python >= 1:2.3
@@ -64,10 +65,8 @@ przy użyciu Pythona 3.x
%setup -q -n %{module}-%{version}
# strip zones list before patching
-mv pytz/__init__.py pytz/__init__.py.old
-cat pytz/__init__.py.old | \
-%{__sed} -e "/^all_timezones = \\\/,/^ 'WET',/d" | %{__sed} -e "/^common_timezones = \\\/,/ 'UTC'/d" \
-> pytz/__init__.py
+%{__sed} -i -e "/^all_timezones = \\\\/,/^ 'Zulu'/d" \
+ -e "/^common_timezones = \\\\/,/ 'UTC'/d" pytz/__init__.py
%patch0 -p1
diff --git a/zoneinfo.patch b/zoneinfo.patch
index 2fee34e..03231bd 100644
--- a/zoneinfo.patch
+++ b/zoneinfo.patch
@@ -1,8 +1,8 @@
---- pytz-2010l/pytz/__init__.py 2010-11-19 12:30:02.768226674 +0200
-+++ pytz-2010l.new/pytz/__init__.py 2010-11-19 12:28:59.587810671 +0200
-@@ -43,24 +43,19 @@
- except NameError:
- from sets import Set as set
+--- pytz-2013d/pytz/__init__.py.orig 2013-09-15 18:04:41.913643693 +0200
++++ pytz-2013d/pytz/__init__.py 2013-09-15 18:06:35.450305595 +0200
+@@ -77,24 +77,19 @@
+ """
+ return s.encode('US-ASCII')
+_tzinfo_dir = os.getenv("TZDIR") or "/usr/share/zoneinfo"
+if _tzinfo_dir.endswith(os.sep):
@@ -29,13 +29,12 @@
return open(filename, 'rb')
-@@ -453,12 +448,30 @@
+@@ -489,11 +484,32 @@
if __name__ == '__main__':
_test()
-- 'Zulu']
--all_timezones = [
-- tz for tz in all_timezones if resource_exists(tz)]
+-all_timezones = LazyList(
+- tz for tz in all_timezones if resource_exists(tz))
+all_timezones = []
+for root, dirs, files in os.walk(_tzinfo_dir):
+ for exclude in "posix", "right":
@@ -48,10 +47,10 @@
+ and "." not in file)
+all_timezones.sort()
- all_timezones_set = set(all_timezones)
--common_timezones = [
-- tz for tz in common_timezones if tz in all_timezones]
--
+ all_timezones_set = LazySet(all_timezones)
+-common_timezones = LazyList(
+- tz for tz in common_timezones if tz in all_timezones)
++
+common_timezones = [l.split()[2]
+ for l in open(os.path.join(_tzinfo_dir, "zone.tab"))
+ if l != "" and l[0] != "#"]\
@@ -65,4 +64,5 @@
+ 'US/Pacific',
+ 'UTC']
+common_timezones.sort()
- common_timezones_set = set(common_timezones)
+
+ common_timezones_set = LazySet(common_timezones)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pytz.git/commitdiff/0dbea9c1886ad922ea3e2a5e8c6f62b777d78562
More information about the pld-cvs-commit
mailing list