##// END OF EJS Templates
Update md5 calls.
Thomas Kluyver -
Show More
@@ -11,7 +11,7 b' try:'
11 except ImportError:
11 except ImportError:
12 from path import path
12 from path import path
13
13
14 import md5, pickle
14 import hashlib, pickle
15
15
16 def showdiff(old,new):
16 def showdiff(old,new):
17 import difflib
17 import difflib
@@ -59,23 +59,23 b' def upgrade_dir(srcdir, tgtdir):'
59 pr("Creating %s" % str(tgt))
59 pr("Creating %s" % str(tgt))
60
60
61 tgt.write_text(src.text())
61 tgt.write_text(src.text())
62 rpt[str(tgt)] = md5.new(tgt.text()).hexdigest()
62 rpt[str(tgt)] = hashlib.md5(tgt.text()).hexdigest()
63 else:
63 else:
64 cont = tgt.text()
64 cont = tgt.text()
65 sum = rpt.get(str(tgt), None)
65 sum = rpt.get(str(tgt), None)
66 #print sum
66 #print sum
67 if sum and md5.new(cont).hexdigest() == sum:
67 if sum and hashlib.md5(cont).hexdigest() == sum:
68 pr("%s: Unedited, installing new version" % tgt)
68 pr("%s: Unedited, installing new version" % tgt)
69 tgt.write_text(src.text())
69 tgt.write_text(src.text())
70 rpt[str(tgt)] = md5.new(tgt.text()).hexdigest()
70 rpt[str(tgt)] = hashlib.md5(tgt.text()).hexdigest()
71 else:
71 else:
72 pr(' == Modified, skipping %s, diffs below == ' % tgt)
72 pr(' == Modified, skipping %s, diffs below == ' % tgt)
73 #rpt[str(tgt)] = md5.new(tgt.bytes()).hexdigest()
73 #rpt[str(tgt)] = hashlib.md5(tgt.bytes()).hexdigest()
74 real = showdiff(tgt,src)
74 real = showdiff(tgt,src)
75 pr('') # empty line
75 pr('') # empty line
76 if not real:
76 if not real:
77 pr("(Ok, it was identical, only upgrading checksum)")
77 pr("(Ok, it was identical, only upgrading checksum)")
78 rpt[str(tgt)] = md5.new(tgt.text()).hexdigest()
78 rpt[str(tgt)] = hashlib.md5(tgt.text()).hexdigest()
79 else:
79 else:
80 modded.append(tgt)
80 modded.append(tgt)
81
81
General Comments 0
You need to be logged in to leave comments. Login now