Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 237625
Collapse All | Expand All

(-)a/layman/db.py (-5 / +5 lines)
Lines 24-30 __version__ = "$Id: db.py 309 2007-04-09 16:23:38Z wrobel $" Link Here
24
#
24
#
25
#-------------------------------------------------------------------------------
25
#-------------------------------------------------------------------------------
26
26
27
import os, codecs, os.path, urllib2, re, md5
27
import os, codecs, os.path, urllib2, re, hashlib
28
28
29
from   layman.utils             import path
29
from   layman.utils             import path
30
from   layman.overlay           import Overlays
30
from   layman.overlay           import Overlays
Lines 318-324 class RemoteDB(Overlays): Link Here
318
318
319
        OUT.debug('Generating cache path.', 6)
319
        OUT.debug('Generating cache path.', 6)
320
320
321
        return base + '_' + md5.md5(url).hexdigest() + '.xml'
321
        return base + '_' + hashlib.md5(url).hexdigest() + '.xml'
322
322
323
#===============================================================================
323
#===============================================================================
324
#
324
#
Lines 332-338 class MakeConf: Link Here
332
332
333
    Check that an add/remove cycle does not modify the make.conf:
333
    Check that an add/remove cycle does not modify the make.conf:
334
334
335
    >>> import md5
335
    >>> import hashlib
336
    >>> write = os.tmpnam()
336
    >>> write = os.tmpnam()
337
    >>> here = os.path.dirname(os.path.realpath(__file__))
337
    >>> here = os.path.dirname(os.path.realpath(__file__))
338
    >>> config = {'local_list' :
338
    >>> config = {'local_list' :
Lines 343-349 class MakeConf: Link Here
343
    ...           'quietness':3}
343
    ...           'quietness':3}
344
    >>> b = DB(config)
344
    >>> b = DB(config)
345
    >>> a = MakeConf(config, b.overlays)
345
    >>> a = MakeConf(config, b.overlays)
346
    >>> o_md5 = str(md5.md5(open(here + '/tests/testfiles/make.conf').read()).hexdigest())
346
    >>> o_md5 = str(hashlib.md5(open(here + '/tests/testfiles/make.conf').read()).hexdigest())
347
    >>> a.path = write
347
    >>> a.path = write
348
    >>> a.add(b.overlays['wrobel-stable'])
348
    >>> a.add(b.overlays['wrobel-stable'])
349
    >>> [i.name for i in a.overlays]
349
    >>> [i.name for i in a.overlays]
Lines 358-364 class MakeConf: Link Here
358
    >>> [i.name for i in a.overlays]
358
    >>> [i.name for i in a.overlays]
359
    [u'wrobel', u'wrobel-stable']
359
    [u'wrobel', u'wrobel-stable']
360
    >>> a.delete(b.overlays['wrobel'])
360
    >>> a.delete(b.overlays['wrobel'])
361
    >>> n_md5 = str(md5.md5(open(write).read()).hexdigest())
361
    >>> n_md5 = str(hashlib.md5(open(write).read()).hexdigest())
362
    >>> o_md5 == n_md5
362
    >>> o_md5 == n_md5
363
    True
363
    True
364
    >>> os.unlink(write)
364
    >>> os.unlink(write)
(-)a/layman/overlays/overlay.py (-6 / +2 lines)
Lines 24-30 __version__ = "$Id: overlay.py 273 2006-12-30 15:54:50Z wrobel $" Link Here
24
#
24
#
25
#-------------------------------------------------------------------------------
25
#-------------------------------------------------------------------------------
26
26
27
import sys, types, re, os, os.path, shutil, popen2
27
import sys, types, re, os, os.path, shutil, subprocess
28
28
29
from   layman.utils             import node_to_dict, dict_to_node, path
29
from   layman.utils             import node_to_dict, dict_to_node, path
30
30
Lines 160-171 class Overlay: Link Here
160
        if not self.quiet:
160
        if not self.quiet:
161
            return os.system(command)
161
            return os.system(command)
162
        else:
162
        else:
163
            cmd = popen2.Popen4(command)
163
            cmd = subprocess.Popen([command], stdout=PIPE, stderr=PIPE, close_fds=True)
164
            cmd.fromchild.readlines()
165
            result = cmd.wait()
164
            result = cmd.wait()
166
            cmd.fromchild.readlines()
167
            cmd.fromchild.close()
168
            cmd.tochild.close()
169
            return result
165
            return result
170
166
171
    def __str__(self):
167
    def __str__(self):

Return to bug 237625