summaryrefslogtreecommitdiff
path: root/sysutils/xentools33/patches/patch-ff
diff options
context:
space:
mode:
authorcegger <cegger@pkgsrc.org>2010-05-05 06:12:35 +0000
committercegger <cegger@pkgsrc.org>2010-05-05 06:12:35 +0000
commit71afcf730d001e4437c8aa47f99aaa758bb3733d (patch)
treef046ede9f5153e6b6c87b6bee9197cfc0b6da1ff /sysutils/xentools33/patches/patch-ff
parenta9158902ff15ca2f5f1628bce323c3d2e465fe45 (diff)
downloadpkgsrc-71afcf730d001e4437c8aa47f99aaa758bb3733d.tar.gz
Apply c/s 19609 from upstream:
xend: Avoid deprecation warnings with Python 2.6. http://xenbits.xensource.com/xen-unstable.hg/rev/4d6029814742 Fixes PR pkg/43231 Add LICENSE Bump pkgversion
Diffstat (limited to 'sysutils/xentools33/patches/patch-ff')
-rw-r--r--sysutils/xentools33/patches/patch-ff36
1 files changed, 36 insertions, 0 deletions
diff --git a/sysutils/xentools33/patches/patch-ff b/sysutils/xentools33/patches/patch-ff
new file mode 100644
index 00000000000..9bd163209b4
--- /dev/null
+++ b/sysutils/xentools33/patches/patch-ff
@@ -0,0 +1,36 @@
+$NetBSD: patch-ff,v 1.1 2010/05/05 06:12:36 cegger Exp $
+
+--- python/xen/util/acmpolicy.py.orig 2009-08-06 12:56:37.000000000 +0000
++++ python/xen/util/acmpolicy.py
+@@ -17,12 +17,19 @@
+ #============================================================================
+
+ import os
+-import sha
+ import stat
+ import array
+ import struct
+ import shutil
+ import commands
++
++# sha is deprecated as of python 2.6
++try:
++ from hashlib import sha1
++except ImportError:
++ # but hashlib was only added in python 2.5
++ from sha import new as sha1
++
+ from xml.dom import minidom, Node
+ from xen.xend.XendLogging import log
+ from xen.util import xsconstants, bootloader, mkdir
+@@ -1102,8 +1109,8 @@ class ACMPolicy(XSPolicy):
+ return None
+
+ def hash(self):
+- """ Calculate a SAH1 hash of the XML policy """
+- return sha.sha(self.toxml())
++ """ Calculate a SHA1 hash of the XML policy """
++ return sha1(self.toxml())
+
+ def save(self):
+ ### Save the XML policy into a file ###