This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Tarantool -- an efficient key/value data store".

The branch master has been updated
       via  42d063743b74816bb0d49ed1d94dfc5d0f157e9f (commit)
       via  8ead447946b84702a6e4742c497b1d338af53a7b (commit)
       via  e6bb650b9d11f2b591f95f6126e7805babd31f71 (commit)
       via  75be04a624ef15935cef7a489b96b10f817109f4 (commit)
       via  2750e1d9209141470427f85bf94dc707eeea313d (commit)
       via  5fa44c6e6f646ba3fa8e6a377608186110dd64bd (commit)
       via  ae9e5ef64f1cc8e0495b02cbf0f46cd86996992d (commit)
       via  1419a6e2943fd59099c2e60621dae507a51eda91 (commit)
       via  ba71da768ad562e3a0c4146521942f8e7b075325 (commit)
       via  8cf4386e7998ac6cc00c97cfa15ae2e0c7649f50 (commit)
       via  3ef3176a37b12368b742ba05b831beea4c6db8ea (commit)
       via  2f2fb3462be08c2b43ec9674b87c4e4e9dff5f57 (commit)
       via  b2fc4fd40a0e7d2caa29b535c5eeb758930f0b06 (commit)
      from  2e426125285047cd43029903da95ddbe75703d33 (commit)

Summary of changes:
 cfg/warning.c           |    4 +-
 core/say.c              |   38 +++++-
 core/tarantool.c        |  213 +++++++++++++------------------
 include/say.h           |   28 ++--
 include/tarantool.h     |    8 +-
 mod/silverbox/box.h     |    2 +-
 test/box/args.result    |   62 ++++++++--
 test/box/args.test      |    9 +-
 third_party/Makefile    |    2 +
 third_party/gopt/gopt.c |  325 +++++++++++++++++++++++++++++++++++++++++++++++
 third_party/gopt/gopt.h |   70 ++++++++++
 11 files changed, 596 insertions(+), 165 deletions(-)
 create mode 100644 third_party/gopt/gopt.c
 create mode 100644 third_party/gopt/gopt.h

commit 42d063743b74816bb0d49ed1d94dfc5d0f157e9f
Merge: 8ead447 e6bb650
Author: Yuriy Vostrikov <[email protected]>
Date:   Thu Dec 23 12:30:39 2010 +0300

    Merge branch 'core-error-reporting'
    
    * core-error-reporting:
      [core] Fix wording.
      [core] Cleanup error reporting.

diff --cc core/say.c
index 73d1266,f123e20..7477774
--- a/core/say.c
+++ b/core/say.c
@@@ -96,6 -96,6 +96,8 @@@ say_logger_init(int nonblock
        out:
        if (nonblock)
                set_nonblock(sayfd);
++
++      setvbuf(stderr, NULL, _IONBF, 0);
  }
  
  void
@@@ -103,8 -103,19 +105,18 @@@ vsay(int level, const char *filename, i
  {
        char *peer_name = fiber_peer_name(fiber);
        size_t p = 0, len = PIPE_BUF;
+       const char *f;
        static char buf[PIPE_BUF];
  
+       if (booting) {
+               fprintf(stderr, "%s: ", binary_filename);
+               vfprintf(stderr, format, ap);
+               if (error)
+                       fprintf(stderr, ": %s", error);
+               fprintf(stderr, "\n");
 -              fflush(stderr);
+               return;
+       }
+ 
        ev_now_update();
  
        if (peer_name == NULL)
diff --cc core/tarantool.c
index 456870e,92d3e32..ea01b97
--- a/core/tarantool.c
+++ b/core/tarantool.c
@@@ -54,11 -54,11 +54,12 @@@
  #include <tarantool_version.h>
  
  static pid_t master_pid;
 -const char *cfg_filename = "tarantool.cfg";
 +#define DEFAULT_CFG_FILENAME "tarantool.cfg"
 +const char *cfg_filename = DEFAULT_CFG_FILENAME;
+ char *binary_filename;
  struct tarantool_cfg cfg;
  
- bool init_storage;
+ bool init_storage, booting = true;
  
  extern int daemonize(int nochdir, int noclose);
  
@@@ -238,29 -236,27 +237,30 @@@ main(int argc, char **argv
        palloc_init();
  
        const void *opt_def =
 -              gopt_start(gopt_option('h', 0, gopt_shorts('h', '?'), 
gopt_longs("help"),
 -                                     NULL, "display this help"),
 -                         gopt_option('c', GOPT_ARG, gopt_shorts('c'), 
gopt_longs("config"),
 -                                     "=<filename>", "path to config file"),
 -                         gopt_option('v', 0, gopt_shorts('V'), 
gopt_longs("version"),
 -                                     NULL, "print version"),
 +              gopt_start(gopt_option('g', GOPT_ARG, gopt_shorts(0),
 +                                     gopt_longs("cfg-get", "cfg_get"),
 +                                     "=KEY", "return a value from 
configuration file described by KEY"),
 +                         gopt_option('c', GOPT_ARG, gopt_shorts('c'),
 +                                     gopt_longs("config"),
 +                                     "=FILE", "path to configuration file 
(default: " DEFAULT_CFG_FILENAME ")"),
  #ifdef STORAGE
                           gopt_option('C', 0, gopt_shorts(0), 
gopt_longs("cat"),
 -                                     "=<filename>", "cat file to stdout in 
readable format"),
 -                         gopt_option('I', 0, gopt_shorts(0), 
gopt_longs("init_storage", "init-storage"),
 -                                     NULL, "initialize storage"),
 +                                     "=FILE", "cat snapshot file to stdout in 
readable format and exit"),
 +                         gopt_option('I', 0, gopt_shorts(0),
 +                                     gopt_longs("init-storage", 
"init_storage"),
 +                                     NULL, "initialize storage (an empty 
snapshot file) and exit"),
  #endif
                           gopt_option('v', 0, gopt_shorts('v'), 
gopt_longs("verbose"),
 -                                     NULL, "increase log level"),
 +                                     NULL, "increase verbosity level in log 
messages"),
                           gopt_option('D', 0, gopt_shorts('D'), 
gopt_longs("daemonize"),
 -                                     NULL, "daemonize"),
 -                         gopt_option('g', GOPT_ARG, gopt_shorts(0), 
gopt_longs("cfg_get", "cfg-get"),
 -                                     "=<key>", "return value from config 
described by key"));
 +                                     NULL, "redirect input/output streams to 
a log file and run as daemon"),
 +                         gopt_option('h', 0, gopt_shorts('h', '?'), 
gopt_longs("help"),
 +                                     NULL, "display this help and exit"),
 +                         gopt_option('V', 0, gopt_shorts('V'), 
gopt_longs("version"),
 +                                     NULL, "print program version and exit"));
  
        void *opt = gopt_sort(&argc, (const char **)argv, opt_def);
+       binary_filename = argv[0];
  
        if (gopt(opt, 'V')){
                puts(tarantool_version());
diff --cc mod/silverbox/box.h
index d9ece50,888af4c..a8cd2bf
--- a/mod/silverbox/box.h
+++ b/mod/silverbox/box.h
@@@ -118,12 -178,7 +118,12 @@@ enum box_mode 
  
  ENUM(messages, MESSAGES);
  
 -struct box_tuple *index_find(struct index *index, void *key);
 +#define box_raise(n, err)                                             \
 +      ({                                                              \
 +              if (n != ERR_CODE_NODE_IS_RO)                           \
-                       say_warn("box.c:%i %s/%s", __LINE__, 
error_codes_strs[(n)], err); \
++                      say_warn("%s/%s", error_codes_strs[(n)], err);  \
 +              raise(n, err);                                          \
 +      })
  
  struct box_txn *txn_alloc(u32 flags);
  u32 box_dispach(struct box_txn *txn, enum box_mode mode, u16 op, struct tbuf 
*data);
diff --cc test/box/args.result
index 9afa75f,0000000..6fa9d08
mode 100644,000000..100644
--- a/test/box/args.result
+++ b/test/box/args.result
@@@ -1,65 -1,0 +1,65 @@@
 +tarantool_silverbox --help
 +Tarantool -- an efficient in-memory data store.
 +Usage: tarantool_silverbox [OPTIONS]
 +
 +      --cfg-get=KEY       return a value from configuration file described by
 +                          KEY
 +  -c, --config=FILE       path to configuration file (default: tarantool.cfg)
 +      --cat=FILE          cat snapshot file to stdout in readable format and
 +                          exit
 +      --init-storage      initialize storage (an empty snapshot file) and exit
 +  -v, --verbose           increase verbosity level in log messages
 +  -D, --daemonize         redirect input/output streams to a log file and run 
as
 +                          daemon
 +  -h, --help              display this help and exit
 +  -V, --version           print program version and exit
 +
 +Please visit project home page at http://launchpad.net/tarantool
 +to see online documentation, submit bugs or contribute a patch.
 +
 +tarantool_silverbox -h
 +Tarantool -- an efficient in-memory data store.
 +Usage: tarantool_silverbox [OPTIONS]
 +
 +      --cfg-get=KEY       return a value from configuration file described by
 +                          KEY
 +  -c, --config=FILE       path to configuration file (default: tarantool.cfg)
 +      --cat=FILE          cat snapshot file to stdout in readable format and
 +                          exit
 +      --init-storage      initialize storage (an empty snapshot file) and exit
 +  -v, --verbose           increase verbosity level in log messages
 +  -D, --daemonize         redirect input/output streams to a log file and run 
as
 +                          daemon
 +  -h, --help              display this help and exit
 +  -V, --version           print program version and exit
 +
 +Please visit project home page at http://launchpad.net/tarantool
 +to see online documentation, submit bugs or contribute a patch.
 +
 +tarantool_silverbox -Z
 +tarantool_silverbox: -Z: unknown option
 +
 +tarantool_silverbox --no-such-option
 +tarantool_silverbox: --no-such-option: unknown option
 +
 +tarantool_silverbox --version --no-such-option
 +tarantool_silverbox: --no-such-option: unknown option
 +
 +tarantool_silverbox --config
 +tarantool_silverbox: --config: option requires an option argument
 +
 +tarantool_silverbox -c
 +tarantool_silverbox: -c: option requires an option argument
 +
 +tarantool_silverbox --config tarantool.cfg
- <time> <pid> 0/(null) _ F> PANIC tarantool.c:deamon is running
++tarantool_silverbox: the daemon is already running
 +
 +tarantool_silverbox --daemonize
- <time> <pid> 0/(null) _ F> PANIC tarantool.c:deamon is running
++tarantool_silverbox: the daemon is already running
 +
 +tarantool_silverbox --version
 +1.3.minor-<rev>-<commit>
 +
 +tarantool_silverbox -V
 +1.3.minor-<rev>-<commit>
 +
diff --cc test/box/args.test
index 8ff61b7,0000000..77ba40e
mode 100644,000000..100644
--- a/test/box/args.test
+++ b/test/box/args.test
@@@ -1,17 -1,0 +1,15 @@@
 +server.test_option("--help")
 +server.test_option("-h")
 +sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool")
- sys.stdout.push_filter("^\d+\.\d+ \d+", "<time> <pid>")
 +server.test_option("-Z")
 +server.test_option("--no-such-option")
 +server.test_option("--version --no-such-option")
 +server.test_option("--config")
 +server.test_option("-c")
 +server.test_option("--config tarantool.cfg")
 +server.test_option("--daemonize")
 +sys.stdout.pop_filter()
 +sys.stdout.push_filter("(\d\.\d)\.\d-\d+-\S+", "\\1.minor-<rev>-<commit>")
 +server.test_option("--version")
 +server.test_option("-V          ")
 +sys.stdout.pop_filter()
- sys.stdout.pop_filter()

commit 8ead447946b84702a6e4742c497b1d338af53a7b
Merge: 2e42612 75be04a
Author: Yuriy Vostrikov <[email protected]>
Date:   Thu Dec 23 12:20:45 2010 +0300

    Merge branch 'core-help'
    
    * core-help:
      [core] Simplify tests.
      [core] Align help to fit 80 chars. Add more tests. Fix indening.
      Bug#684700 -h and --help options are broken
      Bug#684700 -h and --help options are broken
      Bug#684700 -h and --help options are broken
      [core] Implement command options parsing via gopt.
      [core] Enable --help switch.


commit e6bb650b9d11f2b591f95f6126e7805babd31f71
Author: Yuriy Vostrikov <[email protected]>
Date:   Thu Dec 23 11:08:27 2010 +0300

    [core] Fix wording.

diff --git a/core/tarantool.c b/core/tarantool.c
index f8ece3a..92d3e32 100644
--- a/core/tarantool.c
+++ b/core/tarantool.c
@@ -184,9 +184,9 @@ create_pid(void)
        if (fgets(buf, sizeof(buf), f) != NULL && strlen(buf) > 0) {
                pid = strtol(buf, NULL, 10);
                if (pid > 0 && kill(pid, 0) == 0)
-                       panic("i am already running");
+                       panic("the daemon is already running");
                else
-                       say_info("updating stale pid file");
+                       say_info("updating a stale pid file");
                fseeko(f, 0, SEEK_SET);
                if (ftruncate(fileno(f), 0) == -1)
                        panic_syserror("ftruncate(`%s')", cfg.pid_file);
@@ -302,7 +302,7 @@ main(int argc, char **argv)
        fclose(f);
 
        if (n_accepted == 0 || n_skipped > 0)
-               panic("where were errors in config file");
+               panic("there were errors in the config file");
 
 #ifdef STORAGE
        if (gopt_arg(opt, 'C', &cat_filename)) {

-- 
Tarantool -- an efficient key/value data store

_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to