diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-10-23 15:52:16 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-10-23 15:52:16 (GMT) |
commit | c42c0b76c6e353bdf836138151b6ee6274a241a8 (patch) | |
tree | 1f5ab3d9ef573b966672462454df0098a4c2a4ee /Mac/scripts/binhextree.py | |
parent | d2034c1a63a00a17049afc1986c869b5849cb70b (diff) | |
download | cpython-c42c0b76c6e353bdf836138151b6ee6274a241a8.zip cpython-c42c0b76c6e353bdf836138151b6ee6274a241a8.tar.gz cpython-c42c0b76c6e353bdf836138151b6ee6274a241a8.tar.bz2 |
Only copy project files from build* and plugins to the projects
folder, leave other projects where they are
Diffstat (limited to 'Mac/scripts/binhextree.py')
-rw-r--r-- | Mac/scripts/binhextree.py | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/Mac/scripts/binhextree.py b/Mac/scripts/binhextree.py index 535bc7b..b39cac9 100644 --- a/Mac/scripts/binhextree.py +++ b/Mac/scripts/binhextree.py @@ -23,6 +23,8 @@ TOP='' # Where to put CW projects, relative to TOP CWDIR=':Mac:mwerks:projects' +# From which folders to put projects there +CWDIRDIRS=['build.macppc.stand', 'build.macppc.shared', 'build.mac68k.stand', 'build.mac68k.shared', 'PlugIns'] # Helper routines def binhexit(path, name): @@ -80,13 +82,15 @@ def hexbincwprojects(creator): if srcfile[-1] == 'µ': dstfile = srcfile[:-1]+'mu.hqx' + elif srcfile[-3] == '.mu': + dstfile = srcfile + '.hqx' elif ord(srcfile[-1]) >= 128: dstfile = srcfile[:-1]+`ord(srcfile[-1])`+'.hqx' else: dstfile = srcfile + '.hqx' if os.path.exists(dstfile) and \ - os.stat(dstfile)[8] > os.stat(srcfile)[8]: + os.stat(dstfile)[8] >= os.stat(srcfile)[8]: print 'Skip', dstfile,'- Up-to-date' continue print 'Compacting', dstfile @@ -104,20 +108,26 @@ def copycwproject(path, name): global project_files dstdir = os.path.join(TOP, CWDIR) - if not os.path.exists(dstdir): - print dstdir - print 'No CW-project dir, skip', name - return - dstfile = os.path.join(dstdir, name) - # Check that we're not in the dest directory - if dstfile == path: + if path[:len(dstdir)] == dstdir: return + srcdir = os.path.split(path)[0] + srcdir = os.path.split(srcdir)[1] + if srcdir in CWDIRDIRS: + if not os.path.exists(dstdir): + print dstdir + print 'No CW-project dir, skip', name + return + dstfile = os.path.join(dstdir, name) + else: + if path[-2:] != '.µ': + return + dstfile = path[:-2]+ '.mu' # If the destination doesn't exists or is older that the source # we copy and remember it if os.path.exists(dstfile) and \ - os.stat(dstfile)[8] > os.stat(path)[8]: + os.stat(dstfile)[8] >= os.stat(path)[8]: print 'Not copying', path,'- Up-to-date' else: print 'Copy', path @@ -136,22 +146,28 @@ def copycwexpfile(path, name): global project_files dstdir = os.path.join(TOP, CWDIR) - if not os.path.exists(dstdir): - print dstdir - print 'No CW-project dir, skip', name + if path[:len(dstdir)] == dstdir: return - dstfile = os.path.join(dstdir, name) + srcdir = os.path.split(path)[0] + srcdir = os.path.split(srcdir)[1] + if srcdir in CWDIRDIRS: + if not os.path.exists(dstdir): + print dstdir + print 'No CW-project dir, skip', name + return + dstfile = os.path.join(dstdir, name) + else: + if path[-6:] != '.µ.exp': + return + dstfile = path[:-6] + '.mu.exp' if dstfile[-6:] == '.µ.exp': dstfile = dstfile[:-6]+'.mu.exp' - # Check that we're not in the dest directory - if dstfile == path: - return # If the destination doesn't exists or is older that the source # we copy and remember it if os.path.exists(dstfile) and \ - os.stat(dstfile)[8] > os.stat(path)[8]: + os.stat(dstfile)[8] >= os.stat(path)[8]: print 'Not copying', path,'- Up-to-date' else: print 'Copy', path |