diff options
author | Gunnar Wrobel <p@rdus.de> | 2008-11-14 20:58:07 +0000 |
---|---|---|
committer | Gunnar Wrobel <p@rdus.de> | 2008-11-14 20:58:07 +0000 |
commit | 9a2684da6dec776f074def7e656736aec404a476 (patch) | |
tree | e5a9e1362af4fce8a29237fe9b390546605b2de2 /layman/db.py | |
parent | d81bfb86c68b86532a1eb8853b182987583e38fb (diff) | |
download | layman-9a2684da6dec776f074def7e656736aec404a476.tar.gz layman-9a2684da6dec776f074def7e656736aec404a476.tar.bz2 layman-9a2684da6dec776f074def7e656736aec404a476.zip |
* layman/db.py (RemoteDB.path): Use the hashlib library (#237625).
http://bugs.gentoo.org/show_bug.cgi?id=237625
* layman/overlays/overlay.py (Overlay.cmd): Use the subprocess
module (#237625).
http://bugs.gentoo.org/show_bug.cgi?id=237625
Diffstat (limited to 'layman/db.py')
-rw-r--r-- | layman/db.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/layman/db.py b/layman/db.py index edb8ac0..64b2421 100644 --- a/layman/db.py +++ b/layman/db.py @@ -24,7 +24,7 @@ __version__ = "$Id: db.py 309 2007-04-09 16:23:38Z wrobel $" # #------------------------------------------------------------------------------- -import os, codecs, os.path, urllib2, re, md5 +import os, codecs, os.path, urllib2, re, hashlib from layman.utils import path from layman.overlay import Overlays @@ -321,7 +321,7 @@ class RemoteDB(Overlays): OUT.debug('Generating cache path.', 6) - return base + '_' + md5.md5(url).hexdigest() + '.xml' + return base + '_' + hashlib.md5(url).hexdigest() + '.xml' #=============================================================================== # @@ -335,7 +335,7 @@ class MakeConf: Check that an add/remove cycle does not modify the make.conf: - >>> import md5 + >>> import hashlib >>> write = os.tmpnam() >>> here = os.path.dirname(os.path.realpath(__file__)) >>> config = {'local_list' : @@ -346,7 +346,7 @@ class MakeConf: ... 'quietness':3} >>> b = DB(config) >>> a = MakeConf(config, b.overlays) - >>> o_md5 = str(md5.md5(open(here + '/tests/testfiles/make.conf').read()).hexdigest()) + >>> o_md5 = str(hashlib.md5(open(here + '/tests/testfiles/make.conf').read()).hexdigest()) >>> a.path = write >>> a.add(b.overlays['wrobel-stable']) >>> [i.name for i in a.overlays] @@ -361,7 +361,7 @@ class MakeConf: >>> [i.name for i in a.overlays] [u'wrobel', u'wrobel-stable'] >>> a.delete(b.overlays['wrobel']) - >>> n_md5 = str(md5.md5(open(write).read()).hexdigest()) + >>> n_md5 = str(hashlib.md5(open(write).read()).hexdigest()) >>> o_md5 == n_md5 True >>> os.unlink(write) |