From a0153e5f0669099d4297a9210c0ae9bf3fb33f3d Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 31 May 2004 17:22:51 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3479 --- tools/update_versions | 66 +++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/tools/update_versions b/tools/update_versions index 1d25b0ac48..6afe8a80b0 100755 --- a/tools/update_versions +++ b/tools/update_versions @@ -162,41 +162,47 @@ def find_versions(app, dir): for filepath in xlistdir(dir): if os.path.islink(filepath): + # ignore symlinks continue if os.path.isdir(filepath): - # add executable + bundle as app/core version - exec_file = None - match = None - non_exec_files = [] - dir = filepath - for filepath in xlistdir(dir): - if os.path.isdir(filepath): - continue - if not match: - # no executable found yet, try this one - match = re_match_exec_filename(filepath) - if match: - # found an executable matching regexp - exec_file = filepath - continue - non_exec_files.append(filepath) - if not match: - print >>sys.stderr, " Ignoring directory", dir - continue - add_files(app=app, match=match, - exec_file=exec_file, - non_exec_files=non_exec_files, - min_core_version = min_core_version - ) + find_versions__process_bundle(filepath) else: - # add a single executable as app/core version + find_versions__process_single_file(filepath) + +def find_versions__process_single_file(filepath): + '''add a single executable as app/core version''' + match = re_match_exec_filename(filepath) + if not match: + print >>sys.stderr, " Ignoring unknown file", filepath + continue + add_files(app=app, match=match, exec_file=filepath, + min_core_version = min_core_version + ) + +def find_versions__process_bundle(dir): + '''add executable + bundle as app/core version''' + exec_file = None + match = None + non_exec_files = [] + for filepath in xlistdir(dir): + if os.path.isdir(filepath): + continue + if not match: + # no executable found yet, try this one match = re_match_exec_filename(filepath) - if not match: - print >>sys.stderr, " Ignoring unknown file", filepath + if match: + # found an executable matching regexp + exec_file = filepath continue - add_files(app=app, match=match, exec_file=filepath, - min_core_version = min_core_version - ) + non_exec_files.append(filepath) + if not match: + print >>sys.stderr, " Ignoring directory", dir + continue + add_files(app=app, match=match, + exec_file=exec_file, + non_exec_files=non_exec_files, + min_core_version = min_core_version + ) for appdir in xlistdir(config.app_dir): if not os.path.isdir(appdir): continue