monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone.source-tree-cleanup: 521e7b


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.source-tree-cleanup: 521e7b4e2913a0a9dde63f203f2d24791604e295
Date: Sat, 8 Jan 2011 10:24:52 GMT

revision:            521e7b4e2913a0a9dde63f203f2d24791604e295
date:                2011-01-08T10:22:46
author:              address@hidden
branch:              net.venge.monotone.source-tree-cleanup
changelog:
merge of '5f7e4f9edf0a1ec26926f82c35ed27777bd01c8d'
     and 'b20f1efad7897b0d9e92b49ac36ed1b823bcd142'



manifest:
format_version "1"

new_manifest [5b20f255bbbecf695c01580d8ef4ed307eb78cb1]

old_revision [5f7e4f9edf0a1ec26926f82c35ed27777bd01c8d]

rename "test/func/netsync_permissions/closed/write-permissions"
    to "test/func/netsync_permissions/closed/write-permissions.d/tester"

add_dir "test/func/netsync_permissions/closed/read-permissions.d"

add_dir "test/func/netsync_permissions/closed/write-permissions.d"

add_file "test/func/netsync_permissions/closed/read-permissions.d/tester"
 content [b9bae8e35f085049ddfa0cfe92308a79998ad6d0]

patch "INSTALL"
 from [b617e97515ceb80b13f01c5e2f00ccc6fb11aec9]
   to [f273e5a0e29dbebf4d5ff71909d61b4dd616dd7a]

patch "NEWS"
 from [7216d7870a01f5caaa0f309482d269d9345f3c38]
   to [1e1359c5cd7ef37431ad77f27d952639754d2b8c]

patch "contrib/authorize_remote_automate.lua"
 from [524e291413561068423348e2403cf44635d74e9b]
   to [9d6f81a90c85dcb1a566755ce5a04d5ba2c23d2a]

patch "examples/server-setup/monotone.run"
 from [f163d5e9dc2501d1b86319dceca66c701db05d43]
   to [8b1fe8fbe135025ec5c20267ed58ab60f1977a50]

patch "monotone.texi"
 from [41a75b9619d37496359981bd7d0ad02ed5515354]
   to [bc042b9d5fecab7a01abb716dcaa986232459ba5]

patch "po/sv.po"
 from [60090cb2c4d91b782a50e3b83c78ff8f31a578ee]
   to [bb39ba476f5d0e053d07773116b7869ed3841ea2]

patch "src/cmd_db.cc"
 from [5a9fb76114e44850bca2342292d88fe31eccd9ec]
   to [5d669bd5fcec541849addbbf11edbc05060a8e8a]

patch "src/dates.cc"
 from [602419695490292f43358e4cc93c24f294a46265]
   to [02648f8882988ad5122eccc39528249b6333b219]

patch "src/luaext_platform.cc"
 from [b22b5f7fa127055e909280379694c1635f4923ff]
   to [288a571d7c91fbb4abffb66611b52aac74889aa2]

patch "src/std_hooks.lua"
 from [c97901eafc09c1ae80f7f33425761c1ea06a6929]
   to [b1a61ba83a6e8c0c9d72393aaf0e86089b75464d]

patch "src/ui.cc"
 from [9a60b8ed417f2566d2fc217decfdffee59e2a66e]
   to [d003e3d9943dee48b7352f6f0f64e8821bb4a38f]

patch "test/func/netsync_permissions/__driver__.lua"
 from [a0632f717c1fff69661ccc56516bcae93e3b3de8]
   to [8a675ebd2b67064a295f5143b2159580d1028ac9]

patch "test/func/netsync_permissions/closed/read-permissions"
 from [2164855b160ba5bfa19257d29dc4e820becc5459]
   to [eff21031c117b085855d3a6220dfb95f3e000efa]

patch "test/src/tester.cc"
 from [d8cb865b6a6e4c2cc24b98c8df80a6b3dfba70d7]
   to [acaadc933bb12e50e8d7ef310678c2fcaf2243bf]

old_revision [b20f1efad7897b0d9e92b49ac36ed1b823bcd142]

patch "Makefile.am"
 from [a82e2b163643b509496a79129231ceb3e0a1193a]
   to [6e44bb441c83d3cd7b352a83a5a2817e002fa762]

patch "src/sanity.cc"
 from [6ea2aba0cee2ff0feaf6eacb93327e340fcc982b]
   to [17e9e70774f064cfb8ef4e25075a1f493b63cd78]

patch "src/win32/cputime.cc"
 from [3e8facadcf52a34c663914f1b46a81afeb89129f]
   to [d387251cfbb1b19c18de9fa1548717a8ad9e5437]

patch "src/win32/get_system_flavour.cc"
 from [60cdbd9a9c7a6373952674ab39e70b2c76f99a41]
   to [504a6ac65967da7d4b4a437d0beebc04ee8f969d]

patch "src/win32/ssh_agent_platform.hh"
 from [5b62f5f8d1e4158a47839d3b0005531d4d5a3c83]
   to [c5c3bc374ef21c09fa89bc5831cb9579505e51ec]
============================================================
--- NEWS	7216d7870a01f5caaa0f309482d269d9345f3c38
+++ NEWS	1e1359c5cd7ef37431ad77f27d952639754d2b8c
@@ -16,6 +16,11 @@ XXX XXX XX XX:XX:XX UTC 2010
           Steve Petruzzello <address@hidden> for the outstanding
           work!
 
+        - get_netsync_(read|write)_permitted have been extended to not
+          only read the files read-permissions and write-permissions,
+          but also the files in the subdirectories read-permissions.d
+          and write-permissions.d.
+
         New Features
 
         - 'mtn conflicts store' now outputs a count of the conflicts,
============================================================
--- monotone.texi	41a75b9619d37496359981bd7d0ad02ed5515354
+++ monotone.texi	bc042b9d5fecab7a01abb716dcaa986232459ba5
@@ -79,6 +79,7 @@ @top Overview
 * Advanced Uses::               Going beyond the basics
 * CVS Phrasebook::              Transitional guide for CVS users
 * Command Reference::           Details of each monotone command
+* Formats::                     Formats used by monotone and scripts
 * Lua Reference::               How Lua is integrated in monotone
 * Special Topics::              Extra explanations and details
 * Default hooks::               The standard hook definitions
@@ -4854,7 +4855,7 @@ @heading Initializing a Repository
 users.
 
 
address@hidden    Command Reference, Lua Reference, CVS Phrasebook, Top
address@hidden    Command Reference, Formats, CVS Phrasebook, Top
 @chapter Command Reference
 
 Monotone has a large number of commands. To help navigate through them
@@ -6859,51 +6860,9 @@ @section Automation
 also give useful chatter on @code{stderr}, including warnings and error
 messages.
 
address@hidden @code{basic_io} Format
+Many commands produce output in a format called basic_io, for more
+information, @pxref{Formats}.
 
-Many commands produce output in a format called basic_io. At the most basic
-level this is a stream of three token types, separated by whitespace; a
address@hidden matches @code{/[a-z_]+/} (a word consisting of lowercase letters
-and underscores), a @code{string} matches @code{/"([^\\]|\\\\|\\")*"/} (a pair
-of double-quotes containing arbitrary characters, with only backslash and
-double-quote escaped with a backslash), and a @code{hex} matches
address@hidden/address@hidden@}\]/} (40 lowercase hex digits enclosed by square
-brackets; this will necessarily change in some manner when we eventually move
-to a stronger hash than sha1). Each @code{symbol} is followed by zero or more
address@hidden and/or @code{hex}es.
-
-While the above is all that is strictly necessary to parse basic_io, there is
-some formatting of the stream which may be helpful when parsing and is required
-(but not always verified) when producing basic_io for consumption by monotone:
address@hidden
address@hidden
-Each @code{symbol} begins a new line.
address@hidden
-Tokens on the same line are separated by a single space.
address@hidden
-Lines are grouped into logical @code{stanza}s, separated by a single empty line.
-Each stanza then describes a particular item, with the different lines
-(@code{symbol}s followed by @code{string} and @code{hex} values) describing
-different aspects of that item.
address@hidden
address@hidden in a stanza are right-aligned with each other; each @code{symbol}
-other than the longest is preceeded by spaces. The longest @code{symbol} in a
-stanza is not preceeded by spaces, even if there are longer @code{symbol}s in
-other stanzas.
address@hidden
-Lines within stanzas have a consistent order, although some may be
-optional in some commands.
address@hidden
-Stanzas typically have no defined order, although some commands define
-a partial order to aid in parsing.
-
-For example, revisions have associated data; the structure is header
-stanzas followed by a list of changes vs. each parent revision, with
-each change represented by a separate stanza; reordering the stanzas
-could cause a particular change to be interpreted against the wrong
-parent.
address@hidden itemize
-
 @subsection Automation Commands
 
 @ftable @command
@@ -8223,7 +8182,7 @@ @subsection Automation Commands
 
 @end table
 
address@hidden mtn automate stdio
address@hidden@item mtn automate stdio
 
 @table @strong
 @item Arguments:
@@ -11090,7 +11049,88 @@ @section GIT
 @end ftable
 
 
address@hidden    Lua Reference, Special Topics, Command Reference, Top
address@hidden    Formats, Lua Reference, Command Reference, Top
address@hidden Formats
+
+Monotone uses two well defined formats to output or to accept input of
+data (mostly structured), @code{basic_io} and @code{stdio}.
address@hidden is often used to represent data or for configuration,
+while @code{stdio} is used for communication with @code{automate stdio}.
+
+The @code{stdio} format is not described here.  For information on it,
+please @pxref{mtn-au-stdio,,@code{mtn automate stdio}}.
+
address@hidden @code{basic_io} Format
+
address@hidden is a very simple format, yet expressive, and can be
+described with the following ABNF (see RFC 2234) specification:
+
address@hidden
address@hidden
+basic_io = *( item )
+
+    item = *sp symbol *sp *( string / hexid ) *sp
+           ; a symbol followed by zero or more strings and/or hexes.
+
+  symbol = 1*( lcalpha / "_" )
+           ; One or more letters or underscores.
+  string = DQUOTE *( charnqnb / "\" "\" / "\" DQUOTE ) DQUOTE
+           ; A series of any character, enclosed with double quotes
+           ; To include a double quote or a backslash in the string,
+           ; escape it with a backslash.
+   hexid = "[" 40HEXDIG "]"
+           ; 40 hexadecimal characters enclosed in brackets.
+           ; Note: the amount might change as we move away from sha1.
+
+      sp = ( WSP CR LF )
+charnqnb = %x01-21 / %x23-5B / %x5D-FF
+           ; All characters except NUL (%x00) , " (%x22) and \ (%x5C).
+ lcalpha = %x61-7A
+           ; Lower case a-z.
address@hidden verbatim
address@hidden display
+
+In essence, it's a stream of items, where each item is a @code{symbol}
+followed by zero or more @code{string}s and @code{hex}es.
+
+There is an idea of stanzas, which is a group of items that logically
+belongs together.  However, stanzas aren't defined in the
address@hidden syntax, and are instead defined in terms of order and
+sequence for what symbols may be part of the stream, how they may
+appear, and how many and what arguments should follow them.  This is
+defined by each command or program using this format.
+
+For example, revisions have associated data; the structure is header
+stanzas followed by a list of changes vs. each parent revision, with
+each change represented by a separate stanza; reordering the stanzas
+could cause a particular change to be interpreted against the wrong
+parent.
+
+Another example is the @file{read-permissions} file that's read by the
+default definition of the @code{get_netsync_read_permitted} lua hook.
+
+Monotone will format its output in @code{basic_io} as follows:
address@hidden
address@hidden
+Each @code{symbol} begins a new line.
address@hidden
+Tokens on the same line are separated by a single space.
address@hidden
+Lines are grouped into logical @code{stanza}s, separated by a single empty line.
+Each stanza then describes a particular item, with the different lines
+(@code{symbol}s followed by @code{string} and @code{hex} values) describing
+different aspects of that item.
address@hidden
address@hidden in a stanza are right-aligned with each other; each @code{symbol}
+other than the longest is preceeded by spaces. The longest @code{symbol} in a
+stanza is not preceeded by spaces, even if there are longer @code{symbol}s in
+other stanzas.
address@hidden
+Lines within stanzas have a consistent order, although some may be
+optional in some commands.
address@hidden itemize
+
address@hidden    Lua Reference, Special Topics, Formats, Top
 @chapter Lua Reference
 
 Monotone makes use of the @uref{http://www.lua.org, Lua} programming
@@ -11625,8 +11665,11 @@ @subsection Netsync Permission Hooks
 Returns @code{true} if a peer authenticated as key @var{key_identity}
 should be allowed to read from your database certs, revisions,
 manifests, and files associated with @var{branch}; otherwise @code{false}.
-The default definition of this hook reads a file @file{read-permissions} in
-the configuration directory. This file looks like
+The default definition of this hook reads a file @file{read-permissions}
+and all files in the subdirectory @file{read-permissions.d} in the
+configuration directory. All the files are treated as if they were one
+file, with @file{read-permissions} first followed by the files in
address@hidden in alphanumerical order. The files look like
 @smallexample
 @group
 pattern "address@hidden,address@hidden"
@@ -11663,11 +11706,13 @@ @subsection Netsync Permission Hooks
 
 @item get_netsync_write_permitted (@var{key_identity})
 
-Returns @code{true} if a peer authenticated as key @var{key_identity} should
-be allowed to write into your database certs, revisions, manifests, and
-files; otherwise @code{false}. The default definition of this hook reads a file
address@hidden in the configuration directory which contains a list
-of key hashes or local key names, one per line, which are allowed write access.
+Returns @code{true} if a peer authenticated as key @var{key_identity}
+should be allowed to write into your database certs, revisions,
+manifests, and files; otherwise @code{false}. The default definition of
+this hook reads a file @file{write-permissions} and all files in the
+subdirectory @file{write-permissions.d} in the configuration directory
+which contains a list of key hashes or local key names, one per line,
+which are allowed write access.
 The special value
 @code{*} means to allow access to anyone whose public key we already have.
 
============================================================
--- src/std_hooks.lua	c97901eafc09c1ae80f7f33425761c1ea06a6929
+++ src/std_hooks.lua	b1a61ba83a6e8c0c9d72393aaf0e86089b75464d
@@ -1078,46 +1078,51 @@ end
       end
 end
 
-function get_netsync_read_permitted(branch, ident)
-   local permfile = io.open(get_confdir() .. "/read-permissions", "r")
+function _get_netsync_read_permitted(branch, ident, permfilename, state)
+   if not exists(permfilename) or isdir(permfilename) then
+      return false
+   end
+   local permfile = io.open(permfilename, "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("file read-permissions cannot be parsed\n")
-      return false
+      io.stderr:write("file "..permfilename.." cannot be parsed\n")
+      return false,"continue"
    end
-   local matches = false
-   local cont = false
+   state["matches"] = state["matches"] or false
+   state["cont"] = state["cont"] or false
    for i, item in pairs(res)
    do
       -- legal names: pattern, allow, deny, continue
       if item.name == "pattern" then
-         if matches and not cont then return false end
-         matches = false
-         cont = false
+         if state["matches"] and not state["cont"] then return false end
+         state["matches"] = false
+         state["cont"] = false
          for j, val in pairs(item.values) do
-            if globish_match(val, branch) then matches = true end
+            if globish_match(val, branch) then state["matches"] = true end
          end
-      elseif item.name == "allow" then if matches then
+      elseif item.name == "allow" then if state["matches"] then
          for j, val in pairs(item.values) do
             if val == "*" then return true end
             if val == "" and ident == nil then return true end
             if ident ~= nil and val == ident.id then return true end
             if ident ~= nil and globish_match(val, ident.name) then return true end
          end
-      end elseif item.name == "deny" then if matches then
+      end elseif item.name == "deny" then if state["matches"] then
          for j, val in pairs(item.values) do
             if val == "*" then return false end
             if val == "" and ident == nil then return false end
             if ident ~= nil and val == ident.id then return false end
             if ident ~= nil and globish_match(val, ident.name) then return false end
          end
-      end elseif item.name == "continue" then if matches then
-         cont = true
+      end elseif item.name == "continue" then if state["matches"] then
+         state["cont"] = true
          for j, val in pairs(item.values) do
-            if val == "false" or val == "no" then cont = false end
+            if val == "false" or val == "no" then 
+	       state["cont"] = false
+	    end
          end
       end elseif item.name ~= "comment" then
          io.stderr:write("unknown symbol in read-permissions: " .. item.name .. "\n")
@@ -1127,8 +1132,29 @@ end
    return false
 end
 
-function get_netsync_write_permitted(ident)
-   local permfile = io.open(get_confdir() .. "/write-permissions", "r")
+function get_netsync_read_permitted(branch, ident)
+   local permfilename = get_confdir() .. "/read-permissions"
+   local permdirname = permfilename .. ".d"
+   local state = {}
+   if _get_netsync_read_permitted(branch, ident, permfilename, state) then
+      return true
+   end
+   if isdir(permdirname) then
+      local files = read_directory(permdirname)
+      table.sort(files)
+      for _,f in ipairs(files) do
+	 pf = permdirname.."/"..f
+	 if _get_netsync_read_permitted(branch, ident, pf, state) then
+	    return true
+	 end
+      end
+   end
+   return false
+end
+
+function _get_netsync_write_permitted(ident, permfilename)
+   if not exists(permfilename) or isdir(permfilename) then return false end
+   local permfile = io.open(permfilename, "r")
    if (permfile == nil) then
       return false
    end
@@ -1145,6 +1171,21 @@ end
    return matches
 end
 
+function get_netsync_write_permitted(ident)
+   local permfilename = get_confdir() .. "/write-permissions"
+   local permdirname = permfilename .. ".d"
+   if _get_netsync_write_permitted(ident, permfilename) then return true end
+   if isdir(permdirname) then
+      local files = read_directory(permdirname)
+      table.sort(files)
+      for _,f in ipairs(files) do
+	 pf = permdirname.."/"..f
+	 if _get_netsync_write_permitted(ident, pf) then return true end
+      end
+   end
+   return false
+end
+
 -- This is a simple function which assumes you're going to be spawning
 -- a copy of mtn, so reuses a common bit at the end for converting
 -- local args into remote args. You might need to massage the logic a
============================================================
--- src/ui.cc	9a60b8ed417f2566d2fc217decfdffee59e2a66e
+++ src/ui.cc	d003e3d9943dee48b7352f6f0f64e8821bb4a38f
@@ -767,12 +767,22 @@ user_interface::output_prefix()
 
   if (timestamps_enabled) {
     try {
-      // FIXME: with no app pointer around we have no access to
-      // app.lua.get_date_format_spec() here, so we use the same format
-      // which f.e. also Apache uses for its log output
-      prefix = "[" +
-        date_t::now().as_formatted_localtime("%a %b %d %H:%M:%S %Y") +
-        "] ";
+      // To prevent possible infinite loops from a spurious log being
+      // made down the line from the call to .as_formatted_localtime,
+      // we temporarly turn off timestamping.  Not by fiddling with
+      // timestamp_enabled, though, since that one might be looked at
+      // by some other code.
+      static int do_timestamp = 0;
+
+      if (++do_timestamp == 1) {
+        // FIXME: with no app pointer around we have no access to
+        // app.lua.get_date_format_spec() here, so we use the same format
+        // which f.e. also Apache uses for its log output
+        prefix = "[" +
+          date_t::now().as_formatted_localtime("%a %b %d %H:%M:%S %Y") +
+          "] ";
+      }
+      --do_timestamp;
     }
     // ensure that we do not throw an exception because we could not
     // create the timestamp prefix above
============================================================
--- INSTALL	b617e97515ceb80b13f01c5e2f00ccc6fb11aec9
+++ INSTALL	f273e5a0e29dbebf4d5ff71909d61b4dd616dd7a
@@ -56,7 +56,14 @@ 1. prerequisites:
              autoconf automake gettext boost boost-devel zlib zlib-devel
              lua lua-devel pcre pcre-devel sqlite sqlite-devel libidn
              libidn-devel gcc-c++ texinfo texinfo-tex botan botan-devel
+ 
+        on openSUSE:
 
+            install the following extra packages with YaST or zypper:
+              autoconf automake gettext-tools gcc-g++ boost-devel zlib-devel
+              libbotan-devel sqlite3-dev pcre-devel lua-devel libidn-devel
+              libbz2-devel texinfo make
+
         on Mac OS X:
 
            use MacPorts (http://www.macports.org) to install the following
============================================================
--- po/sv.po	60090cb2c4d91b782a50e3b83c78ff8f31a578ee
+++ po/sv.po	bb39ba476f5d0e053d07773116b7869ed3841ea2
@@ -155,7 +155,7 @@ msgstr ""
 "Project-Id-Version: monotone 0.26pre1\n"
 "Report-Msgid-Bugs-To: address@hidden"
 "POT-Creation-Date: 2010-11-27 16:55+0100\n"
-"PO-Revision-Date: 2010-11-28 06:39+0100\n"
+"PO-Revision-Date: 2010-12-03 09:16+0100\n"
 "Last-Translator: Joel Rosdahl <address@hidden>\n"
 "Language-Team: Richard Levitte <address@hidden>\n"
 "Language: \n"
@@ -1461,9 +1461,7 @@ msgid "public or private key '%s' does n
 #: cmd_key_cert.cc:160
 #, c-format
 msgid "public or private key '%s' does not exist in keystore or database"
-msgstr ""
-"den publika eller privata nyckeln '%s' finns inte i nyckellager eller\n"
-"databas"
+msgstr "den publika eller privata nyckeln '%s' finns inte i nyckellager eller databas"
 
 #: cmd_key_cert.cc:163
 #, c-format
@@ -1515,9 +1513,7 @@ msgid ""
 msgid ""
 "Creates a certificate with the given name and value on each revision that "
 "matches the given selector"
-msgstr ""
-"Skapar ett certifikat med givna namn och värde för verja revision som\n"
-"motsvarar den givna väljaren"
+msgstr "Skapar ett certifikat med givna namn och värde för verja revision som motsvarar den givna väljaren"
 
 #: cmd_key_cert.cc:300
 msgid "REVISION NAME VALUE SIGNER1 [SIGNER2 [...]]"
@@ -2253,9 +2249,7 @@ msgid ""
 msgid ""
 "Deletes all certs which are on the given revision(s) and have the given name "
 "and if a value is specified then also the given value."
-msgstr ""
-"Tar bort alla certifikat med givet namn och eventuellt givet värde\n"
-"från givna revisioner."
+msgstr "Tar bort alla certifikat med givet namn och eventuellt givet värde från givna revisioner."
 
 #: cmd_db.cc:319
 msgid "Does some sanity checks on the database"
============================================================
--- src/cmd_db.cc	5a9fb76114e44850bca2342292d88fe31eccd9ec
+++ src/cmd_db.cc	5d669bd5fcec541849addbbf11edbc05060a8e8a
@@ -251,7 +251,7 @@ CMD(db_kill_certs_locally, "kill_certs",
     N_("Deletes all certs which are on the given revision(s) and "
        "have the given name and if a value is specified then also "
        "the given value."),
-    options::opts::revision)
+    options::opts::none)
 {
   if (args.size() < 2 || args.size() > 3)
     throw usage(execid);
============================================================
--- test/src/tester.cc	d8cb865b6a6e4c2cc24b98c8df80a6b3dfba70d7
+++ test/src/tester.cc	acaadc933bb12e50e8d7ef310678c2fcaf2243bf
@@ -313,22 +313,6 @@ LUAEXT(copy_recursive, )
     }
 }
 
-LUAEXT(mkdir, )
-{
-  try
-    {
-      char const * dirname = luaL_checkstring(LS, -1);
-      do_mkdir(dirname);
-      lua_pushboolean(LS, true);
-      return 1;
-    }
-  catch(recoverable_failure & e)
-    {
-      lua_pushnil(LS);
-      return 1;
-    }
-}
-
 LUAEXT(make_temp_dir, )
 {
   try
@@ -367,88 +351,6 @@ LUAEXT(mtime, )
     }
 }
 
-LUAEXT(exists, )
-{
-  try
-    {
-      char const * name = luaL_checkstring(LS, -1);
-      switch (get_path_status(name))
-        {
-        case path::nonexistent:  lua_pushboolean(LS, false); break;
-        case path::file:
-        case path::directory:    lua_pushboolean(LS, true); break;
-        }
-    }
-  catch(recoverable_failure & e)
-    {
-      lua_pushnil(LS);
-    }
-  return 1;
-}
-
-LUAEXT(isdir, )
-{
-  try
-    {
-      char const * name = luaL_checkstring(LS, -1);
-      switch (get_path_status(name))
-        {
-        case path::nonexistent:
-        case path::file:         lua_pushboolean(LS, false); break;
-        case path::directory:    lua_pushboolean(LS, true); break;
-        }
-    }
-  catch(recoverable_failure & e)
-    {
-      lua_pushnil(LS);
-    }
-  return 1;
-}
-
-namespace
-{
-  struct build_table : public dirent_consumer
-  {
-    build_table(lua_State * st) : st(st), n(1)
-    {
-      lua_newtable(st);
-    }
-    virtual void consume(const char *s)
-    {
-      lua_pushstring(st, s);
-      lua_rawseti(st, -2, n);
-      n++;
-    }
-  private:
-    lua_State * st;
-    unsigned int n;
-  };
-}
-
-LUAEXT(read_directory, )
-{
-  int top = lua_gettop(LS);
-  try
-    {
-      string path(luaL_checkstring(LS, -1));
-      build_table tbl(LS);
-
-      read_directory(path, tbl, tbl, tbl);
-    }
-  catch(recoverable_failure &)
-    {
-      // discard the table and any pending path element
-      lua_settop(LS, top);
-      lua_pushnil(LS);
-    }
-  catch (...)
-    {
-      lua_settop(LS, top);
-      throw;
-    }
-  return 1;
-}
-
 LUAEXT(get_source_dir, )
 {
   lua_pushstring(LS, source_dir.c_str());
============================================================
--- test/func/netsync_permissions/__driver__.lua	a0632f717c1fff69661ccc56516bcae93e3b3de8
+++ test/func/netsync_permissions/__driver__.lua	8a675ebd2b67064a295f5143b2159580d1028ac9
@@ -116,13 +116,13 @@ check(get("closed"))
 check(get("closed"))
 
 -- setup by-hash line in permissions files
-writeperm = readfile("closed/write-permissions")
-writeperm = writeperm .. byhash_hash .. "\n"
-writefile("closed/write-permissions", writeperm)
+writefile("closed/write-permissions.d/tester-by-hash", byhash_hash.."\n")
 
-readperm = readfile("closed/read-permissions")
-readperm = readperm .. 'allow "' .. byhash_hash .. '"\n'
-writefile("closed/read-permissions", readperm)
+readperm = readfile("closed/read-permissions.d/tester")
+readperm = readperm .. 'continue "yes"\n'
+writefile("closed/read-permissions.d/tester", readperm)
+writefile("closed/read-permissions.d/tester-by-hash",
+       'pattern "*"\nallow "' .. byhash_hash .. '"\n')
 
 -- general setup
 clean()
============================================================
--- test/func/netsync_permissions/closed/read-permissions	2164855b160ba5bfa19257d29dc4e820becc5459
+++ test/func/netsync_permissions/closed/read-permissions	eff21031c117b085855d3a6220dfb95f3e000efa
@@ -1,5 +1,2 @@ deny "*"
 pattern "badbranch"
 deny "*"
-
-pattern "*"
-allow "address@hidden"
============================================================
--- src/luaext_platform.cc	b22b5f7fa127055e909280379694c1635f4923ff
+++ src/luaext_platform.cc	288a571d7c91fbb4abffb66611b52aac74889aa2
@@ -14,7 +14,9 @@
 #include <cstdlib>
 
 #include "platform.hh"
+#include "sanity.hh"
 
+using std::string;
 using std::malloc;
 using std::free;
 
@@ -185,6 +187,106 @@ LUAEXT(get_pid, )
   return 1;
 }
 
+// fs extensions
+
+LUAEXT(mkdir, )
+{
+  try
+    {
+      char const * dirname = luaL_checkstring(LS, -1);
+      do_mkdir(dirname);
+      lua_pushboolean(LS, true);
+      return 1;
+    }
+  catch(recoverable_failure & e)
+    {
+      lua_pushnil(LS);
+      return 1;
+    }
+}
+
+LUAEXT(exists, )
+{
+  try
+    {
+      char const * name = luaL_checkstring(LS, -1);
+      switch (get_path_status(name))
+        {
+        case path::nonexistent:  lua_pushboolean(LS, false); break;
+        case path::file:
+        case path::directory:    lua_pushboolean(LS, true); break;
+        }
+    }
+  catch(recoverable_failure & e)
+    {
+      lua_pushnil(LS);
+    }
+  return 1;
+}
+
+LUAEXT(isdir, )
+{
+  try
+    {
+      char const * name = luaL_checkstring(LS, -1);
+      switch (get_path_status(name))
+        {
+        case path::nonexistent:
+        case path::file:         lua_pushboolean(LS, false); break;
+        case path::directory:    lua_pushboolean(LS, true); break;
+        }
+    }
+  catch(recoverable_failure & e)
+    {
+      lua_pushnil(LS);
+    }
+  return 1;
+}
+
+namespace
+{
+  struct build_table : public dirent_consumer
+  {
+    build_table(lua_State * st) : st(st), n(1)
+    {
+      lua_newtable(st);
+    }
+    virtual void consume(const char *s)
+    {
+      lua_pushstring(st, s);
+      lua_rawseti(st, -2, n);
+      n++;
+    }
+  private:
+    lua_State * st;
+    unsigned int n;
+  };
+}
+
+LUAEXT(read_directory, )
+{
+  int top = lua_gettop(LS);
+  try
+    {
+      string path(luaL_checkstring(LS, -1));
+      build_table tbl(LS);
+
+      read_directory(path, tbl, tbl, tbl);
+    }
+  catch(recoverable_failure &)
+    {
+      // discard the table and any pending path element
+      lua_settop(LS, top);
+      lua_pushnil(LS);
+    }
+  catch (...)
+    {
+      lua_settop(LS, top);
+      throw;
+    }
+  return 1;
+}
+
 // Local Variables:
 // mode: C++
 // fill-column: 76
============================================================
--- src/dates.cc	602419695490292f43358e4cc93c24f294a46265
+++ src/dates.cc	02648f8882988ad5122eccc39528249b6333b219
@@ -363,8 +363,6 @@ dump(date_t const & d, string & s)
   s = d.as_iso_8601_extended();
 }
 
-// WARNING: do not log anything within this function; since this is used in
-// user_interface::output_prefix() this might lead to an indefinite loop!
 string
 date_t::as_formatted_localtime(string const & fmt) const
 {
============================================================
--- contrib/authorize_remote_automate.lua	524e291413561068423348e2403cf44635d74e9b
+++ contrib/authorize_remote_automate.lua	9d6f81a90c85dcb1a566755ce5a04d5ba2c23d2a
@@ -46,8 +46,8 @@ do
 	 if not globish_match("#*", line) then
 	    local _, _, ln = string.find(line, "%s*([^%s]*)%s*")
 	    if ln == "*" then matches = true end
-	    if ln == ident.id then matches = true end
-	    if globish_match(ln, ident.name) then matches = true end
+	    if ln == key_identity.id then matches = true end
+	    if globish_match(ln, key_identity.name) then matches = true end
 	    line = permfile:read()
 	 end
       end
============================================================
--- examples/server-setup/monotone.run	f163d5e9dc2501d1b86319dceca66c701db05d43
+++ examples/server-setup/monotone.run	8b1fe8fbe135025ec5c20267ed58ab60f1977a50
@@ -16,7 +16,7 @@ exec \
 exec \
   softlimit -d192000000 \
   setuidgid monotone \
-  /usr/bin/monotone \
+  $DAEMON \
     --confdir=$MTN_CONFDIR --keydir=$MTN_KEYDIR --db=$MTN_DB \
     --no-standard-rcfiles --rcfile=$MTN_CONFDIR/hooks.lua \
     --timestamps --quiet --bind=$ADDRESS serve
============================================================
--- /dev/null	
+++ test/func/netsync_permissions/closed/read-permissions.d/tester	b9bae8e35f085049ddfa0cfe92308a79998ad6d0
@@ -0,0 +1,2 @@
+pattern "*"
+allow "address@hidden"
============================================================
--- Makefile.am	a82e2b163643b509496a79129231ceb3e0a1193a
+++ Makefile.am	6e44bb441c83d3cd7b352a83a5a2817e002fa762
@@ -455,6 +455,7 @@ po/$(PACKAGE).pot: $(POTFILES)
 	src/monotone.cc src/std_hooks.lua
 
 po/$(PACKAGE).pot: $(POTFILES)
+	[ -d po ] || mkdir -p po
 	$(V_xgettext)$(XGETTEXT) -o$@ -D. -D$(top_srcdir) -cTRANSLATORS: \
 	  --copyright-holder='$(COPYRIGHT_HOLDER)' \
 	  --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \
============================================================
--- src/sanity.cc	6ea2aba0cee2ff0feaf6eacb93327e340fcc982b
+++ src/sanity.cc	17e9e70774f064cfb8ef4e25075a1f493b63cd78
@@ -15,8 +15,10 @@
 #include "vector.hh"
 
 #include <boost/format.hpp>
-#include <boost/circular_buffer.hpp>
 
+// circular_buffer is not in Boost 1.34; it's in monotone/boost.
+#include "boost/circular_buffer.hpp"
+
 #include "lexical_cast.hh"
 #include "constants.hh"
 #include "platform.hh"
============================================================
--- src/win32/get_system_flavour.cc	60cdbd9a9c7a6373952674ab39e70b2c76f99a41
+++ src/win32/get_system_flavour.cc	504a6ac65967da7d4b4a437d0beebc04ee8f969d
@@ -7,8 +7,8 @@
 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 // PURPOSE.
 
-#include "base.hh"
-#include "sanity.hh"
+#include "../base.hh"
+#include "../sanity.hh"
 
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
============================================================
--- src/win32/cputime.cc	3e8facadcf52a34c663914f1b46a81afeb89129f
+++ src/win32/cputime.cc	d387251cfbb1b19c18de9fa1548717a8ad9e5437
@@ -12,7 +12,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-#include "numeric_vocab.hh"
+#include "../numeric_vocab.hh"
 
 u64 to_ticks(FILETIME const & ft)
 {
============================================================
--- src/win32/ssh_agent_platform.hh	5b62f5f8d1e4158a47839d3b0005531d4d5a3c83
+++ src/win32/ssh_agent_platform.hh	c5c3bc374ef21c09fa89bc5831cb9579505e51ec
@@ -10,7 +10,7 @@
 #ifndef __SSH_AGENT_PLATFORM_HH__
 #define __SSH_AGENT_PLATFORM_HH__
 
-#include "numeric_vocab.hh"
+#include "../numeric_vocab.hh"
 #define WIN32_LEAN_AND_MEAN // no gui definitions
 #include <windows.h>
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]