# # # patch "hostconfig.dist" # from [81e3f0264c41c02e3a88634d3d08a0ecebc6a17b] # to [63f15af4248fea5e953624f10e5f04391e847d6d] # # patch "skel/monotonerc" # from [fbb7f8d0c99e1461941e4200bb8c114533675b5d] # to [8758e0a8be6e6affa3eb966fbbffcdb46a32b946] # ============================================================ --- hostconfig.dist 81e3f0264c41c02e3a88634d3d08a0ecebc6a17b +++ hostconfig.dist 63f15af4248fea5e953624f10e5f04391e847d6d @@ -5,5 +5,6 @@ admin "127.0.0.5:12345" hostkey "address@hidden" +hostkeypass "address@hidden" monotone "/home/timothy/bin/monotone" comment "parsing is somewhat broken, keep this line at the end" ============================================================ --- skel/monotonerc fbb7f8d0c99e1461941e4200bb8c114533675b5d +++ skel/monotonerc 8758e0a8be6e6affa3eb966fbbffcdb46a32b946 @@ -1,6 +1,30 @@ -hostkey = "address@hidden" -hostkeypass = "address@hidden" +function read_config() + local permfile = io.open(get_confdir() .. "/../../hostconfig", "r") + if (permfile == nil) then return false end + local dat = permfile:read("*a") + io.close(permfile) + local res = parse_basic_io(dat) + if res == nil then + io.stderr:write("config file cannot be parsed\n") + return false + end + for i, item in pairs(res) + do + if item.name == "hostkey" then + for j, val in pairs(item.values) do + hostkey = val + end + end elseif item.name == "hostkeypass" then + for j, val in pairs(item.values) do + hostkeypass = val + end + end + end + return false +end +read_config + function get_passphrase(keyid) if keyid == hostkey then return hostkeypass