diff --git a/IPython/upgrade_dir.py b/IPython/upgrade_dir.py index e45bdbf..4eda389 100644 --- a/IPython/upgrade_dir.py +++ b/IPython/upgrade_dir.py @@ -36,13 +36,14 @@ def upgrade_dir(srcdir, tgtdir): def pr(s): print s - + junk = ['.svn','ipythonrc*','*.pyc', '*~', '.hg'] + def ignorable(p): - if p.lower().startswith('.svn') or p.startswith('ipythonrc'): - return True + for pat in junk: + if p.startswith(pat) or p.fnmatch(pat): + return True return False - modded = [] files = [path(srcdir).relpathto(p) for p in path(srcdir).walkfiles()] #print files @@ -67,7 +68,7 @@ def upgrade_dir(srcdir, tgtdir): sum = rpt.get(str(tgt), None) #print sum if sum and md5.new(cont).hexdigest() == sum: - pr("Unedited, installing new %s" % tgt) + pr("%s: Unedited, installing new version" % tgt) tgt.write_text(src.text()) rpt[str(tgt)] = md5.new(tgt.text()).hexdigest() else: @@ -76,7 +77,7 @@ def upgrade_dir(srcdir, tgtdir): real = showdiff(tgt,src) pr('') # empty line if not real: - pr("(Ok, it wasn't that different at all, upgrading checksum)") + pr("(Ok, it was identical, only upgrading checksum)") rpt[str(tgt)] = md5.new(tgt.text()).hexdigest() else: modded.append(tgt) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8806175..901e63f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2007-04-19 Ville Vainio + + * upgrade_dir.py: skip junk files like *.pyc + 2007-04-18 Ville Vainio * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1