tests/f
changeset 40306 da1629c7dda1
parent 40246 be0a5d2d5c78
child 43691 47ef023d0165
equal deleted inserted replaced
40305:6519f5aee06f 40306:da1629c7dda1
    86             if opts.links:
    86             if opts.links:
    87                 facts.append(b'links=%d' % stat.st_nlink)
    87                 facts.append(b'links=%d' % stat.st_nlink)
    88             if opts.newer:
    88             if opts.newer:
    89                 # mtime might be in whole seconds so newer file might be same
    89                 # mtime might be in whole seconds so newer file might be same
    90                 if stat.st_mtime >= os.stat(opts.newer).st_mtime:
    90                 if stat.st_mtime >= os.stat(opts.newer).st_mtime:
    91                     facts.append(b'newer than %s' % opts.newer)
    91                     facts.append(b'newer than %s' % opts.newer.encode(
       
    92                         'utf8', 'replace'))
    92                 else:
    93                 else:
    93                     facts.append(b'older than %s' % opts.newer)
    94                     facts.append(b'older than %s' % opts.newer.encode(
       
    95                         'utf8', 'replace'))
    94         if opts.md5 and content is not None:
    96         if opts.md5 and content is not None:
    95             h = hashlib.md5(content)
    97             h = hashlib.md5(content)
    96             facts.append(b'md5=%s' % binascii.hexlify(h.digest())[:opts.bytes])
    98             facts.append(b'md5=%s' % binascii.hexlify(h.digest())[:opts.bytes])
    97         if opts.sha1 and content is not None:
    99         if opts.sha1 and content is not None:
    98             h = hashlib.sha1(content)
   100             h = hashlib.sha1(content)