浏览代码

upgrading package: monotone 0.40 -> 0.41

Ralf S. Engelschall 17 年之前
父节点
当前提交
b92081ad85
共有 3 个文件被更改,包括 35 次插入245 次删除
  1. 0 208
      monotone/monotone.patch
  2. 33 33
      monotone/monotone.patch.rse
  3. 2 4
      monotone/monotone.spec

+ 0 - 208
monotone/monotone.patch

@@ -1,208 +0,0 @@
-Upstream fix for committing via SSH-agent.
-
-Index: key_store.cc
---- key_store.cc	55878f97b03349c66d95398799780f43ae63165b
-+++ key_store.cc	510eb02eab491fd9e79c49fcfcf5e6efa145872f
-@@ -438,6 +438,14 @@ key_store::cache_decrypted_key(const rsa
- key_store::cache_decrypted_key(const rsa_keypair_id & id)
- {
-   signing_key = id;
-+  keypair key;
-+  get_key_pair(id, key);
-+  if (s->get_agent().has_key(key))
-+    {
-+      L(FL("ssh-agent has key '%s' loaded, skipping internal cache") % id);
-+      return;
-+    }
-+
-   if (s->lua.hook_persist_phrase_ok())
-     s->decrypt_private_key(id);
- }
-Index: ssh_agent.cc
---- ssh_agent.cc	dcc8cefe23e376c74df2eb10011f874802a609d6
-+++ ssh_agent.cc	a2a0e96fd30804230e181747f36dcae3be34fd26
-@@ -20,6 +20,7 @@
- #include "botan/bigint.h"
- #include <boost/shared_ptr.hpp>
- #include "platform.hh"
-+#include "key_store.hh"
- 
- #ifdef WIN32
- #include "win32/ssh_agent_platform.hh"
-@@ -27,14 +28,18 @@
- #include "unix/ssh_agent_platform.hh"
- #endif
- 
-+using std::string;
-+using std::vector;
-+
-+using boost::shared_ptr;
-+using boost::shared_dynamic_cast;
-+
- using Botan::RSA_PublicKey;
- using Botan::RSA_PrivateKey;
- using Botan::BigInt;
- using Botan::SecureVector;
-+using Botan::X509_PublicKey;
- using Netxx::Stream;
--using boost::shared_ptr;
--using std::string;
--using std::vector;
- 
- struct ssh_agent_state : ssh_agent_platform
- {
-@@ -375,6 +380,35 @@ ssh_agent::get_keys()
-   return s->keys;
- }
- 
-+bool
-+ssh_agent::has_key(const keypair & key)
-+{
-+  //grab the monotone public key as an RSA_PublicKey
-+  SecureVector<Botan::byte> pub_block;
-+  pub_block.set(reinterpret_cast<Botan::byte const *>((key.pub)().data()),
-+                (key.pub)().size());
-+  L(FL("has_key: building %d-byte pub key") % pub_block.size());
-+  shared_ptr<X509_PublicKey> x509_key =
-+    shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
-+  shared_ptr<RSA_PublicKey> pub_key = shared_dynamic_cast<RSA_PublicKey>(x509_key);
-+
-+  if (!pub_key)
-+    throw informative_failure("has_key: Failed to get monotone RSA public key");
-+  
-+  vector<RSA_PublicKey> ssh_keys = get_keys();
-+  for (vector<RSA_PublicKey>::const_iterator
-+         si = ssh_keys.begin(); si != ssh_keys.end(); ++si)
-+    {
-+      if ((*pub_key).get_e() == (*si).get_e()
-+          && (*pub_key).get_n() == (*si).get_n())
-+        {
-+          L(FL("has_key: key found"));
-+          return true;
-+        }
-+    }
-+  return false;
-+}
-+
- void
- ssh_agent::sign_data(RSA_PublicKey const & key,
-                      string const & data,
-Index: ssh_agent.hh
---- ssh_agent.hh	c0c03bdb37905e1e6bbf8350a00fc68b0d83611b
-+++ ssh_agent.hh	c9b7efaf4b0f2c137336046b0ebe3ccff7ad5076
-@@ -13,6 +13,8 @@
- #include "vector.hh"
- #include <boost/scoped_ptr.hpp>
- 
-+struct keypair;
-+
- namespace Botan
- {
-   class RSA_PublicKey;
-@@ -26,6 +28,7 @@ struct ssh_agent
-   ssh_agent();
-   ~ssh_agent();
-   std::vector<Botan::RSA_PublicKey> const get_keys();
-+  bool has_key(const keypair & key);
-   void sign_data(Botan::RSA_PublicKey const & key,
-                  std::string const & data,
-                  std::string & out);
-
------------------------------------------------------------------------------
-
-Upstream fix:
-
-If the options --db or --keydir were previously specified for a 
-command which was executed inside a workspace and one or both
-option arguments were invalid (f.e. invalid paths), they were 
-still written to _MTN/options of the particular workspace.
-This lead to errors on any subsequent command which used these 
-options. This bug is fixed in so far that basic file type
-checks are applied on both options, so its no longer possible
-to set non-existing paths accidently or use a path to a directory
-as option argument for --db.
-
-Index: work.cc
---- work.cc	9c9fd46396607ec971ccf77b6dbdfe54934b9ec5
-+++ work.cc	0261cdf7dbc3baed0cdfc0e75a3a858f64eefa97
-@@ -180,7 +180,7 @@ workspace::workspace(app_state & app, i1
-     set_ws_options(app.opts, false);
- }
- 
--workspace::workspace(options const & opts, lua_hooks & lua, 
-+workspace::workspace(options const & opts, lua_hooks & lua,
-                      i18n_format const & explanation, bool writeback_options)
-   : lua(lua)
- {
-@@ -509,9 +509,15 @@ workspace::set_ws_options(options const 
-     read_options_file(o_path,
-                       database_option, branch_option, key_option, keydir_option);
- 
--  if (!opts.dbname.as_internal().empty())
-+    // FIXME: we should do more checks here, f.e. if this is a valid sqlite
-+    // file and if it contains the correct identifier, but these checks would
-+    // duplicate those in database.cc. At the time it is checked there, however,
-+    // the options file for the workspace is already written out...
-+  if (!opts.dbname.as_internal().empty() &&
-+      get_path_status(opts.dbname.as_internal()) == path::file)
-     database_option = opts.dbname;
--  if (!opts.key_dir.as_internal().empty())
-+  if (!opts.key_dir.as_internal().empty() &&
-+      get_path_status(opts.key_dir.as_internal()) == path::directory)
-     keydir_option = opts.key_dir;
-   if ((branch_is_sticky || workspace::branch_is_sticky)
-       && !opts.branchname().empty())
-@@ -1570,8 +1576,8 @@ workspace::perform_rename(database & db,
-           // touch foo
-           // mtn mv foo bar/foo where bar doesn't exist
-           file_path parent = dst.dirname();
--	        N(get_path_status(parent) == path::directory,
--	          F("destination path's parent directory %s/ doesn't exist") % parent);
-+            N(get_path_status(parent) == path::directory,
-+              F("destination path's parent directory %s/ doesn't exist") % parent);
-         }
- 
-       renames.insert(make_pair(src, dpath));
-
------------------------------------------------------------------------------
-
-Upstream fix:
-
-If a key clash occurs on a netsync operation, i.e. two different 
-keys with the same key id are encountered, mtn now fails cleanly 
-and provides further guidance how to proceed.
- 
-Index: netsync.cc
---- netsync.cc	255ab2fc2c3ca94f0686014fea03035ba7649bdf
-+++ netsync.cc	0be25c91e1a814bcb2070386e43d05297f51a1e6
-@@ -1335,9 +1335,28 @@ session::process_hello_cmd(rsa_keypair_i
-             % printable_key_hash);
-           project.db.set_var(their_key_key, printable_key_hash);
-         }
--      if (project.db.put_key(their_keyname, their_key))
--        W(F("saving public key for %s to database") % their_keyname);
- 
-+      if (project.db.public_key_exists(their_keyname))
-+        {
-+          rsa_pub_key tmp;
-+          project.db.get_key(their_keyname, tmp);
-+
-+          E(keys_match(their_keyname, tmp, their_keyname, their_key),
-+            F("the server sent a key with the key id '%s'\n"
-+              "which is already in use in your database. you may want to execute\n"
-+              "  %s dropkey %s\n"
-+              "on your local database before you run this command again,\n"
-+              "assumed that your local key has NOT a private counterpart.")
-+            % their_keyname % ui.prog_name % their_keyname);
-+        }
-+      else
-+        {
-+          // this should now always return true since we just checked
-+          // for the existance of this particular key
-+          I(project.db.put_key(their_keyname, their_key));
-+          W(F("saving public key for %s to database") % their_keyname);
-+        }
-+
-       {
-         hexenc<id> hnonce;
-         encode_hexenc(nonce, hnonce);

+ 33 - 33
monotone/monotone.patch.rse

@@ -301,8 +301,8 @@ Index: cmd_diff_log.cc
            if (next > 0)
 ===================================================================
 Index: cmd_netsync.cc
---- cmd_netsync.cc	27ebccae0f902d134ed780bc678b73c954613e43
-+++ cmd_netsync.cc	5034034bbb15b278bb355f80f1f3641fe4fe6261
+--- cmd_netsync.cc	34174bb7ce83722d7a9859b7065c40243ca0ba75
++++ cmd_netsync.cc	9e4cf97f7d4f031cd68999517822f5fc6121fb82
 @@ -253,7 +253,11 @@ CMD(pull, "pull", "", CMD_REF(network),
                                   args, info, false);
  
@@ -315,7 +315,7 @@ Index: cmd_netsync.cc
  
    run_netsync_protocol(app.opts, app.lua, project, keys,
                         client_voice, sink_role, info);
-@@ -355,9 +359,16 @@ CMD(clone, "clone", "", CMD_REF(network)
+@@ -356,9 +360,16 @@ CMD(clone, "clone", "", CMD_REF(network)
  
    // paths.cc's idea of the current workspace root is wrong at this point
    if (internal_db)
@@ -330,10 +330,10 @@ Index: cmd_netsync.cc
                                    / ws_internal_db_file_name);
 +#endif
  
-   // must do this after setting dbname so that _MTN/options is written
-   // correctly
-@@ -378,7 +389,11 @@ CMD(clone, "clone", "", CMD_REF(network)
-                                info, true, true);
+   // this is actually stupid, but app.opts.branchname must be set here
+   // otherwise it will not be written into _MTN/options, in case
+@@ -383,7 +394,11 @@ CMD(clone, "clone", "", CMD_REF(network)
+                                info, true, true, false);
  
    if (app.opts.signing_key() == "")
 +#if defined(RSE) /* cosmetics-netsync */
@@ -386,9 +386,9 @@ Index: cmd_ws_commit.cc
  CMD_NO_WORKSPACE(migrate_workspace, "migrate_workspace", "", CMD_REF(tree),
 ===================================================================
 Index: diff_patch.cc
---- diff_patch.cc	06f64d5def0166740f243dedf7fd6776662a0978
-+++ diff_patch.cc	d88b56756954ba8b7647cb83194f438cdcf8cbc0
-@@ -1442,6 +1442,9 @@ make_diff(string const & filename1,
+--- diff_patch.cc	211424b28fdc3a5dcdae5a781feea97e1e915326
++++ diff_patch.cc	0ebf55f44a911f3e72dc381c1dda3e762103ae7e
+@@ -1449,6 +1449,9 @@ make_diff(string const & filename1,
      {
        case unified_diff:
        {
@@ -398,7 +398,7 @@ Index: diff_patch.cc
          ost << "--- " << filename1 << '\t'
              << id1 << '\n';
          ost << "+++ " << filename2 << '\t'
-@@ -1453,6 +1456,9 @@ make_diff(string const & filename1,
+@@ -1460,6 +1463,9 @@ make_diff(string const & filename1,
        }
        case context_diff:
        {
@@ -451,9 +451,9 @@ Index: file_io.cc
  void
 ===================================================================
 Index: lua_hooks.cc
---- lua_hooks.cc	a747d898e036539c69beba100f6a67e1491b6f96
-+++ lua_hooks.cc	8e1fccf93d8658ff25a41f0a3c28e8689af7d86a
-@@ -208,7 +208,11 @@ lua_hooks::load_rcfiles(options & opts)
+--- lua_hooks.cc	e93b511c04660956edd432fda230877ca3c6fc2b
++++ lua_hooks.cc	0286c7452a45384187df02ccf6e33ee311828372
+@@ -209,7 +209,11 @@ lua_hooks::load_rcfiles(options & opts)
          {
            load_rcfile(opts.conf_dir / "monotonerc", false);
          }
@@ -467,8 +467,8 @@ Index: lua_hooks.cc
    // Command-line rcfiles override even that.
 ===================================================================
 Index: options_list.hh
---- options_list.hh	78fbe7c5728513ee672b75d6dcefbc2f508ba915
-+++ options_list.hh	55158b5e69d2fe75c58e51697a50724597910c47
+--- options_list.hh	cd0ff5a0d051b4644c02a5f81ed262a512c65360
++++ options_list.hh	25e39a62d57d8c82427a8deae709826cc2bff4a3
 @@ -233,6 +233,24 @@ OPTION(diff_options, no_show_encloser, f
    no_show_encloser = true;
  }
@@ -496,9 +496,9 @@ Index: options_list.hh
  #ifdef option_bodies
 ===================================================================
 Index: paths.cc
---- paths.cc	d850c3efae62041b8003589817387e5877f63b01
-+++ paths.cc	7bb66816f0cc3ee8e13527d0ee3b1fc0a1d56411
-@@ -226,7 +226,11 @@ in_bookkeeping_dir(string const & path)
+--- paths.cc	dde6659e387c8890c96278ea29e3196bdf588139
++++ paths.cc	3101fad7134c9f2383bee0b65219cdec1d46f2e4
+@@ -227,7 +227,11 @@ in_bookkeeping_dir(string const & path)
  static inline bool
  in_bookkeeping_dir(string const & path)
  {
@@ -510,7 +510,7 @@ Index: paths.cc
      return false;
    if (path.size() == 1 || (path[1] != 'M' && path[1] != 'm'))
      return false;
-@@ -919,6 +923,9 @@ find_and_go_to_workspace(string const & 
+@@ -929,6 +933,9 @@ find_and_go_to_workspace(string const & 
    // first look for the current name of the bookkeeping directory.
    // if we don't find it, look for it under the old name, so that
    // migration has a chance to work.
@@ -520,7 +520,7 @@ Index: paths.cc
    if (!find_bookdir(root, bookkeeping_root_component, current, removed))
      if (!find_bookdir(root, old_bookkeeping_root_component, current, removed))
        return false;
-@@ -1478,7 +1485,11 @@ static void check_bk_normalizes_to(char 
+@@ -1488,7 +1495,11 @@ static void check_bk_normalizes_to(char 
  
  static void check_bk_normalizes_to(char const * before, char const * after)
  {
@@ -554,9 +554,9 @@ Index: paths.hh
  {
 ===================================================================
 Index: roster_merge.cc
---- roster_merge.cc	b2fca269f9de878a4c50a48f2f437cc385db52a7
-+++ roster_merge.cc	71b58f073db3e56731b1a969bdbd95983926806d
-@@ -1296,6 +1296,20 @@ roster_merge(roster_t const & left_paren
+--- roster_merge.cc	9bb39c2c87f92180b0a5db5697ff6ea15b82d25b
++++ roster_merge.cc	9b75d448ee88458f86092ee8d7f4720b24d211a9
+@@ -1854,6 +1854,20 @@ roster_merge(roster_t const & left_paren
            result.roster.detach_node(n->self);
            result.invalid_name_conflicts.push_back(conflict);
          }
@@ -577,7 +577,7 @@ Index: roster_merge.cc
      }
  }
  
-@@ -2228,7 +2242,12 @@ struct simple_invalid_name_conflict : pu
+@@ -2786,7 +2800,12 @@ struct simple_invalid_name_conflict : pu
        I(!result.is_clean());
        invalid_name_conflict const & c = idx(result.invalid_name_conflicts, 0);
        I(c.nid == bad_dir_nid);
@@ -592,8 +592,8 @@ Index: roster_merge.cc
        result.invalid_name_conflicts.pop_back();
 ===================================================================
 Index: std_hooks.lua
---- std_hooks.lua	9fd3160c435eff59acc8622875047304e3472b9c
-+++ std_hooks.lua	ad10b3627e6bdb4124ee553843ee9552ea41fb87
+--- std_hooks.lua	7e22137903335a8b7dd2ce7bc9969b8962ff85be
++++ std_hooks.lua	751f8ca2cb91b2ecca05caef00466bd020ce3ca8
 @@ -284,6 +284,15 @@ function edit_comment(basetext, user_log
     if user_log_message == "" or string.sub(user_log_message, -1) ~= "\n" then
        tmp:write("\n")
@@ -610,7 +610,7 @@ Index: std_hooks.lua
     tmp:write(basetext)
     io.close(tmp)
  
-@@ -1257,3 +1266,201 @@ end
+@@ -1273,3 +1282,201 @@ end
        return push_hook_functions(notifier)
     end
  end
@@ -814,8 +814,8 @@ Index: std_hooks.lua
 +
 ===================================================================
 Index: work.cc
---- work.cc	9c9fd46396607ec971ccf77b6dbdfe54934b9ec5
-+++ work.cc	504af8561f70be210430114d21fcee74e87a34df
+--- work.cc	0ef66673796d2a408587d70530944a5a8747d488
++++ work.cc	8cfa90878704a6fc1553c4dc14bf1be428831674
 @@ -57,35 +57,55 @@ get_revision_path(bookkeeping_path & m_p
  static void
  get_revision_path(bookkeeping_path & m_path)
@@ -926,7 +926,7 @@ Index: work.cc
    read_options_file(o_path,
                      database_option, branch_option, key_option, keydir_option);
  }
-@@ -557,7 +599,11 @@ workspace::get_local_dump_path(bookkeepi
+@@ -563,7 +605,11 @@ workspace::get_local_dump_path(bookkeepi
  {
    N(workspace::found, F("workspace required but not found"));
  
@@ -938,7 +938,7 @@ Index: work.cc
    L(FL("local dump path is %s") % d_path);
  }
  
-@@ -929,7 +975,11 @@ path_for_detached_nids()
+@@ -976,7 +1022,11 @@ path_for_detached_nids()
  static inline bookkeeping_path
  path_for_detached_nids()
  {
@@ -950,7 +950,7 @@ Index: work.cc
  }
  
  static inline bookkeeping_path
-@@ -1668,9 +1718,15 @@ workspace::perform_pivot_root(database &
+@@ -1715,9 +1765,15 @@ workspace::perform_pivot_root(database &
    N(is_dir_t(new_roster.get_node(new_root)),
      F("proposed new root directory '%s' is not a directory") % new_root);
    {

+ 2 - 4
monotone/monotone.spec

@@ -31,8 +31,8 @@ Distribution: OpenPKG Community
 Class:        EVAL
 Group:        SCM
 License:      GPL
-Version:      0.40
-Release:      20080705
+Version:      0.41
+Release:      20080904
 
 #   package options
 %option       with_rse  yes
@@ -44,7 +44,6 @@ Source3:      monotone-setup.sh
 Source4:      monotone-colorize.pl
 Source5:      monotone-colorize.bashrc
 Source6:      monotone.bashrc
-Patch0:       monotone.patch
 Patch1:       monotone.patch.rse
 
 #   build information
@@ -77,7 +76,6 @@ AutoReqProv:  no
 
 %prep
     %setup -q
-    %patch -p0 -P 0
 %if "%{with_rse}" == "yes"
     %patch -p0 -P 1
 %endif