1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00

Update to version 2.1.11.

Add fixes for python3.
Change master-site to CHEESESHOP.

PR:		205907
Submitted by:	Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
Approved by:	maintainer
This commit is contained in:
Dmitry Sivachenko 2016-01-10 19:01:17 +00:00
parent c67b1225c7
commit 44e231554b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=405739
5 changed files with 108 additions and 6 deletions

View File

@ -2,15 +2,16 @@
# $FreeBSD$
PORTNAME= ipaddr
PORTVERSION= 2.1.10
PORTREVISION= 1
PORTVERSION= 2.1.11
CATEGORIES= devel python
MASTER_SITES= GOOGLE_CODE
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= mopsfelder@gmail.com
COMMENT= Google open source IPv4/IPv6 manipulation library in Python
LICENSE= APACHE20
PROJECTHOST= ipaddr-py
USES= python
USE_PYTHON= distutils autoplist

View File

@ -1,2 +1,2 @@
SHA256 (ipaddr-2.1.10.tar.gz) = d2c3bfd45147e5773108d2c8d3c65102ff234f06e2f1049a0febfa31dde4cca3
SIZE (ipaddr-2.1.10.tar.gz) = 29004
SHA256 (ipaddr-2.1.11.tar.gz) = 1b555b8a8800134fdafe32b7d0cb52f5bdbfdd093707c3dd484c5ea59f1d98b7
SIZE (ipaddr-2.1.11.tar.gz) = 29046

View File

@ -0,0 +1,23 @@
--- ipaddr.py.orig 2014-01-31 21:22:32 UTC
+++ ipaddr.py
@@ -25,6 +25,11 @@ and networks.
__version__ = '2.1.11'
import struct
+import sys
+
+if sys.version_info > (3,):
+ long = int
+ xrange = range
IPV4LENGTH = 32
IPV6LENGTH = 128
@@ -1447,7 +1452,7 @@ class _BaseV6(object):
try:
# Now, parse the hextets into a 128-bit integer.
- ip_int = 0L
+ ip_int = long(0)
for i in xrange(parts_hi):
ip_int <<= 16
ip_int |= self._parse_hextet(parts[i])

View File

@ -0,0 +1,78 @@
--- ipaddr_test.py.orig 2016-01-05 00:38:35 UTC
+++ ipaddr_test.py
@@ -21,6 +21,10 @@
import unittest
import time
import ipaddr
+import sys
+
+if sys.version_info > (3,):
+ long = int
# Compatibility function to cast str to bytes objects
if issubclass(ipaddr.Bytes, str):
@@ -266,7 +270,7 @@ class IpaddrUnitTest(unittest.TestCase):
'2001:658:22a:cafe:200::1')
def testGetNetmask(self):
- self.assertEqual(int(self.ipv4.netmask), 4294967040L)
+ self.assertEqual(int(self.ipv4.netmask), 4294967040)
self.assertEqual(str(self.ipv4.netmask), '255.255.255.0')
self.assertEqual(str(self.ipv4_hostmask.netmask), '255.0.0.0')
self.assertEqual(int(self.ipv6.netmask),
@@ -283,7 +287,7 @@ class IpaddrUnitTest(unittest.TestCase):
self.assertEqual(ipv6_zero_netmask._prefix_from_prefix_string('0'), 0)
def testGetBroadcast(self):
- self.assertEqual(int(self.ipv4.broadcast), 16909311L)
+ self.assertEqual(int(self.ipv4.broadcast), 16909311)
self.assertEqual(str(self.ipv4.broadcast), '1.2.3.255')
self.assertEqual(int(self.ipv6.broadcast),
@@ -1100,9 +1104,9 @@ class IpaddrUnitTest(unittest.TestCase):
def testNetworkElementCaching(self):
# V4 - make sure we're empty
- self.assertFalse(self.ipv4._cache.has_key('network'))
- self.assertFalse(self.ipv4._cache.has_key('broadcast'))
- self.assertFalse(self.ipv4._cache.has_key('hostmask'))
+ self.assertFalse('network' in self.ipv4._cache)
+ self.assertFalse('broadcast' in self.ipv4._cache)
+ self.assertFalse('hostmask' in self.ipv4._cache)
# V4 - populate and test
self.assertEqual(self.ipv4.network, ipaddr.IPv4Address('1.2.3.0'))
@@ -1110,14 +1114,14 @@ class IpaddrUnitTest(unittest.TestCase):
self.assertEqual(self.ipv4.hostmask, ipaddr.IPv4Address('0.0.0.255'))
# V4 - check we're cached
- self.assertTrue(self.ipv4._cache.has_key('network'))
- self.assertTrue(self.ipv4._cache.has_key('broadcast'))
- self.assertTrue(self.ipv4._cache.has_key('hostmask'))
+ self.assertTrue('network' in self.ipv4._cache)
+ self.assertTrue('broadcast' in self.ipv4._cache)
+ self.assertTrue('hostmask' in self.ipv4._cache)
# V6 - make sure we're empty
- self.assertFalse(self.ipv6._cache.has_key('network'))
- self.assertFalse(self.ipv6._cache.has_key('broadcast'))
- self.assertFalse(self.ipv6._cache.has_key('hostmask'))
+ self.assertFalse('network' in self.ipv6._cache)
+ self.assertFalse('broadcast' in self.ipv6._cache)
+ self.assertFalse('hostmask' in self.ipv6._cache)
# V6 - populate and test
self.assertEqual(self.ipv6.network,
@@ -1128,9 +1132,9 @@ class IpaddrUnitTest(unittest.TestCase):
ipaddr.IPv6Address('::ffff:ffff:ffff:ffff'))
# V6 - check we're cached
- self.assertTrue(self.ipv6._cache.has_key('network'))
- self.assertTrue(self.ipv6._cache.has_key('broadcast'))
- self.assertTrue(self.ipv6._cache.has_key('hostmask'))
+ self.assertTrue('network' in self.ipv6._cache)
+ self.assertTrue('broadcast' in self.ipv6._cache)
+ self.assertTrue('hostmask' in self.ipv6._cache)
def testTeredo(self):
# stolen from wikipedia

View File

@ -4,4 +4,4 @@ IPv6 addresses and prefixes.
Development mailing list:
http://groups.google.com/group/ipaddr-py-dev
WWW: http://code.google.com/p/ipaddr-py/
WWW: https://github.com/google/ipaddr-py