Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=f6838d5364434127be3763d823d3db6a515964fd

commit f6838d5364434127be3763d823d3db6a515964fd
Author: Miklos Vajna <[email protected]>
Date:   Tue Dec 30 01:00:07 2008 +0100

python scripts: use hashlib instead of sha

The warning:

DeprecationWarning: the sha module is deprecated; use the hashlib module instead

should be fixed by this.

diff --git a/darcs-git.py b/darcs-git.py
index 911ec00..f4798bb 100755
--- a/darcs-git.py
+++ b/darcs-git.py
@@ -22,7 +22,7 @@

__version__ = "0.7"

-import sys, tty, termios, os, re, getopt, sha
+import sys, tty, termios, os, re, getopt, hashlib

class File:
def __init__(self):
@@ -510,7 +510,7 @@ Options:
if options.help:
usage(0)
if os.system("git rev-parse --verify HEAD >/dev/null 2>&1"):
-               options.head = sha.sha("tree 0\0").hexdigest()
+               options.head = hashlib.sha1("tree 0\0").hexdigest()
os.system("git update-index --refresh >/dev/null")
ret = os.system("git diff %s -M -C --find-copies-harder --exit-code %s %s" % 
(options.head, options.summary, options.files))
if not ret:
diff --git a/pear-makefb b/pear-makefb
index f0905fc..9ad0326 100755
--- a/pear-makefb
+++ b/pear-makefb
@@ -6,7 +6,7 @@ __date__ = "Thu, 19 Oct 2006 00:18:19 +0200"
__copyright__ = "Copyright (c) 2006 Miklos Vajna"
__license__ = "GPL"

-import os, urllib, sys, sha
+import os, urllib, sys, hashlib
from xml.dom import minidom
from email.Utils import formatdate

@@ -109,7 +109,7 @@ local = open('%s-%s.tgz' % (name, pkgver), 'w')
local.write(remote.read())
remote.close()
local.close()
-ctx = sha.new()
+ctx = hashlib.new("sha1")
sock = open('%s-%s.tgz' % (name, pkgver))
while True:
buf = sock.read(16384)
diff --git a/syncpkgd/syncpkgd.py b/syncpkgd/syncpkgd.py
index ddf03db..93c310c 100644
--- a/syncpkgd/syncpkgd.py
+++ b/syncpkgd/syncpkgd.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python

-import sys, getopt, os, pwd, sha, time, base64, re, pickle, signal
+import sys, getopt, os, pwd, hashlib, time, base64, re, pickle, signal
sys.path.append("/etc/syncpkgd")
from SimpleXMLRPCServer import SimpleXMLRPCServer
from dconfig import config
@@ -27,7 +27,7 @@ class Actions:

def __login(self, login, password):
if login in config.passes.keys() and \
-                       sha.sha(password).hexdigest() == config.passes[login]:
+                       hashlib.sha1(password).hexdigest() == 
config.passes[login]:
if login not in self.lags.keys():
self.lags[login] = time.time()
return True
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to