# # patch "ChangeLog" # from [e82e8b186856cd80765c372655b8fdb05398eb24] # to [49aa09817e0067e3849e6807c09e4496d5a8fa2d] # # patch "app_state.cc" # from [fd3e1deba7b7e624fbd20f765baf96b74fda7cb6] # to [bffe24c585ea92098bc0013787e0fcc07a13af5c] # # patch "app_state.hh" # from [70bf85df97ed32d4671b8ebf219bdde7ec851397] # to [397ffb8acbff1ede6b7ed235481deb090ba177d4] # # patch "key_store.cc" # from [90b1da1b21ccd13d0de9285462f8a708773f0ecf] # to [92f4fc2b3b1ac16c869de4aae95e9ca9fb2774d0] # ======================================================================== --- ChangeLog e82e8b186856cd80765c372655b8fdb05398eb24 +++ ChangeLog 49aa09817e0067e3849e6807c09e4496d5a8fa2d @@ -1,5 +1,10 @@ 2005-10-16 Timothy Brownawell + * app_state.{cc,hh}, key_store.cc: change how the keystore directory + is initialized; was using app.confdir before it was ready + +2005-10-16 Timothy Brownawell + Make the configuration directory configurable and available to lua * lua.cc: export new function to lua, "get_confdir" * app_state.{cc,hh} monotone.cc options.hh: new option --confdir, ======================================================================== --- app_state.cc fd3e1deba7b7e624fbd20f765baf96b74fda7cb6 +++ app_state.cc bffe24c585ea92098bc0013787e0fcc07a13af5c @@ -40,10 +40,11 @@ depth(-1), last(-1), diff_format(unified_diff), diff_args_provided(false), use_lca(false), execute(false), bind_address(""), bind_port(""), missing(false), unknown(false), - confdir(system_path(get_homedir()) / ".monotone") + confdir(system_path(get_homedir()) / ".monotone"), have_set_key_dir(false) { db.set_app(this); lua.set_app(this); + keys.set_key_dir(confdir / "keys"); } app_state::~app_state() @@ -260,7 +261,11 @@ void app_state::set_key_dir(system_path const & filename) { - if (!filename.empty()) keys.set_key_dir(filename); + if (!filename.empty()) + { + keys.set_key_dir(filename); + have_set_key_dir = true; + } options[keydir_option] = filename.as_internal(); } @@ -410,6 +415,8 @@ app_state::set_confdir(system_path const & cd) { confdir = cd; + if (!have_set_key_dir) + keys.set_key_dir(cd / "keys"); } system_path ======================================================================== --- app_state.hh 70bf85df97ed32d4671b8ebf219bdde7ec851397 +++ app_state.hh 397ffb8acbff1ede6b7ed235481deb090ba177d4 @@ -68,6 +68,7 @@ bool unknown; std::vector keys_to_push; system_path confdir; + bool have_set_key_dir; // These are used to cache signers/verifiers (if the hook allows). ======================================================================== --- key_store.cc 90b1da1b21ccd13d0de9285462f8a708773f0ecf +++ key_store.cc 92f4fc2b3b1ac16c869de4aae95e9ca9fb2774d0 @@ -63,7 +63,6 @@ key_store::key_store(app_state * a): have_read(false), app(a) { - key_dir = app->get_confdir() / "keys"; } void