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: 5348bb00441cf134154ff8476be


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: 5348bb00441cf134154ff8476be2587589f08451
Date: Tue, 26 Feb 2013 20:26:46 +0100 (CET)

revision:            5348bb00441cf134154ff8476be2587589f08451
date:                2013-02-26T19:19:28
author:              Richard Hopkins <address@hidden>
branch:              net.venge.monotone
changelog:
merge of 'c2d91157493d780582ff66fcfa3971ff6a610a2c'
     and 'f5aaf0b2410300fb463aeaa73df3314801d7c444'

manifest:
format_version "1"

new_manifest [f294a0cebad78958c645112c0bd9e87da2d34c62]

old_revision [c2d91157493d780582ff66fcfa3971ff6a610a2c]

patch "INSTALL_windows_native.txt"
 from [890ae02b8d52b803a093cfa38c267de4955f3943]
   to [83756282255c6dc573e2936fc65dff22c0836afd]

old_revision [f5aaf0b2410300fb463aeaa73df3314801d7c444]

add_dir "test/func/wanted_testresults"

add_file "test/func/wanted_testresults/__driver__.lua"
 content [670d2df947c1e878dc53530808a87b5a2647fe87]

patch "NEWS"
 from [54723cd3a325f76fc39e733ff3ff4372860afb5c]
   to [777c52083e117f5e3010e0f95f3a6b199e2d39f4]

patch "doc/monotone.texi"
 from [2d2a1a9c79e57fffe52a876d912e71355524d91b]
   to [54602b03c6fbd96c3eacf8ec43e25202d4e12889]

patch "src/std_hooks.lua"
 from [a2ec9556e5a0d3b3cc47633b14ad226b5c829925]
   to [6b28a0546b7c608cc23ba36e901ed532022ad5a2]
============================================================
--- INSTALL_windows_native.txt	890ae02b8d52b803a093cfa38c267de4955f3943
+++ INSTALL_windows_native.txt	83756282255c6dc573e2936fc65dff22c0836afd
@@ -38,8 +38,11 @@
                         | _not_ the "windows binary installer"
 sqlite3       | 3.7.11  | http://www.sqlite.org/download.html
                         | -> sqlite-autoconf-3071100.tar.gz
+libiconv      | 1.14    | ftp://ftp.gnu.org/gnu/libiconv/
+                        | -> libiconv-1.14.tar.gz
 libidn        | 1.24    | ftp://ftp.gnu.org/gnu/libidn/
                         | -> libidn-1.24.tar.gz
+http://ftp.gnu.org/pub/gnu/libiconv/
 Depends.exe   |         | http://www.dependencywalker.com/ ; also comes with Visual Studio
 
 In general, there are two versions of most tools on the
@@ -143,14 +146,22 @@
    $ ./configure --prefix=/mingw
    $ make install
 
-08. libidn
+08. libiconv
+
    $ cd /usr/src
+   $ tar -zxf ../libiconv-1.14.tar.gz
+   $ cd libiconv-1.14
+   $ ./configure --prefix=/mingw
+   $ make install
+
+09. libidn
+   $ cd /usr/src
    $ tar -zxf ../libidn-1.24.tar.gz
    $ cd libidn-1.24
    $ ./configure --prefix=/mingw
    $ make install
 
-09. Depends.exe
+10. Depends.exe
    If you have Visual Studio installed, you should be able to skip this.
    If you don't, then download the appropriate depends*.zip and
    unpack it someplace in your %PATH% (for example, C:\MinGW\bin\).
@@ -158,14 +169,14 @@
    If you just want to build monotone for your own use, you can skip this and
    just ignore that test failing.
 
-10. build monotone
+11. build monotone
    You can skip the CXXFLAGS and LDFLAGS if you really want to, but if you do that
    then libgcc_s and libstdc++-6 will be linked dynamically and the resulting
    monotone binary will take several extra seconds to start.
    $ cd /c/.../monotone
    $ autoreconf -i # not needed if you use the distributed tarball
-   $ export CXXFLAGS="-static-libgcc -static-libstdc++ -g -O2 -Wall"
-   $ export LDFLAGS="-static-libgcc -static-libstdc++"
+   $ export CXXFLAGS="-static-libgcc -static-libstdc++ -I/mingw/include -g -O2 -Wall"
+   $ export LDFLAGS="-static-libgcc -static-libstdc++ -L/mingw/lib"
    $ export botan_CFLAGS="-I/mingw/include/botan-1.10"
    $ export botan_LIBS="-lbotan-1.10"
    $ ./configure
============================================================
--- NEWS	54723cd3a325f76fc39e733ff3ff4372860afb5c
+++ NEWS	777c52083e117f5e3010e0f95f3a6b199e2d39f4
@@ -4,6 +4,9 @@ XXX XXX XX XX:XX:XX UTC 201X
 
         Changes
 
+        - '_MTN/wanted-testresults' must now have 1 hex-encoded
+          signing key hash in lowercase per line.
+
         New features
 
         - 'automate atttributes' now also works without a workspace
============================================================
--- doc/monotone.texi	2d2a1a9c79e57fffe52a876d912e71355524d91b
+++ doc/monotone.texi	54602b03c6fbd96c3eacf8ec43e25202d4e12889
@@ -11975,7 +11975,9 @@ @subsection Netsync Permission Hooks
 
 
 If a client connects anonymously, this hook will be called with a
address@hidden of @code{nil}.
address@hidden of @code{nil}. An empty string value must be used
+in @file{read-permissions} to represent clients connecting anonymously. e.g.
address@hidden ""}.
 
 @address@hidden get_netsync_write_permitted (@var{key_identity})
 
@@ -12233,18 +12235,20 @@ @subsection Trust Evaluation Hooks
 This hook is used by the update algorithm to determine whether a
 change in test results between update source and update target is
 acceptable. The hook is called with two tables, each of which maps a
-signing key -- representing a particular testsuite -- to a boolean
-value indicating whether or not the test run was successful. The
+signing key hash (as 20 raw bytes) -- representing a particular testsuite -- to a boolean
+value indicating whether or not the test run was successful (calculated
+from the @code{testresult} cert). The
 function should return @code{true} if you consider an update from the
 version carrying the @var{old_results} to the version carrying the
 @var{new_results} to be acceptable.
 
 The default definition of this hook returns @code{true} if
 @file{_MTN/wanted-testresults} does not exist. Otherwise, the file
-should contain a list of signing key ids. The hook returns @code{false}
-if a listed signing key id is present in both @var{old_results} and
address@hidden, and @var{old_results} is @code{true} but
address@hidden is @code{false}; otherwise it returns @code{true}.
+should contain a list of signing key hex-encoded hashes in lowercase (40 characters). 
+The hook returns @code{false}
+if a listed signing key hash is present in both @var{old_results} and
address@hidden, with the value @code{true} in @var{old_results}
+and @code{false} in @var{new_results}; otherwise it returns @code{true}.
 
 @end ftable
 
============================================================
--- src/std_hooks.lua	a2ec9556e5a0d3b3cc47633b14ad226b5c829925
+++ src/std_hooks.lua	6b28a0546b7c608cc23ba36e901ed532022ad5a2
@@ -419,7 +419,16 @@ end
    return true
 end
 
-function accept_testresult_change(old_results, new_results)
+-- http://snippets.luacode.org/?p=snippets/String_to_Hex_String_68
+function hex_dump(str,spacer)
+   return (string.gsub(str,"(.)",
+      function (c)
+         return string.format("%02x%s",string.byte(c), spacer or "")
+      end)
+   )
+end
+
+function accept_testresult_change_hex(old_results, new_results)
    local reqfile = io.open("_MTN/wanted-testresults", "r")
    if (reqfile == nil) then return true end
    local line = reqfile:read()
@@ -440,6 +449,21 @@ end
    return true
 end
 
+function accept_testresult_change(old_results, new_results)
+   -- Hex encode each of the key hashes to match those in 'wanted-testresults'
+   local old_results_hex = {}
+   for k, v in pairs(old_results) do
+	old_results_hex[hex_dump(k)] = v
+   end
+
+   local new_results_hex = {}
+   for k, v in pairs(new_results) do
+      new_results_hex[hex_dump(k)] = v
+   end
+
+   return accept_testresult_change_hex(old_results_hex, new_results_hex)
+end
+
 -- merger support
 
 -- Fields in the mergers structure:
============================================================
--- /dev/null	
+++ test/func/wanted_testresults/__driver__.lua	670d2df947c1e878dc53530808a87b5a2647fe87
@@ -0,0 +1,79 @@
+-- Create some revisions then attach 'testresult' certs to them.
+-- `mtn update` must not update to a "fail" revision from a "pass"
+-- revision.
+
+-- This is handled by our default definition of 'accept_testresult_change'
+-- which reads '_MTN/wanted-testresults'.
+
+mtn_setup()
+
+addfile("numbers.txt", 1)
+commit()
+good_rev = base_revision()
+
+writefile("numbers.txt", 2)
+commit()
+bad_rev = base_revision()
+
+check(mtn("update", "-r", good_rev), 0, false, false)
+
+check(mtn("testresult", good_rev, "pass"), 0, false, false)
+check(mtn("testresult", bad_rev, "fail"), 0, false, false)
+
+-- Now write out our default 'accept_testresult_change' definition
+-- from 'std_hooks.lua'.
+writefile("_MTN/monotonerc", [[
+-- http://snippets.luacode.org/?p=snippets/String_to_Hex_String_68
+function hex_dump(str,spacer)
+   return (string.gsub(str,"(.)",
+      function (c)
+         return string.format("%02x%s",string.byte(c), spacer or "")
+      end)
+   )
+end
+
+function accept_testresult_change_hex(old_results, new_results)
+   local reqfile = io.open("_MTN/wanted-testresults", "r")
+   if (reqfile == nil) then return true end
+   local line = reqfile:read()
+   local required = {}
+   while (line ~= nil)
+   do
+      required[line] = true
+      line = reqfile:read()
+   end
+   io.close(reqfile)
+   for test, res in pairs(required)
+   do
+      if old_results[test] == true and new_results[test] ~= true
+      then
+         return false
+      end
+   end
+   return true
+end
+
+function accept_testresult_change(old_results, new_results)
+   -- Hex encode each of the key hashes to match those in 'wanted-testresults'
+   local old_results_hex = {}
+   for k, v in pairs(old_results) do
+	old_results_hex[hex_dump(k)] = v
+   end
+
+   local new_results_hex = {}
+   for k, v in pairs(new_results) do
+      new_results_hex[hex_dump(k)] = v
+   end
+
+   return accept_testresult_change_hex(old_results_hex, new_results_hex)
+end
+]])
+writefile("_MTN/wanted-testresults", "46ec58576f9e4f34a9eede521422aa5fd299dc50\n")
+
+check(mtn("update", "--rcfile", "_MTN/monotonerc"), 0, false, true)
+-- stderr now looks something like.
+-- mtn: updating along branch '$BRANCH'
+-- mtn: already up to date at $good_rev
+check(qgrep(good_rev, "stderr"))
+check(base_revision() == good_rev)
+

reply via email to

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