[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r24593 - in gnunet/src: arm ats ats-tool chat core datastor
From: |
gnunet |
Subject: |
[GNUnet-SVN] r24593 - in gnunet/src: arm ats ats-tool chat core datastore dht dns dv exit fs gns hostlist include lockmanager mesh namestore nat nse peerinfo pt regex statistics template testbed testing topology transport util vpn |
Date: |
Mon, 29 Oct 2012 17:14:03 +0100 |
Author: grothoff
Date: 2012-10-29 17:14:03 +0100 (Mon, 29 Oct 2012)
New Revision: 24593
Modified:
gnunet/src/arm/Makefile.am
gnunet/src/arm/do_start_process.c
gnunet/src/ats-tool/
gnunet/src/ats/Makefile.am
gnunet/src/chat/Makefile.am
gnunet/src/chat/test_chat.c
gnunet/src/chat/test_chat_private.c
gnunet/src/core/Makefile.am
gnunet/src/core/test_core_api.c
gnunet/src/core/test_core_api_reliability.c
gnunet/src/core/test_core_api_start_only.c
gnunet/src/core/test_core_quota_compliance.c
gnunet/src/datastore/Makefile.am
gnunet/src/dht/Makefile.am
gnunet/src/dns/Makefile.am
gnunet/src/dv/Makefile.am
gnunet/src/exit/Makefile.am
gnunet/src/fs/Makefile.am
gnunet/src/gns/Makefile.am
gnunet/src/hostlist/Makefile.am
gnunet/src/hostlist/test_gnunet_daemon_hostlist.c
gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
gnunet/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
gnunet/src/include/gnunet_os_lib.h
gnunet/src/lockmanager/Makefile.am
gnunet/src/mesh/Makefile.am
gnunet/src/namestore/Makefile.am
gnunet/src/nat/Makefile.am
gnunet/src/nse/Makefile.am
gnunet/src/peerinfo/Makefile.am
gnunet/src/pt/Makefile.am
gnunet/src/regex/
gnunet/src/statistics/Makefile.am
gnunet/src/statistics/test_statistics_api.c
gnunet/src/statistics/test_statistics_api_loop.c
gnunet/src/statistics/test_statistics_api_watch.c
gnunet/src/statistics/test_statistics_api_watch_zero_value.c
gnunet/src/template/Makefile.am
gnunet/src/testbed/Makefile.am
gnunet/src/testing/testing.c
gnunet/src/topology/Makefile.am
gnunet/src/transport/Makefile.am
gnunet/src/util/
gnunet/src/util/Makefile.am
gnunet/src/util/helper.c
gnunet/src/util/os_installation.c
gnunet/src/util/test_resolver_api.c
gnunet/src/vpn/Makefile.am
Log:
installing all service, daemon and helper binaries to lib/gnunet/libexec/;
updating code to run binaries from new location, which is no longer in PATH
Modified: gnunet/src/arm/Makefile.am
===================================================================
--- gnunet/src/arm/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/arm/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
arm.conf
@@ -27,7 +29,9 @@
bin_PROGRAMS = \
- gnunet-arm \
+ gnunet-arm
+
+libexec_PROGRAMS = \
gnunet-service-arm \
mockup-service
Modified: gnunet/src/arm/do_start_process.c
===================================================================
--- gnunet/src/arm/do_start_process.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/arm/do_start_process.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -1,3 +1,23 @@
+/*
+ This file is part of GNUnet.
+ (C) 2011, 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
/**
* Actually start a process. All of the arguments given to this
* function are strings that are used for the "argv" array. However,
@@ -27,6 +47,7 @@
char *cp;
const char *last;
struct GNUNET_OS_Process *proc;
+ char *binary_path;
argv_size = 1;
va_start (ap, first_arg);
@@ -98,9 +119,14 @@
/* *INDENT-ON* */
va_end (ap);
argv[argv_size] = NULL;
- proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks,
argv[0], argv);
+ binary_path = GNUNET_OS_get_libexec_binary_path (argv[0]);
+ proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks,
+ binary_path, argv);
while (argv_size > 0)
GNUNET_free (argv[--argv_size]);
GNUNET_free (argv);
+ GNUNET_free (binary_path);
return proc;
}
+
+/* end of do_start_process.c */
Modified: gnunet/src/ats/Makefile.am
===================================================================
--- gnunet/src/ats/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/ats/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
ats.conf
@@ -36,7 +38,7 @@
-version-info 2:0:2
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-ats
gnunet_service_ats_SOURCES = \
Index: gnunet/src/ats-tool
===================================================================
--- gnunet/src/ats-tool 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/ats-tool 2012-10-29 16:14:03 UTC (rev 24593)
Property changes on: gnunet/src/ats-tool
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+Makefile.in
+Makefile
+gnunet-ats
+.deps
Modified: gnunet/src/chat/Makefile.am
===================================================================
--- gnunet/src/chat/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/chat/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
chat.conf
@@ -25,8 +27,10 @@
$(GN_LIB_LDFLAGS) $(WINFLAGS) \
-version-info 0:0:0
+libexec_PROGRAMS = \
+ gnunet-service-chat
+
bin_PROGRAMS = \
- gnunet-service-chat \
gnunet-chat
gnunet_service_chat_SOURCES = \
Modified: gnunet/src/chat/test_chat.c
===================================================================
--- gnunet/src/chat/test_chat.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/chat/test_chat.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -116,17 +116,18 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
"-c", cfgname, NULL);
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
+ GNUNET_free (binary);
}
Modified: gnunet/src/chat/test_chat_private.c
===================================================================
--- gnunet/src/chat/test_chat_private.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/chat/test_chat_private.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -124,23 +124,24 @@
static int is_p2p;
-struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *bob_public_key = NULL;
+static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *bob_public_key;
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
"-c", cfgname, NULL);
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
+ GNUNET_free (binary);
}
@@ -614,9 +615,6 @@
"test-chat",
"-c",
"test_chat_data.conf",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -624,11 +622,7 @@
};
GNUNET_log_setup ("test_chat",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
if (strstr (argv[0], "p2p") != NULL)
{
Modified: gnunet/src/core/Makefile.am
===================================================================
--- gnunet/src/core/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/core/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
core.conf
@@ -30,8 +32,10 @@
-version-info 0:0:0
+libexec_PROGRAMS = \
+ gnunet-service-core
+
bin_PROGRAMS = \
- gnunet-service-core \
gnunet-core
gnunet_service_core_SOURCES = \
Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/core/test_core_api.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -316,20 +316,23 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
- "gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL, NULL,
+ binary,
+ "gnunet-service-arm",
"-c", cfgname, NULL);
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
GNUNET_assert (p->th != NULL);
p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
+ GNUNET_free (binary);
}
Modified: gnunet/src/core/test_core_api_reliability.c
===================================================================
--- gnunet/src/core/test_core_api_reliability.c 2012-10-29 15:43:23 UTC (rev
24592)
+++ gnunet/src/core/test_core_api_reliability.c 2012-10-29 16:14:03 UTC (rev
24593)
@@ -426,10 +426,13 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
"-c", cfgname, NULL);
#endif
@@ -437,6 +440,7 @@
p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
GNUNET_assert (p->th != NULL);
p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
+ GNUNET_free (binary);
}
Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c 2012-10-29 15:43:23 UTC (rev
24592)
+++ gnunet/src/core/test_core_api_start_only.c 2012-10-29 16:14:03 UTC (rev
24593)
@@ -137,12 +137,18 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
- "gnunet-service-arm",
- "-c", cfgname, NULL);
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL, NULL,
+ binary,
+ "gnunet-service-arm",
+ "-c", cfgname, NULL);
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
+ GNUNET_free (binary);
}
Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c 2012-10-29 15:43:23 UTC
(rev 24592)
+++ gnunet/src/core/test_core_quota_compliance.c 2012-10-29 16:14:03 UTC
(rev 24593)
@@ -570,10 +570,13 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
"-c", cfgname, NULL);
#endif
@@ -583,6 +586,7 @@
p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
GNUNET_assert (p->th != NULL);
p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
+ GNUNET_free (binary);
}
Modified: gnunet/src/datastore/Makefile.am
===================================================================
--- gnunet/src/datastore/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/datastore/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -4,6 +4,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
datastore.conf
@@ -31,7 +33,7 @@
-version-info 1:0:0
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-datastore
gnunet_service_datastore_SOURCES = \
Modified: gnunet/src/dht/Makefile.am
===================================================================
--- gnunet/src/dht/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/dht/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -7,6 +7,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
dht.conf
@@ -50,8 +52,10 @@
-bin_PROGRAMS = \
- gnunet-service-dht \
+libexec_PROGRAMS = \
+ gnunet-service-dht
+
+noinst_PROGRAMS = \
gnunet-dht-monitor \
gnunet-dht-get \
gnunet-dht-put
Modified: gnunet/src/dns/Makefile.am
===================================================================
--- gnunet/src/dns/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/dns/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -10,6 +10,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
plugindir = $(libdir)/gnunet
pkgcfg_DATA = \
@@ -18,7 +20,7 @@
if LINUX
HIJACKBIN = gnunet-helper-dns
install-exec-hook:
- $(top_srcdir)/src/dns/install-dns-helper.sh $(bindir)
$(GNUNETDNS_GROUP) $(SUDO_BINARY) || true
+ $(top_srcdir)/src/dns/install-dns-helper.sh $(libexecdir)
$(GNUNETDNS_GROUP) $(SUDO_BINARY) || true
else
install-exec-hook:
endif
@@ -28,7 +30,7 @@
libgnunetdnsstub.la \
libgnunetdns.la
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-dns $(HIJACKBIN)
noinst_PROGRAMS = \
Modified: gnunet/src/dv/Makefile.am
===================================================================
--- gnunet/src/dv/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/dv/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -11,6 +11,8 @@
plugindir = $(libdir)/gnunet
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfgdir= $(pkgdatadir)/config.d/
pkgcfg_DATA = \
@@ -31,7 +33,7 @@
-version-info 0:0:0
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-dv
gnunet_service_dv_SOURCES = \
Modified: gnunet/src/exit/Makefile.am
===================================================================
--- gnunet/src/exit/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/exit/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -10,6 +10,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
plugindir = $(libdir)/gnunet
dist_pkgcfg_DATA = \
@@ -18,16 +20,16 @@
if LINUX
EXITBIN = gnunet-helper-exit
install-exec-hook:
- $(top_srcdir)/src/exit/install-exit-helper.sh $(bindir) $(SUDO_BINARY)
|| true
+ $(top_srcdir)/src/exit/install-exit-helper.sh $(libexecdir)
$(SUDO_BINARY) || true
else
install-exec-hook:
endif
-bin_PROGRAMS = \
- gnunet-daemon-exit $(EXITBIN)
+libexec_PROGRAMS = \
+ gnunet-daemon-exit \
+ $(EXITBIN)
-
gnunet_helper_exit_SOURCES = \
gnunet-helper-exit.c
Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/fs/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -11,6 +11,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
fs.conf
@@ -60,15 +62,17 @@
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/testbed/libgnunettestbed.la
+libexec_PROGRAMS = \
+ gnunet-helper-fs-publish \
+ gnunet-service-fs
+
bin_PROGRAMS = \
gnunet-auto-share \
gnunet-directory \
gnunet-download \
gnunet-publish \
- gnunet-helper-fs-publish \
gnunet-pseudonym \
gnunet-search \
- gnunet-service-fs \
gnunet-fs \
gnunet-unindex
Modified: gnunet/src/gns/Makefile.am
===================================================================
--- gnunet/src/gns/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/gns/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -28,6 +28,8 @@
pkgcfgdir = $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
plugindir = $(libdir)/gnunet
pkgcfg_DATA = \
@@ -47,10 +49,12 @@
endif
endif
+libexec_PROGRAMS = \
+ gnunet-service-gns
+
bin_PROGRAMS = \
- gnunet-service-gns \
$(DO_FCFSD) \
- $(DO_PROXY) \
+ $(DO_PROXY) \
$(DO_W32_HELPER) \
$(DO_W32_NSPTOOLS) \
gnunet-gns \
Modified: gnunet/src/hostlist/Makefile.am
===================================================================
--- gnunet/src/hostlist/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/hostlist/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
dist_pkgcfg_DATA = \
hostlist.conf
@@ -15,7 +17,7 @@
endif
if HAVE_LIBCURL
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-daemon-hostlist
endif
Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist.c 2012-10-29 15:43:23 UTC
(rev 24592)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist.c 2012-10-29 16:14:03 UTC
(rev 24593)
@@ -131,9 +131,12 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
"-c", cfgname, NULL);
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -141,6 +144,7 @@
GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL);
GNUNET_assert (p->th != NULL);
p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
+ GNUNET_free (binary);
}
Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c 2012-10-29
15:43:23 UTC (rev 24592)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c 2012-10-29
16:14:03 UTC (rev 24593)
@@ -382,10 +382,12 @@
{
char *filename;
unsigned int result;
+ char *binary;
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
"-c", cfgname, NULL);
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -408,20 +410,25 @@
GNUNET_assert (NULL != p->core);
p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg);
GNUNET_assert (NULL != p->stats);
+ GNUNET_free (binary);
}
static void
setup_adv_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
"-c", cfgname, NULL);
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg);
GNUNET_assert (NULL != p->stats);
+ GNUNET_free (binary);
}
Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c 2012-10-29
15:43:23 UTC (rev 24592)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c 2012-10-29
16:14:03 UTC (rev 24593)
@@ -141,14 +141,14 @@
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, binary,
"gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
"-c", cfgname, NULL);
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -156,6 +156,7 @@
GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL);
GNUNET_assert (p->th != NULL);
p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
+ GNUNET_free (binary);
}
Modified: gnunet/src/include/gnunet_os_lib.h
===================================================================
--- gnunet/src/include/gnunet_os_lib.h 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/include/gnunet_os_lib.h 2012-10-29 16:14:03 UTC (rev 24593)
@@ -151,7 +151,12 @@
* Return the prefix of the path with documentation files, including the
* license (share/doc/gnunet/).
*/
- GNUNET_OS_IPK_DOCDIR
+ GNUNET_OS_IPK_DOCDIR,
+
+ /**
+ * Return the directory where helper binaries are installed
(lib/gnunet/libexec/)
+ */
+ GNUNET_OS_IPK_LIBEXECDIR
};
@@ -201,6 +206,18 @@
/**
+ * Given the name of a gnunet-helper, gnunet-service or gnunet-daemon
+ * binary, try to prefix it with the libexec/-directory to get the
+ * full path.
+ *
+ * @param progname name of the binary
+ * @return full path to the binary, if possible, otherwise copy of 'progname'
+ */
+char *
+GNUNET_OS_get_libexec_binary_path (const char *progname);
+
+
+/**
* Callback function invoked for each interface found.
*
* @param cls closure
Modified: gnunet/src/lockmanager/Makefile.am
===================================================================
--- gnunet/src/lockmanager/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/lockmanager/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -11,10 +11,12 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
lockmanager.conf
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-lockmanager
lib_LTLIBRARIES = \
Modified: gnunet/src/mesh/Makefile.am
===================================================================
--- gnunet/src/mesh/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/mesh/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -11,6 +11,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
mesh.conf
@@ -18,7 +20,7 @@
AM_CLFAGS = -g
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-mesh
lib_LTLIBRARIES = \
Modified: gnunet/src/namestore/Makefile.am
===================================================================
--- gnunet/src/namestore/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/namestore/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -4,6 +4,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
namestore.conf
@@ -63,8 +65,10 @@
$(GN_LIB_LDFLAGS) $(WINFLAGS) \
-version-info 0:0:0
+libexec_PROGRAMS = \
+ gnunet-service-namestore
+
bin_PROGRAMS = \
- gnunet-service-namestore \
gnunet-namestore
Modified: gnunet/src/nat/Makefile.am
===================================================================
--- gnunet/src/nat/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/nat/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -7,6 +7,8 @@
NATCLIENT = gnunet-helper-nat-client-windows.c
endif
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfgdir= $(pkgdatadir)/config.d/
dist_pkgcfg_DATA = \
@@ -17,13 +19,15 @@
NATSERVER = gnunet-helper-nat-server.c
NATCLIENT = gnunet-helper-nat-client.c
install-exec-hook:
- $(top_srcdir)/src/nat/install-nat-helper.sh $(bindir) $(SUDO_BINARY) ||
true
+ $(top_srcdir)/src/nat/install-nat-helper.sh $(libexecdir)
$(SUDO_BINARY) || true
else
install-exec-hook:
endif
bin_PROGRAMS = \
- gnunet-nat-server \
+ gnunet-nat-server
+
+libexec_PROGRAMS = \
$(NATBIN)
gnunet_nat_server_SOURCES = \
Modified: gnunet/src/nse/Makefile.am
===================================================================
--- gnunet/src/nse/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/nse/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -11,6 +11,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
nse.conf
@@ -27,7 +29,7 @@
-version-info 0:0:0
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-nse
noinst_PROGRAMS = \
Modified: gnunet/src/peerinfo/Makefile.am
===================================================================
--- gnunet/src/peerinfo/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/peerinfo/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
peerinfo.conf
@@ -29,7 +31,7 @@
-version-info 0:0:0
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-service-peerinfo
gnunet_service_peerinfo_SOURCES = \
Modified: gnunet/src/pt/Makefile.am
===================================================================
--- gnunet/src/pt/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/pt/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -10,13 +10,15 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
plugindir = $(libdir)/gnunet
dist_pkgcfg_DATA = \
pt.conf
-bin_PROGRAMS = \
- gnunet-daemon-pt $(PTBIN)
+libexec_PROGRAMS = \
+ gnunet-daemon-pt
gnunet_daemon_pt_SOURCES = \
gnunet-daemon-pt.c
Index: gnunet/src/regex
===================================================================
--- gnunet/src/regex 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/regex 2012-10-29 16:14:03 UTC (rev 24593)
Property changes on: gnunet/src/regex
___________________________________________________________________
Modified: svn:ignore
## -1,3 +1,4 ##
+gnunet-regex-simulation-profiler
test_regex_iptoregex
test_regex_graph_api
test_regex_proofs
Modified: gnunet/src/statistics/Makefile.am
===================================================================
--- gnunet/src/statistics/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/statistics/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -11,6 +11,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
statistics.conf
@@ -25,10 +27,11 @@
$(GN_LIB_LDFLAGS) $(WINFLAGS) \
-version-info 1:1:1
+libexec_PROGRAMS = \
+ gnunet-service-statistics
bin_PROGRAMS = \
- gnunet-statistics \
- gnunet-service-statistics
+ gnunet-statistics
gnunet_statistics_SOURCES = \
gnunet-statistics.c
Modified: gnunet/src/statistics/test_statistics_api.c
===================================================================
--- gnunet/src/statistics/test_statistics_api.c 2012-10-29 15:43:23 UTC (rev
24592)
+++ gnunet/src/statistics/test_statistics_api.c 2012-10-29 16:14:03 UTC (rev
24593)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2009 Christian Grothoff (and other contributing authors)
+ (C) 2009, 2012 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -20,18 +20,16 @@
/**
* @file statistics/test_statistics_api.c
* @brief testcase for statistics_api.c
+ * @author Christian Grothoff
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_os_lib.h"
-#include "gnunet_program_lib.h"
-#include "gnunet_scheduler_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
-#define START_SERVICE GNUNET_YES
+static struct GNUNET_STATISTICS_Handle *h;
+
static int
check_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
int is_persistent)
@@ -45,6 +43,7 @@
return GNUNET_OK;
}
+
static int
check_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
int is_persistent)
@@ -58,6 +57,7 @@
return GNUNET_OK;
}
+
static int
check_3 (void *cls, const char *subsystem, const char *name, uint64_t value,
int is_persistent)
@@ -71,7 +71,6 @@
return GNUNET_OK;
}
-static struct GNUNET_STATISTICS_Handle *h;
static void
next_fin (void *cls, int success)
@@ -83,6 +82,7 @@
*ok = 0;
}
+
static void
next (void *cls, int success)
{
@@ -94,6 +94,7 @@
&check_2, cls));
}
+
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -110,6 +111,7 @@
&check_1, cls));
}
+
static void
run_more (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -121,8 +123,9 @@
&check_3, cls));
}
-static int
-check ()
+
+int
+main (int argc, char *argv_ign[])
{
int ok = 1;
@@ -135,18 +138,21 @@
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
-#if START_SERVICE
struct GNUNET_OS_Process *proc;
+ char *binary;
+ GNUNET_log_setup ("test_statistics_api",
+ "WARNING",
+ NULL);
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-statistics",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL,
+ binary,
"gnunet-service-statistics",
"-c", "test_statistics_api_data.conf", NULL);
-#endif
GNUNET_assert (NULL != proc);
GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, &run,
&ok);
-#if START_SERVICE
if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -155,20 +161,20 @@
GNUNET_OS_process_wait (proc);
GNUNET_OS_process_destroy (proc);
proc = NULL;
-#endif
if (ok != 0)
+ {
+ GNUNET_free (binary);
return ok;
+ }
ok = 1;
-#if START_SERVICE
/* restart to check persistence! */
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-statistics",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL,
+ binary,
"gnunet-service-statistics",
"-c", "test_statistics_api_data.conf", NULL);
-#endif
GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options,
&run_more, &ok);
-#if START_SERVICE
if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -177,21 +183,8 @@
GNUNET_OS_process_wait (proc);
GNUNET_OS_process_destroy (proc);
proc = NULL;
-#endif
+ GNUNET_free (binary);
return ok;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- GNUNET_log_setup ("test_statistics_api",
- "WARNING",
- NULL);
- ret = check ();
-
- return ret;
-}
-
/* end of test_statistics_api.c */
Modified: gnunet/src/statistics/test_statistics_api_loop.c
===================================================================
--- gnunet/src/statistics/test_statistics_api_loop.c 2012-10-29 15:43:23 UTC
(rev 24592)
+++ gnunet/src/statistics/test_statistics_api_loop.c 2012-10-29 16:14:03 UTC
(rev 24593)
@@ -22,18 +22,13 @@
* @brief testcase for statistics_api.c
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_os_lib.h"
-#include "gnunet_program_lib.h"
-#include "gnunet_scheduler_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
-#define VERBOSE GNUNET_NO
+#define ROUNDS (1024 * 1024)
-#define START_SERVICE GNUNET_YES
+static struct GNUNET_STATISTICS_Handle *h;
-#define ROUNDS (1024 * 1024)
static int
check_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
@@ -45,7 +40,6 @@
return GNUNET_OK;
}
-static struct GNUNET_STATISTICS_Handle *h;
static void
next (void *cls, int success)
@@ -57,11 +51,12 @@
*ok = 0;
}
+
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- int i;
+ unsigned int i;
char name[128];
h = GNUNET_STATISTICS_create ("test-statistics-api-loop", cfg);
@@ -80,8 +75,8 @@
}
-static int
-check ()
+int
+main (int argc, char *argv_ign[])
{
int ok = 1;
@@ -93,21 +88,19 @@
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
-#if START_SERVICE
struct GNUNET_OS_Process *proc;
+ char *binary;
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-statistics",
- "gnunet-service-statistics",
-#if DEBUG_STATISTICS
- "-L", "DEBUG",
-#endif
- "-c", "test_statistics_api_data.conf", NULL);
-#endif
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL, NULL,
+ binary,
+ "gnunet-service-statistics",
+ "-c", "test_statistics_api_data.conf", NULL);
GNUNET_assert (NULL != proc);
GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run,
&ok);
-#if START_SERVICE
if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -116,18 +109,8 @@
GNUNET_OS_process_wait (proc);
GNUNET_OS_process_destroy (proc);
proc = NULL;
-#endif
+ GNUNET_free (binary);
return ok;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- ret = check ();
-
- return ret;
-}
-
/* end of test_statistics_api_loop.c */
Modified: gnunet/src/statistics/test_statistics_api_watch.c
===================================================================
--- gnunet/src/statistics/test_statistics_api_watch.c 2012-10-29 15:43:23 UTC
(rev 24592)
+++ gnunet/src/statistics/test_statistics_api_watch.c 2012-10-29 16:14:03 UTC
(rev 24593)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2009, 2011 Christian Grothoff (and other contributing authors)
+ (C) 2009, 2011, 2012 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -20,6 +20,7 @@
/**
* @file statistics/test_statistics_api_watch.c
* @brief testcase for statistics_api.c watch functions
+ * @author Christian Grothoff
*/
#include "platform.h"
#include "gnunet_common.h"
@@ -29,10 +30,7 @@
#include "gnunet_scheduler_lib.h"
#include "gnunet_statistics_service.h"
-#define VERBOSE GNUNET_NO
-#define START_SERVICE GNUNET_YES
-
static int ok;
static struct GNUNET_STATISTICS_Handle *h;
@@ -112,8 +110,8 @@
}
-static int
-check ()
+int
+main (int argc, char *argv_ign[])
{
char *const argv[] = { "test-statistics-api",
"-c",
@@ -123,22 +121,19 @@
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
-#if START_SERVICE
struct GNUNET_OS_Process *proc;
-
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-statistics",
- "gnunet-service-statistics",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- "-c", "test_statistics_api_data.conf", NULL);
-#endif
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL,
+ binary,
+ "gnunet-service-statistics",
+ "-c", "test_statistics_api_data.conf", NULL);
GNUNET_assert (NULL != proc);
ok = 3;
GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run,
NULL);
-#if START_SERVICE
if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -147,18 +142,9 @@
GNUNET_OS_process_wait (proc);
GNUNET_OS_process_destroy (proc);
proc = NULL;
-#endif
+ GNUNET_free (binary);
return ok;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
- ret = check ();
-
- return ret;
-}
-
/* end of test_statistics_api_watch.c */
Modified: gnunet/src/statistics/test_statistics_api_watch_zero_value.c
===================================================================
--- gnunet/src/statistics/test_statistics_api_watch_zero_value.c
2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/statistics/test_statistics_api_watch_zero_value.c
2012-10-29 16:14:03 UTC (rev 24593)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2009, 2011 Christian Grothoff (and other contributing authors)
+ (C) 2009, 2011, 2012 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -22,21 +22,15 @@
* @brief testcase for statistics_api.c watch functions with initial 0 value
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_os_lib.h"
-#include "gnunet_program_lib.h"
-#include "gnunet_scheduler_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
-#define VERBOSE GNUNET_NO
+static int ok;
-#define START_SERVICE GNUNET_YES
-
-static int ok;
static int ok2;
static struct GNUNET_STATISTICS_Handle *h;
+
static struct GNUNET_STATISTICS_Handle *h2;
static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
@@ -92,6 +86,7 @@
return GNUNET_OK;
}
+
static int
watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
int is_persistent)
@@ -121,6 +116,7 @@
return GNUNET_OK;
}
+
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -145,8 +141,8 @@
}
-static int
-check ()
+int
+main (int argc, char *argv_ign[])
{
char *const argv[] = { "test-statistics-api",
"-c",
@@ -156,23 +152,20 @@
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
-#if START_SERVICE
struct GNUNET_OS_Process *proc;
+ char *binary;
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, "gnunet-service-statistics",
- "gnunet-service-statistics",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- "-c", "test_statistics_api_data.conf", NULL);
-#endif
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL,
+ binary,
+ "gnunet-service-statistics",
+ "-c", "test_statistics_api_data.conf", NULL);
GNUNET_assert (NULL != proc);
ok = 3;
ok2 = 1;
GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run,
NULL);
-#if START_SERVICE
if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -181,21 +174,10 @@
GNUNET_OS_process_wait (proc);
GNUNET_OS_process_destroy (proc);
proc = NULL;
-#endif
+ GNUNET_free (binary);
if ((0 == ok) && (0 == ok2))
return 0;
- else
- return 1;
+ return 1;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- ret = check ();
-
- return ret;
-}
-
/* end of test_statistics_api_watch_zero_value.c */
Modified: gnunet/src/template/Makefile.am
===================================================================
--- gnunet/src/template/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/template/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
dist_pkgcfg_DATA = \
template.conf
@@ -14,7 +16,9 @@
endif
bin_PROGRAMS = \
- gnunet-template \
+ gnunet-template
+
+libexec_PROGRAMS = \
gnunet-service-template
gnunet_template_SOURCES = \
Modified: gnunet/src/testbed/Makefile.am
===================================================================
--- gnunet/src/testbed/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/testbed/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -9,13 +9,17 @@
XLIB = -lgcov
endif
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfgdir= $(pkgdatadir)/config.d/
pkgcfg_DATA = \
testbed.conf
+libexec_PROGRAMS = \
+ gnunet-service-testbed
+
bin_PROGRAMS = \
- gnunet-service-testbed \
gnunet-helper-testbed
noinst_PROGRAMS = \
Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/testing/testing.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -926,7 +926,7 @@
}
peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer));
peer->cfgfile = config_filename; /* Free in peer_destroy */
- peer->main_binary = GNUNET_strdup ("gnunet-service-arm");
+ peer->main_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
peer->system = system;
peer->key_number = key_number;
return peer;
@@ -1127,6 +1127,7 @@
struct GNUNET_TESTING_System *system;
struct GNUNET_TESTING_Peer *peer;
struct GNUNET_CONFIGURATION_Handle *cfg;
+ char *binary;
GNUNET_log_setup (testdir, "WARNING", NULL);
system = GNUNET_TESTING_system_create (testdir, "127.0.0.1", NULL);
@@ -1150,7 +1151,9 @@
return 1;
}
GNUNET_free (peer->main_binary);
- GNUNET_asprintf (&peer->main_binary, "gnunet-service-%s", service_name);
+ GNUNET_asprintf (&binary, "gnunet-service-%s", service_name);
+ peer->main_binary = GNUNET_OS_get_libexec_binary_path (binary);
+ GNUNET_free (binary);
if (GNUNET_OK != GNUNET_TESTING_peer_start (peer))
{
GNUNET_TESTING_peer_destroy (peer);
Modified: gnunet/src/topology/Makefile.am
===================================================================
--- gnunet/src/topology/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/topology/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -6,11 +6,13 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
dist_pkgcfg_DATA = \
topology.conf
-bin_PROGRAMS = \
+libexec_PROGRAMS = \
gnunet-daemon-topology
gnunet_daemon_topology_SOURCES = \
Modified: gnunet/src/transport/Makefile.am
===================================================================
--- gnunet/src/transport/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/transport/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -4,6 +4,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfg_DATA = \
transport.conf
@@ -59,7 +61,7 @@
if LINUX
install-exec-hook:
- $(top_srcdir)/src/transport/install-wlan-helper.sh $(bindir)
$(SUDO_BINARY) || true
+ $(top_srcdir)/src/transport/install-wlan-helper.sh $(libexecdir)
$(SUDO_BINARY) || true
else
install-exec-hook:
endif
@@ -107,11 +109,13 @@
$(GN_LIB_LDFLAGS) $(WINFLAGS) \
-version-info 1:0:0
+libexec_PROGRAMS = \
+ $(WLAN_BIN) \
+ $(WLAN_BIN_DUMMY) \
+ gnunet-service-transport
+
bin_PROGRAMS = \
gnunet-transport \
- $(WLAN_BIN) \
- $(WLAN_BIN_DUMMY) \
- gnunet-service-transport \
gnunet-transport-certificate-creation
#bin_SCRIPTS = \
Index: gnunet/src/util
===================================================================
--- gnunet/src/util 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/util 2012-10-29 16:14:03 UTC (rev 24593)
Property changes on: gnunet/src/util
___________________________________________________________________
Modified: svn:ignore
## -1,3 +1,5 ##
+test_crypto_ecc
+gnunet-ecc
gnunet-uri
gnunet-config
test_speedup
Modified: gnunet/src/util/Makefile.am
===================================================================
--- gnunet/src/util/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/util/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -2,6 +2,8 @@
plugindir = $(libdir)/gnunet
+libexecdir= $(pkglibdir)/libexec/
+
pkgcfgdir= $(pkgdatadir)/config.d/
dist_pkgcfg_DATA = \
@@ -120,8 +122,10 @@
-version-info 8:0:0
+libexec_PROGRAMS = \
+ gnunet-service-resolver
+
bin_PROGRAMS = \
- gnunet-service-resolver \
gnunet-resolver \
gnunet-config \
gnunet-ecc \
Modified: gnunet/src/util/helper.c
===================================================================
--- gnunet/src/util/helper.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/util/helper.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -131,7 +131,7 @@
/**
* Binary to run.
*/
- const char *binary_name;
+ char *binary_name;
/**
* NULL-terminated list of command-line arguments.
@@ -411,18 +411,17 @@
void *cb_cls)
{
struct GNUNET_HELPER_Handle*h;
- int c = 0;
- h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
+ unsigned int c;
+
+ h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
h->with_control_pipe = with_control_pipe;
- h->binary_name = GNUNET_strdup (binary_name);
-
- for (c = 0; binary_argv[c] != NULL; c++)
- c ++;
- h->binary_argv = GNUNET_malloc (sizeof (char *[c + 1]));
- for (c = 0; binary_argv[c] != NULL; c++)
+ h->binary_name = GNUNET_OS_get_libexec_binary_path (binary_name);
+ for (c = 0; NULL != binary_argv[c]; c++)
+ c++;
+ h->binary_argv = GNUNET_malloc (sizeof (char *) * (c + 1));
+ for (c = 0; NULL != binary_argv[c]; c++)
h->binary_argv[c] = GNUNET_strdup (binary_argv[c]);
h->binary_argv[c] = NULL;
-
h->cb_cls = cb_cls;
h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls);
h->exp_cb = exp_cb;
@@ -440,7 +439,8 @@
GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h)
{
struct GNUNET_HELPER_SendHandle *sh;
- int c;
+ unsigned int c;
+
h->exp_cb = NULL;
/* signal pending writes that we were stopped */
while (NULL != (sh = h->sh_head))
@@ -454,7 +454,7 @@
}
stop_helper (h);
GNUNET_SERVER_mst_destroy (h->mst);
- GNUNET_free ((char *) h->binary_name);
+ GNUNET_free (h->binary_name);
for (c = 0; h->binary_argv[c] != NULL; c++)
GNUNET_free (h->binary_argv[c]);
GNUNET_free (h->binary_argv);
Modified: gnunet/src/util/os_installation.c
===================================================================
--- gnunet/src/util/os_installation.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/util/os_installation.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -452,6 +452,11 @@
DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "doc" DIR_SEPARATOR_STR \
"gnunet" DIR_SEPARATOR_STR;
break;
+ case GNUNET_OS_IPK_LIBEXECDIR:
+ dirname =
+ DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR \
+ "libexec" DIR_SEPARATOR_STR;
+ break;
default:
GNUNET_free (execpath);
return NULL;
@@ -464,6 +469,32 @@
/**
+ * Given the name of a gnunet-helper, gnunet-service or gnunet-daemon
+ * binary, try to prefix it with the libexec/-directory to get the
+ * full path.
+ *
+ * @param progname name of the binary
+ * @return full path to the binary, if possible, otherwise copy of 'progname'
+ */
+char *
+GNUNET_OS_get_libexec_binary_path (const char *progname)
+{
+ char *libexecdir;
+ char *binary;
+
+ libexecdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
+ if (NULL == libexecdir)
+ return GNUNET_strdup (progname);
+ GNUNET_asprintf (&binary,
+ "%s%s",
+ libexecdir,
+ progname);
+ GNUNET_free (libexecdir);
+ return binary;
+}
+
+
+/**
* Check whether an executable exists and possibly
* if the suid bit is set on the file.
* Attempts to find the file using the current
Modified: gnunet/src/util/test_resolver_api.c
===================================================================
--- gnunet/src/util/test_resolver_api.c 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/util/test_resolver_api.c 2012-10-29 16:14:03 UTC (rev 24593)
@@ -22,11 +22,7 @@
* @brief testcase for resolver_api.c
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_os_lib.h"
-#include "gnunet_program_lib.h"
-#include "gnunet_scheduler_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_resolver_service.h"
#include "resolver.h"
@@ -356,7 +352,6 @@
{
int ok = 1 + 2 + 4 + 8;
char *fn;
- char *pfx;
struct GNUNET_OS_Process *proc;
char *const argvx[] = {
"test-resolver-api", "-c", "test_resolver_api_data.conf", NULL
@@ -367,10 +362,11 @@
GNUNET_log_setup ("test-resolver-api",
"WARNING",
NULL);
- pfx = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_BINDIR);
- GNUNET_asprintf (&fn, "%s%cgnunet-service-resolver", pfx, DIR_SEPARATOR);
- GNUNET_free (pfx);
- proc = GNUNET_OS_start_process (GNUNET_YES,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, fn, "gnunet-service-resolver",
+ fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
+ proc = GNUNET_OS_start_process (GNUNET_YES,
+ GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL, NULL, fn,
+ "gnunet-service-resolver",
"-c", "test_resolver_api_data.conf", NULL);
GNUNET_assert (NULL != proc);
GNUNET_free (fn);
Modified: gnunet/src/vpn/Makefile.am
===================================================================
--- gnunet/src/vpn/Makefile.am 2012-10-29 15:43:23 UTC (rev 24592)
+++ gnunet/src/vpn/Makefile.am 2012-10-29 16:14:03 UTC (rev 24593)
@@ -10,6 +10,8 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+libexecdir= $(pkglibdir)/libexec/
+
plugindir = $(libdir)/gnunet
pkgcfg_DATA = \
@@ -18,7 +20,7 @@
if LINUX
VPNBIN = gnunet-helper-vpn
install-exec-hook:
- $(top_srcdir)/src/vpn/install-vpn-helper.sh $(bindir) $(SUDO_BINARY) ||
true
+ $(top_srcdir)/src/vpn/install-vpn-helper.sh $(libexecdir)
$(SUDO_BINARY) || true
else
install-exec-hook:
endif
@@ -28,8 +30,12 @@
libgnunetvpn.la
+libexec_PROGRAMS = \
+ $(VPNBIN) \
+ gnunet-service-vpn
+
bin_PROGRAMS = \
- $(VPNBIN) gnunet-service-vpn gnunet-vpn
+ gnunet-vpn
gnunet_helper_vpn_SOURCES = \
gnunet-helper-vpn.c
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r24593 - in gnunet/src: arm ats ats-tool chat core datastore dht dns dv exit fs gns hostlist include lockmanager mesh namestore nat nse peerinfo pt regex statistics template testbed testing topology transport util vpn,
gnunet <=