[packages/python-ago] - rel 2; correctly calculate for python3

arekm arekm at pld-linux.org
Thu Apr 10 21:21:45 CEST 2014


commit 89529fee66213ea14f67f5dee3860bdfa3680606
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Apr 10 21:21:42 2014 +0200

    - rel 2; correctly calculate for python3

 ago-python3.patch | 17 +++++++++++++++++
 python-ago.spec   |  4 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/python-ago.spec b/python-ago.spec
index 35503b3..ff3feda 100644
--- a/python-ago.spec
+++ b/python-ago.spec
@@ -8,11 +8,12 @@
 Summary:	Makes customizable human readable timedeltas
 Name:		python-ago
 Version:	0.0.6
-Release:	1
+Release:	2
 License:	public domain
 Group:		Development/Languages/Python
 Source0:	https://pypi.python.org/packages/source/a/ago/ago-%{version}.tar.gz
 # Source0-md5:	e2fdc21fb922b4fc21ec19c6eac6bd46
+Patch0:		ago-python3.patch
 URL:		https://bitbucket.org/russellballestrini/ago/overview
 %if %{with python2}
 BuildRequires:	python-devel
@@ -41,6 +42,7 @@ Makes customizable human readable timedeltas.
 
 %prep
 %setup  -q -n ago-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
diff --git a/ago-python3.patch b/ago-python3.patch
new file mode 100644
index 0000000..ce030a4
--- /dev/null
+++ b/ago-python3.patch
@@ -0,0 +1,17 @@
+diff -urN ago-0.0.6.org/ago.py ago-0.0.6/ago.py
+--- ago-0.0.6.org/ago.py	2014-02-25 17:44:03.000000000 +0100
++++ ago-0.0.6/ago.py	2014-04-10 21:19:49.563889851 +0200
+@@ -5,10 +5,10 @@
+     """Accepts a delta, returns a dictionary of units"""
+     delta = abs( delta )
+     return { 
+-        'year'   : int(delta.days / 365),
++        'year'   : int(delta.days // 365),
+         'day'    : int(delta.days % 365),
+-        'hour'   : int(delta.seconds / 3600),
+-        'minute' : int(delta.seconds / 60) % 60,
++        'hour'   : int(delta.seconds // 3600),
++        'minute' : int(delta.seconds // 60) % 60,
+         'second' : delta.seconds % 60,
+         'microsecond' : delta.microseconds
+     }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-ago.git/commitdiff/89529fee66213ea14f67f5dee3860bdfa3680606



More information about the pld-cvs-commit mailing list