# # # patch "mtn_cvs/Makefile.am" # from [73dd27dce68661307ee44586c295af7bd45ff62f] # to [91ba0dce3d5288e59235e04740602fee525ee8d1] # # patch "mtn_cvs/mtn_cvs.cc" # from [afe34352c504140e1a5a5f7bccf2d25e5f9fa745] # to [33b59c42628e132428e54dfc2132e997ac9efbd3] # # patch "mtn_cvs/options_list.hh" # from [a27b04c31de840bfb62ce90d1b88d0277deb6476] # to [006d75ccf96a01f649bb415437235328bf0e0802] # ============================================================ --- mtn_cvs/Makefile.am 73dd27dce68661307ee44586c295af7bd45ff62f +++ mtn_cvs/Makefile.am 91ba0dce3d5288e59235e04740602fee525ee8d1 @@ -13,7 +13,7 @@ mtn_cvs_SOURCES = options.cc cvs_sync.cc mtn_cvs_SOURCES = options.cc cvs_sync.cc cvs_client.cc mtn_cvs.cc \ mtn_pipe.cc mtn_automate.cc mtncvs_state.cc \ - cvs_revision_nr.cc cvs_edge.cc + cvs_revision_nr.cc cvs_edge.cc ../unix/main.cc AM_LDFLAGS = -L. -L.. mtn_cvs_LDADD = -lmtn -lplatform -l3rdparty $(BOOSTLIBS) ============================================================ --- mtn_cvs/mtn_cvs.cc afe34352c504140e1a5a5f7bccf2d25e5f9fa745 +++ mtn_cvs/mtn_cvs.cc 33b59c42628e132428e54dfc2132e997ac9efbd3 @@ -181,77 +181,6 @@ using boost::shared_ptr; using std::ios_base; using boost::shared_ptr; -#if 0 -static void -tokenize_for_command_line(string const & from, vector & to) -{ - // Unfortunately, the tokenizer in basic_io is too format-specific - to.clear(); - enum quote_type {none, one, two}; - string cur; - quote_type type = none; - bool have_tok(false); - - for (string::const_iterator i = from.begin(); i != from.end(); ++i) - { - if (*i == '\'') - { - if (type == none) - type = one; - else if (type == one) - type = none; - else - { - cur += *i; - have_tok = true; - } - } - else if (*i == '"') - { - if (type == none) - type = two; - else if (type == two) - type = none; - else - { - cur += *i; - have_tok = true; - } - } - else if (*i == '\\') - { - if (type != one) - ++i; - N(i != from.end(), F("Invalid escape in --xargs file")); - cur += *i; - have_tok = true; - } - else if (string(" \n\t").find(*i) != string::npos) - { - if (type == none) - { - if (have_tok) - to.push_back(cur); - cur.clear(); - have_tok = false; - } - else - { - cur += *i; - have_tok = true; - } - } - else - { - cur += *i; - have_tok = true; - } - } - if (have_tok) - to.push_back(cur); -} -#endif - // This is in a sepaarte procedure so it can be called from code that's called // before cpp_main(), such as program option object creation code. It's made // so it can be called multiple times as well. @@ -294,7 +223,7 @@ string read_options(options & opts, vect return cmd; } -int +int cpp_main(int argc, char ** argv) { int ret = 0; @@ -318,7 +247,7 @@ cpp_main(int argc, char ** argv) // Set up secure memory allocation etc botan_library acquire_botan; - + // Record where we are. This has to happen before any use of // boost::filesystem. save_initial_path(); @@ -349,57 +278,13 @@ cpp_main(int argc, char ** argv) try { string cmd = read_options(app.opts, args); - + if (app.opts.version_given) { print_version(); return 0; } -#if 0 - if (option::full.given(vm)) app.full=true; - - if (option::since.given(vm)) app.since=string(option::since.get(vm)); - - if (option::branch.given(vm)) - { L(FL("branch %s") % option::branch.get(vm)); - app.branch=option::branch.get(vm); - } - - if (option::revision.given(vm)) - { L(FL("revision %s") % option::revision.get(vm)); - app.revisions.push_back(revision_id(option::revision.get(vm))); - } - - if (option::help.given(vm)) requested_help = true; - - if (option::mtn.given(vm)) app.mtn_binary = option::mtn.get(vm); - - if (option::db.given(vm)) - app.mtn_options.push_back(string("--db=")+option::db.get(vm)); - - if (option::rcfile.given(vm)) - app.mtn_options.push_back(string("--rcfile=")+option::rcfile.get(vm)); - - if (option::nostd.given(vm)) - app.mtn_options.push_back(string("--nostd")); - - if (option::norc.given(vm)) - app.mtn_options.push_back(string("--norc")); - - if (option::keydir.given(vm)) - app.mtn_options.push_back(string("--keydir=")+option::keydir.get(vm)); - - if (option::root.given(vm)) - app.mtn_options.push_back(string("--root=")+option::root.get(vm)); - - if (option::confdir.given(vm)) - app.mtn_options.push_back(string("--confdir=")+option::confdir.get(vm)); - - if (option::key.given(vm)) - app.mtn_options.push_back(string("--key=")+option::key.get(vm)); -#endif - // stop here if they asked for help if (app.opts.help) { @@ -487,6 +372,7 @@ cpp_main(int argc, char ** argv) return 3; } +#if 0 int main(int argc, char **argv) { @@ -502,4 +388,4 @@ main(int argc, char **argv) return 3; } } +#endif - ============================================================ --- mtn_cvs/options_list.hh a27b04c31de840bfb62ce90d1b88d0277deb6476 +++ mtn_cvs/options_list.hh 006d75ccf96a01f649bb415437235328bf0e0802 @@ -9,6 +9,12 @@ OPTVAR(globals, std::vector, args, OPTSET(globals) OPTVAR(globals, std::vector, args, ) +OPTION(globals, positionals, true, "--", "") +#ifdef option_bodies +{ + args.push_back(utf8(arg)); +} +#endif OPTVAR(branch, utf8, branch_name, ) OPTION(branch, branch, true, "branch,b", N_("select branch cert for operation"))