##// END OF EJS Templates
upgrade_dir.py: skip junk files like *.pyc
vivainio -
Show More
@@ -36,13 +36,14 b' def upgrade_dir(srcdir, tgtdir):'
36 36
37 37 def pr(s):
38 38 print s
39
39 junk = ['.svn','ipythonrc*','*.pyc', '*~', '.hg']
40
40 41 def ignorable(p):
41 if p.lower().startswith('.svn') or p.startswith('ipythonrc'):
42 return True
42 for pat in junk:
43 if p.startswith(pat) or p.fnmatch(pat):
44 return True
43 45 return False
44 46
45
46 47 modded = []
47 48 files = [path(srcdir).relpathto(p) for p in path(srcdir).walkfiles()]
48 49 #print files
@@ -67,7 +68,7 b' def upgrade_dir(srcdir, tgtdir):'
67 68 sum = rpt.get(str(tgt), None)
68 69 #print sum
69 70 if sum and md5.new(cont).hexdigest() == sum:
70 pr("Unedited, installing new %s" % tgt)
71 pr("%s: Unedited, installing new version" % tgt)
71 72 tgt.write_text(src.text())
72 73 rpt[str(tgt)] = md5.new(tgt.text()).hexdigest()
73 74 else:
@@ -76,7 +77,7 b' def upgrade_dir(srcdir, tgtdir):'
76 77 real = showdiff(tgt,src)
77 78 pr('') # empty line
78 79 if not real:
79 pr("(Ok, it wasn't that different at all, upgrading checksum)")
80 pr("(Ok, it was identical, only upgrading checksum)")
80 81 rpt[str(tgt)] = md5.new(tgt.text()).hexdigest()
81 82 else:
82 83 modded.append(tgt)
@@ -1,3 +1,7 b''
1 2007-04-19 Ville Vainio <vivainio@gmail.com>
2
3 * upgrade_dir.py: skip junk files like *.pyc
4
1 5 2007-04-18 Ville Vainio <vivainio@gmail.com>
2 6
3 7 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
General Comments 0
You need to be logged in to leave comments. Login now