From 7594e57b0542081cc284914cf198d5045edcdab8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 20 Jul 2007 20:19:35 +0000 Subject: [PATCH] - update_versions: don't accept a multi-file application unless there's a main program with same name as dir (previously it was treating the first executable file found as the main program, with occasionally disastrous consequences). svn path=/trunk/boinc/; revision=13201 --- checkin_notes | 9 +++++++++ tools/update_versions | 26 +++++--------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/checkin_notes b/checkin_notes index e5f0c01a5d..37d8239215 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7416,3 +7416,12 @@ David 20 July 2007 upper_case.C sched/ handle_request.C + +David 20 July 2007 + - update_versions: don't accept a multi-file application + unless there's a main program with same name as dir + (previously it was treating the first executable file found + as the main program, with occasionally disastrous consequences). + + tools/ + update_versions diff --git a/tools/update_versions b/tools/update_versions index 9fed6c36e4..0e25d3c6fd 100755 --- a/tools/update_versions +++ b/tools/update_versions @@ -10,25 +10,7 @@ config.xml must contain an which specifies the directory to search. apps/APPLICATION_NAME/ contains application versions for each application. -Filenames must be of the form NAME_VERSION_PLATFORM[.ext]. -The prefix name and extensions .gz, .exe, .sit are ignored. -Platform strings must match the names of platforms in the database. - -update_versions also handles subdirectories, -which contain files to bundle as a single app-version. -Subdirectory names are ignored. -Non-executable files can be arbitrarily named. - -Example setup: - - apps/boinc/boinc_7.17_i686-pc-linux-gnu.gz - apps/Astropulse/astropulse_7.17_windows_intelx86.exe - apps/SETI@home/sah_4.20_sparc-sun-solaris2.9.gz - apps/SETI@home/sah_4.20_i686-pc-linux-gnu.gz - apps/SETI@Home/sah_4.21_sparc-sun-solaris2.9/sah_4.21_sparc-sun-solaris2.9.gz - apps/SETI@Home/sah_4.21_sparc-sun-solaris2.9/sah_logo_1.0.jpg - apps/SETI@Home/sah_4.21_i686-pc-linux-gnu/sah_4.21_i686-pc-linux-gnu.gz - apps/SETI@Home/sah_4.21_i686-pc-linux-gnu/sah_logo_1.0.jpg +See http://boinc.berkeley.edu/trac/wiki/UpdateVersions """ @@ -181,6 +163,7 @@ def find_versions__process_bundle(app, match, dir): signature_files = {} file_ref_infos = {} dirname = os.path.basename(dir) + found_main = False for filepath in xlistdir(dir): if os.path.isdir(filepath): continue @@ -188,6 +171,7 @@ def find_versions__process_bundle(app, match, dir): # the filename matches the folder name, # so this is the main program executable. exec_files.insert(0, filepath) + found_main = True continue # if filename is of format 'EXECFILE.sig' treat it as signature file if filepath.endswith('.sig'): @@ -202,8 +186,8 @@ def find_versions__process_bundle(app, match, dir): exec_files.append(filepath) continue; non_exec_files.append(filepath) - if not exec_files: - print >>sys.stderr, " Ignoring directory (no executable found - it has to be named the same as the directory)", dir + if not found_main: + print >>sys.stderr, " Ignoring directory (no main program found - it has to be named the same as the directory)", dir return # check signatures, file_path_infos