Merge 0.10->trunk
authorKim Alvefur <zash@zash.se>
Mon, 20 Mar 2017 03:11:27 +0100
changeset 7992 5632aa85e0b6
parent 7989 522099269b49 (current diff)
parent 7991 dc758422d896 (diff)
child 7993 3d17b2bf0e0c
Merge 0.10->trunk
util/timer.lua
--- a/configure	Fri Mar 17 23:14:03 2017 +0100
+++ b/configure	Mon Mar 20 03:11:27 2017 +0100
@@ -2,10 +2,12 @@
 
 # Defaults
 
+APP_NAME="Prosody"
+APP_DIRNAME="prosody"
 PREFIX="/usr/local"
-SYSCONFDIR="$PREFIX/etc/prosody"
+SYSCONFDIR="$PREFIX/etc/$APP_DIRNAME"
 LIBDIR="$PREFIX/lib"
-DATADIR="$PREFIX/var/lib/prosody"
+DATADIR="$PREFIX/var/lib/$APP_DIRNAME"
 LUA_SUFFIX=""
 LUA_DIR="/usr"
 LUA_BINDIR="/usr/bin"
@@ -29,19 +31,19 @@
 
 show_help() {
 cat <<EOF
-Configure Prosody prior to building.
+Configure $APP_NAME prior to building.
 
 --help                      This help.
 --ostype=OS                 Use one of the OS presets. May be one of:
                             debian, macosx, linux, freebsd, openbsd, netbsd
---prefix=DIR                Prefix where Prosody should be installed.
+--prefix=DIR                Prefix where $APP_NAME should be installed.
                             Default is $PREFIX
 --sysconfdir=DIR            Location where the config file should be installed.
-                            Default is \$PREFIX/etc/prosody
+                            Default is \$PREFIX/etc/$APP_DIRNAME
 --libdir=DIR                Location where the server files should be stored.
                             Default is \$PREFIX/lib
 --datadir=DIR               Location where the server data should be stored.
-                            Default is \$PREFIX/var/lib/prosody
+                            Default is \$PREFIX/var/lib/$APP_DIRNAME
 --lua-version=VERSION       Use specific Lua version: 5.1, 5.2, or 5.3
                             Default is auto-detected.
 --lua-suffix=SUFFIX         Versioning suffix to use in Lua filenames.
@@ -77,7 +79,7 @@
                             Default is $CC
 --linker=CC                 The linker to use when building modules.
                             Default is $LD
---require-config            Will cause Prosody to refuse to run when
+--require-config            Will cause $APP_NAME to refuse to run when
                             it fails to find a configuration file
 --no-example-certs          Disables generation of example certificates.
 EOF
@@ -325,16 +327,16 @@
 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
 then
    if [ "$PREFIX" = "/usr" ]
-   then SYSCONFDIR=/etc/prosody
-   else SYSCONFDIR=$PREFIX/etc/prosody
+   then SYSCONFDIR=/etc/$APP_DIRNAME
+   else SYSCONFDIR=$PREFIX/etc/$APP_DIRNAME
    fi
 fi
 
 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ]
 then
    if [ "$PREFIX" = "/usr" ]
-   then DATADIR=/var/lib/prosody
-   else DATADIR=$PREFIX/var/lib/prosody
+   then DATADIR=/var/lib/$APP_DIRNAME
+   else DATADIR=$PREFIX/var/lib/$APP_DIRNAME
    fi
 fi
 
@@ -581,7 +583,7 @@
 EOF
 
 echo "Installation prefix: $PREFIX"
-echo "Prosody configuration directory: $SYSCONFDIR"
+echo "$APP_NAME configuration directory: $SYSCONFDIR"
 echo "Using Lua from: $LUA_DIR"
 
 make clean > /dev/null 2> /dev/null
--- a/util/statistics.lua	Fri Mar 17 23:14:03 2017 +0100
+++ b/util/statistics.lua	Mon Mar 20 03:11:27 2017 +0100
@@ -1,6 +1,6 @@
 local t_sort = table.sort
 local m_floor = math.floor;
-local time = require "socket".gettime;
+local time = require "util.time".now;
 
 local function nop_function() end
 
--- a/util/statsd.lua	Fri Mar 17 23:14:03 2017 +0100
+++ b/util/statsd.lua	Mon Mar 20 03:11:27 2017 +0100
@@ -1,6 +1,6 @@
 local socket = require "socket";
 
-local time = require "socket".gettime;
+local time = require "util.time".now
 
 local function new(config)
 	if not config or not config.statsd_server then
--- a/util/throttle.lua	Fri Mar 17 23:14:03 2017 +0100
+++ b/util/throttle.lua	Mon Mar 20 03:11:27 2017 +0100
@@ -1,5 +1,5 @@
 
-local gettime = require "socket".gettime;
+local gettime = require "util.time".now
 local setmetatable = setmetatable;
 local floor = math.floor;
 
--- a/util/timer.lua	Fri Mar 17 23:14:03 2017 +0100
+++ b/util/timer.lua	Mon Mar 20 03:11:27 2017 +0100
@@ -9,7 +9,7 @@
 local indexedbheap = require "util.indexedbheap";
 local log = require "util.logger".init("timer");
 local server = require "net.server";
-local get_time = require "socket".gettime;
+local get_time = require "util.time".now
 local type = type;
 local debug_traceback = debug.traceback;
 local tostring = tostring;