Modified: subversion/branches/invoke-diff-cmd-feature/tools/dev/which-error.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/tools/dev/which-error.py?rev=1549081&r1=1549080&r2=1549081&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/tools/dev/which-error.py (original) +++ subversion/branches/invoke-diff-cmd-feature/tools/dev/which-error.py Sun Dec 8 17:56:46 2013 @@ -72,7 +72,8 @@ def get_errors(): ## errno values. errs.update(errno.errorcode) ## APR-defined errors, from apr_errno.h. - for line in open(os.path.join(os.path.dirname(sys.argv[0]), 'aprerr.txt')): + dirname = os.path.dirname(os.path.realpath(__file__)) + for line in open(os.path.join(dirname, 'aprerr.txt')): # aprerr.txt parsing duplicated in gen_base.py:write_errno_table() if line.startswith('#'): continue
Modified: subversion/branches/invoke-diff-cmd-feature/tools/dist/release.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/tools/dist/release.py?rev=1549081&r1=1549080&r2=1549081&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/tools/dist/release.py (original) +++ subversion/branches/invoke-diff-cmd-feature/tools/dist/release.py Sun Dec 8 17:56:46 2013 @@ -87,7 +87,12 @@ tool_versions = { 'trunk' : { 'autoconf' : '2.69', 'libtool' : '2.4.2', - 'swig' : '2.0.9', + 'swig' : '2.0.11', + }, + '1.9' : { + 'autoconf' : '2.69', + 'libtool' : '2.4.2', + 'swig' : '2.0.11' }, '1.8' : { 'autoconf' : '2.69', Modified: subversion/branches/invoke-diff-cmd-feature/tools/server-side/svn-rep-sharing-stats.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/tools/server-side/svn-rep-sharing-stats.c?rev=1549081&r1=1549080&r2=1549081&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/tools/server-side/svn-rep-sharing-stats.c (original) +++ subversion/branches/invoke-diff-cmd-feature/tools/server-side/svn-rep-sharing-stats.c Sun Dec 8 17:56:46 2013 @@ -79,7 +79,6 @@ help(const apr_getopt_option_t *options, ++options; } svn_error_clear(svn_cmdline_fprintf(stdout, pool, "\n")); - exit(0); } @@ -212,7 +211,7 @@ static svn_error_t *record(apr_hash_t *r */ key = apr_pcalloc(result_pool, sizeof(*key)); key->revision = rep->revision; - key->offset = rep->offset; + key->offset = rep->item_index; /* Update or create the value. */ if ((value = apr_hash_get(records, key, sizeof(*key)))) @@ -424,14 +423,17 @@ static svn_error_t *process(const char * return SVN_NO_ERROR; } -int -main(int argc, const char *argv[]) +/* + * On success, leave *EXIT_CODE untouched and return SVN_NO_ERROR. On error, + * either return an error to be displayed, or set *EXIT_CODE to non-zero and + * return SVN_NO_ERROR. + */ +static svn_error_t * +sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool) { const char *repos_path; - apr_pool_t *pool; svn_boolean_t prop = FALSE, data = FALSE; svn_boolean_t quiet = FALSE; - svn_error_t *err; apr_getopt_t *os; const apr_getopt_option_t options[] = { @@ -445,25 +447,12 @@ main(int argc, const char *argv[]) {0, 0, 0, 0} }; - /* Initialize the app. */ - if (svn_cmdline_init("svn-rep-sharing-stats", stderr) != EXIT_SUCCESS) - return EXIT_FAILURE; - - /* Create our top-level pool. Use a separate mutexless allocator, - * given this application is single threaded. - */ - pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE)); - /* Check library versions */ - err = check_lib_versions(); - if (err) - return svn_cmdline_handle_exit_error(err, pool, "svn-rep-sharing-stats: "); + SVN_ERR(check_lib_versions()); - err = svn_cmdline__getopt_init(&os, argc, argv, pool); - if (err) - return svn_cmdline_handle_exit_error(err, pool, "svn-rep-sharing-stats: "); + SVN_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool)); - SVN_INT_ERR(check_experimental()); + SVN_ERR(check_experimental()); os->interleave = 1; while (1) @@ -476,7 +465,8 @@ main(int argc, const char *argv[]) if (status != APR_SUCCESS) { usage(pool); - return EXIT_FAILURE; + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } switch (opt) { @@ -496,14 +486,14 @@ main(int argc, const char *argv[]) break; case 'h': help(options, pool); - break; + return SVN_NO_ERROR; case OPT_VERSION: - SVN_INT_ERR(version(pool)); - exit(0); - break; + SVN_ERR(version(pool)); + return SVN_NO_ERROR; default: usage(pool); - return EXIT_FAILURE; + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } } @@ -513,23 +503,51 @@ main(int argc, const char *argv[]) if (os->ind + 1 != argc || (!data && !prop)) { usage(pool); - return EXIT_FAILURE; + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } /* Grab REPOS_PATH from argv. */ - SVN_INT_ERR(svn_utf_cstring_to_utf8(&repos_path, os->argv[os->ind], pool)); + SVN_ERR(svn_utf_cstring_to_utf8(&repos_path, os->argv[os->ind], pool)); repos_path = svn_dirent_internal_style(repos_path, pool); set_up_cancellation(); /* Do something. */ - SVN_INT_ERR(process(repos_path, prop, data, quiet, pool)); + SVN_ERR(process(repos_path, prop, data, quiet, pool)); /* We're done. */ + return SVN_NO_ERROR; +} - svn_pool_destroy(pool); - /* Flush stdout to make sure that the user will see any printing errors. */ - SVN_INT_ERR(svn_cmdline_fflush(stdout)); +int +main(int argc, const char *argv[]) +{ + apr_pool_t *pool; + int exit_code = EXIT_SUCCESS; + svn_error_t *err; + + /* Initialize the app. */ + if (svn_cmdline_init("svn-rep-sharing-stats", stderr) != EXIT_SUCCESS) + return EXIT_FAILURE; + + /* Create our top-level pool. Use a separate mutexless allocator, + * given this application is single threaded. + */ + pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE)); + + err = sub_main(&exit_code, argc, argv, pool); + + /* Flush stdout and report if it fails. It would be flushed on exit anyway + but this makes sure that output is not silently lost if it fails. */ + err = svn_error_compose_create(err, svn_cmdline_fflush(stdout)); - return EXIT_SUCCESS; + if (err) + { + exit_code = EXIT_FAILURE; + svn_cmdline_handle_exit_error(err, NULL, "svn-rep-sharing-stats: "); + } + + svn_pool_destroy(pool); + return exit_code; } Modified: subversion/branches/invoke-diff-cmd-feature/tools/server-side/svnauthz.c URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/tools/server-side/svnauthz.c?rev=1549081&r1=1549080&r2=1549081&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/tools/server-side/svnauthz.c (original) +++ subversion/branches/invoke-diff-cmd-feature/tools/server-side/svnauthz.c Sun Dec 8 17:56:46 2013 @@ -382,42 +382,6 @@ subcommand_accessof(apr_getopt_t *os, vo #undef EXIT_FAILURE #define EXIT_FAILURE 2 -/* Similar to svn_cmdline_handle_exit_error but with an exit_code argument - so we can comply with our contract and exit with 2 for internal failures. - Also is missing the pool argument since we don't need it given - main/sub_main. */ -static int -handle_exit_error(svn_error_t *err, const char *prefix, int exit_code) -{ - /* Issue #3014: - * Don't print anything on broken pipes. The pipe was likely - * closed by the process at the other end. We expect that - * process to perform error reporting as necessary. - * - * ### This assumes that there is only one error in a chain for - * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */ - if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR) - svn_handle_error2(err, stderr, FALSE, prefix); - svn_error_clear(err); - return exit_code; -} - -/* Report and clear the error ERR, and return EXIT_FAILURE. */ -#define EXIT_ERROR(err, exit_code) \ - handle_exit_error(err, "svnauthz: ", exit_code) - -/* A redefinition of the public SVN_INT_ERR macro, that suppresses the - * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR, amd with the - * program name 'svnauthz' instead of 'svn'. */ -#undef SVN_INT_ERR -#define SVN_INT_ERR(expr) \ - do { \ - svn_error_t *svn_err__temp = (expr); \ - if (svn_err__temp) \ - return EXIT_ERROR(svn_err__temp, EXIT_FAILURE); \ - } while (0) - - /* Return TRUE if the UI of 'svnauthz-validate' (svn 1.7 and earlier) should be emulated, given argv[0]. */ static svn_boolean_t @@ -485,8 +449,13 @@ canonicalize_access_file(const char **ca return SVN_NO_ERROR; } -static int -sub_main(int argc, const char *argv[], apr_pool_t *pool) +/* + * On success, leave *EXIT_CODE untouched and return SVN_NO_ERROR. On error, + * either return an error to be displayed, or set *EXIT_CODE to non-zero and + * return SVN_NO_ERROR. + */ +static svn_error_t * +sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool) { svn_error_t *err; @@ -497,7 +466,7 @@ sub_main(int argc, const char *argv[], a int i; /* Initialize the FS library. */ - SVN_INT_ERR(svn_fs_initialize(pool)); + SVN_ERR(svn_fs_initialize(pool)); received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int)); @@ -506,7 +475,7 @@ sub_main(int argc, const char *argv[], a opt_state.txn = opt_state.repos_path = opt_state.groups_file = NULL; /* Parse options. */ - SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool)); + SVN_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool)); os->interleave = 1; if (!use_compat_mode(argv[0], pool)) @@ -521,8 +490,9 @@ sub_main(int argc, const char *argv[], a break; if (status != APR_SUCCESS) { - SVN_INT_ERR(subcommand_help(NULL, NULL, pool)); - return EXIT_FAILURE; + SVN_ERR(subcommand_help(NULL, NULL, pool)); + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } /* Stash the option code in an array before parsing it. */ @@ -535,7 +505,7 @@ sub_main(int argc, const char *argv[], a opt_state.help = TRUE; break; case 't': - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.txn, arg, pool)); + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.txn, arg, pool)); break; case 'R': opt_state.recursive = TRUE; @@ -544,28 +514,29 @@ sub_main(int argc, const char *argv[], a opt_state.version = TRUE; break; case svnauthz__username: - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.username, arg, pool)); + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.username, arg, pool)); break; case svnauthz__path: - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.fspath, arg, pool)); + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.fspath, arg, pool)); opt_state.fspath = svn_fspath__canonicalize(opt_state.fspath, pool); break; case svnauthz__repos: - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.repos_name, arg, pool)); + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.repos_name, arg, pool)); break; case svnauthz__is: - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.is, arg, pool)); + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.is, arg, pool)); break; case svnauthz__groups_file: - SVN_INT_ERR( + SVN_ERR( svn_utf_cstring_to_utf8(&opt_state.groups_file, arg, pool)); break; default: { - SVN_INT_ERR(subcommand_help(NULL, NULL, pool)); - return EXIT_FAILURE; + SVN_ERR(subcommand_help(NULL, NULL, pool)); + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } } } @@ -603,8 +574,9 @@ sub_main(int argc, const char *argv[], a { svn_error_clear(svn_cmdline_fprintf(stderr, pool, ("subcommand argument required\n"))); - SVN_INT_ERR(subcommand_help(NULL, NULL, pool)); - return EXIT_FAILURE; + SVN_ERR(subcommand_help(NULL, NULL, pool)); + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } } else @@ -616,14 +588,15 @@ sub_main(int argc, const char *argv[], a const char *first_arg_utf8; os->ind++; - SVN_INT_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8, + SVN_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8, first_arg, pool)); svn_error_clear( svn_cmdline_fprintf(stderr, pool, ("Unknown subcommand: '%s'\n"), first_arg_utf8)); - SVN_INT_ERR(subcommand_help(NULL, NULL, pool)); - return EXIT_FAILURE; + SVN_ERR(subcommand_help(NULL, NULL, pool)); + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } } } @@ -637,13 +610,12 @@ sub_main(int argc, const char *argv[], a { if (os->ind +2 != argc) { - err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - ("Repository and authz file arguments " - "required")); - return EXIT_ERROR(err, EXIT_FAILURE); + return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + ("Repository and authz file arguments " + "required")); } - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.repos_path, os->argv[os->ind], + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.repos_path, os->argv[os->ind], pool)); os->ind++; @@ -653,24 +625,23 @@ sub_main(int argc, const char *argv[], a /* Exactly 1 non-option argument */ if (os->ind + 1 != argc) { - err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - ("Authz file argument required")); - return EXIT_ERROR(err, EXIT_FAILURE); + return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + ("Authz file argument required")); } /* Grab AUTHZ_FILE from argv. */ - SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.authz_file, os->argv[os->ind], + SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.authz_file, os->argv[os->ind], pool)); /* Canonicalize opt_state.authz_file appropriately. */ - SVN_INT_ERR(canonicalize_access_file(&opt_state.authz_file, + SVN_ERR(canonicalize_access_file(&opt_state.authz_file, opt_state.authz_file, opt_state.txn != NULL, pool)); /* Same for opt_state.groups_file if it is present. */ if (opt_state.groups_file) { - SVN_INT_ERR(canonicalize_access_file(&opt_state.groups_file, + SVN_ERR(canonicalize_access_file(&opt_state.groups_file, opt_state.groups_file, opt_state.txn != NULL, pool)); } @@ -696,13 +667,14 @@ sub_main(int argc, const char *argv[], a pool); svn_opt_format_option(&optstr, badopt, FALSE, pool); if (subcommand->name[0] == '-') - SVN_INT_ERR(subcommand_help(NULL, NULL, pool)); + SVN_ERR(subcommand_help(NULL, NULL, pool)); else svn_error_clear(svn_cmdline_fprintf(stderr, pool, ("Subcommand '%s' doesn't accept option '%s'\n" "Type 'svnauthz help %s' for usage.\n"), subcommand->name, optstr, subcommand->name)); - return EXIT_FAILURE; + *exit_code = EXIT_FAILURE; + return SVN_NO_ERROR; } } @@ -724,7 +696,8 @@ sub_main(int argc, const char *argv[], a { /* Follow our contract that says we exit with 1 if the file does not validate. */ - return EXIT_ERROR(err, 1); + *exit_code = 1; + return err; } else if (err->apr_err == SVN_ERR_AUTHZ_UNREADABLE || err->apr_err == SVN_ERR_AUTHZ_UNWRITABLE @@ -732,31 +705,22 @@ sub_main(int argc, const char *argv[], a { /* Follow our contract that says we exit with 3 if --is does not * match. */ - return EXIT_ERROR(err, 3); + *exit_code = 3; + return err; } - - return EXIT_ERROR(err, EXIT_FAILURE); - } - else - { - /* Ensure that everything is written to stdout, so the user will - see any print errors. */ - err = svn_cmdline_fflush(stdout); - if (err) - { - return EXIT_ERROR(err, EXIT_FAILURE); - } - return EXIT_SUCCESS; + return err; } + return SVN_NO_ERROR; } int main(int argc, const char *argv[]) { apr_pool_t *pool; - int exit_code; + int exit_code = EXIT_SUCCESS; + svn_error_t *err; /* Initialize the app. Send all error messages to 'stderr'. */ if (svn_cmdline_init(argv[0], stderr) != EXIT_SUCCESS) @@ -764,7 +728,18 @@ main(int argc, const char *argv[]) pool = svn_pool_create(NULL); - exit_code = sub_main(argc, argv, pool); + err = sub_main(&exit_code, argc, argv, pool); + + /* Flush stdout and report if it fails. It would be flushed on exit anyway + but this makes sure that output is not silently lost if it fails. */ + err = svn_error_compose_create(err, svn_cmdline_fflush(stdout)); + + if (err) + { + if (exit_code == 0) + exit_code = EXIT_FAILURE; + svn_cmdline_handle_exit_error(err, NULL, "svnauthz: "); + } svn_pool_destroy(pool); return exit_code; Modified: subversion/branches/invoke-diff-cmd-feature/win-tests.py URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/win-tests.py?rev=1549081&r1=1549080&r2=1549081&view=diff ============================================================================== --- subversion/branches/invoke-diff-cmd-feature/win-tests.py (original) +++ subversion/branches/invoke-diff-cmd-feature/win-tests.py Sun Dec 8 17:56:46 2013 @@ -480,15 +480,9 @@ class Httpd: self._create_mime_types_file() self._create_dontdothat_file() - # Determine version. - if os.path.exists(os.path.join(self.httpd_dir, - 'modules', 'mod_access_compat.so')): - self.httpd_ver = 2.3 - elif os.path.exists(os.path.join(self.httpd_dir, - 'modules', 'mod_auth_basic.so')): - self.httpd_ver = 2.2 - else: - self.httpd_ver = 2.0 + # Obtain version. + version_vals = gen_obj._libraries['httpd'].version.split('.') + self.httpd_ver = float('%s.%s' % (version_vals[0], version_vals[1])) # Create httpd config file fp = open(self.httpd_config, 'w') @@ -777,42 +771,59 @@ if not test_javahl and not test_swig: os.chdir(old_cwd) elif test_javahl: failed = False - args = ( - 'java.exe', - '-Dtest.rootdir=' + os.path.join(abs_builddir, 'javahl'), - '-Dtest.srcdir=' + os.path.join(abs_srcdir, - 'subversion/bindings/javahl'), - '-Dtest.rooturl=', - '-Dtest.fstype=' + fs_type , - '-Dtest.tests=', - - '-Djava.library.path=' - + os.path.join(abs_objdir, - 'subversion/bindings/javahl/native'), - '-classpath', - os.path.join(abs_srcdir, 'subversion/bindings/javahl/classes') +';' + - gen_obj.junit_path - ) - - sys.stderr.flush() - print('Running org.apache.subversion tests:') - sys.stdout.flush() - - r = subprocess.call(args + tuple(['org.apache.subversion.javahl.RunTests'])) - sys.stdout.flush() - sys.stderr.flush() - if (r != 0): - print('[Test runner reported failure]') - failed = True - print('Running org.tigris.subversion tests:') - sys.stdout.flush() - r = subprocess.call(args + tuple(['org.tigris.subversion.javahl.RunTests'])) - sys.stdout.flush() - sys.stderr.flush() - if (r != 0): - print('[Test runner reported failure]') - failed = True + java_exe = None + + for path in os.environ["PATH"].split(os.pathsep): + if os.path.isfile(os.path.join(path, 'java.exe')): + java_exe = os.path.join(path, 'java.exe') + break + + if not java_exe and 'java_sdk' in gen_obj._libraries: + jdk = gen_obj._libraries['java_sdk'] + + if os.path.isfile(os.path.join(jdk.lib_dir, '../bin/java.exe')): + java_exe = os.path.join(jdk.lib_dir, '../bin/java.exe') + + if not java_exe: + print('Java not found. Skipping Java tests') + else: + args = ( + os.path.abspath(java_exe), + '-Dtest.rootdir=' + os.path.join(abs_builddir, 'javahl'), + '-Dtest.srcdir=' + os.path.join(abs_srcdir, + 'subversion/bindings/javahl'), + '-Dtest.rooturl=', + '-Dtest.fstype=' + fs_type , + '-Dtest.tests=', + + '-Djava.library.path=' + + os.path.join(abs_objdir, + 'subversion/bindings/javahl/native'), + '-classpath', + os.path.join(abs_srcdir, 'subversion/bindings/javahl/classes') +';' + + gen_obj.junit_path + ) + + sys.stderr.flush() + print('Running org.apache.subversion tests:') + sys.stdout.flush() + + r = subprocess.call(args + tuple(['org.apache.subversion.javahl.RunTests'])) + sys.stdout.flush() + sys.stderr.flush() + if (r != 0): + print('[Test runner reported failure]') + failed = True + + print('Running org.tigris.subversion tests:') + sys.stdout.flush() + r = subprocess.call(args + tuple(['org.tigris.subversion.javahl.RunTests'])) + sys.stdout.flush() + sys.stderr.flush() + if (r != 0): + print('[Test runner reported failure]') + failed = True elif test_swig == 'perl': failed = False swig_dir = os.path.join(abs_builddir, 'swig')
