[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3274 - in GNUnet: contrib src/applications/fs src/setup sr
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3274 - in GNUnet: contrib src/applications/fs src/setup src/setup/lib src/setup/text src/util/os src/util/string |
Date: |
Sun, 20 Aug 2006 14:42:42 -0700 (PDT) |
Author: grothoff
Date: 2006-08-20 14:42:36 -0700 (Sun, 20 Aug 2006)
New Revision: 3274
Modified:
GNUnet/contrib/Makefile.am
GNUnet/src/applications/fs/Makefile.am
GNUnet/src/setup/Makefile.am
GNUnet/src/setup/gnunet-setup.c
GNUnet/src/setup/lib/tree.c
GNUnet/src/setup/text/conf.h
GNUnet/src/util/os/installpath.c
GNUnet/src/util/string/string.c
Log:
bugfixes
Modified: GNUnet/contrib/Makefile.am
===================================================================
--- GNUnet/contrib/Makefile.am 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/contrib/Makefile.am 2006-08-20 21:42:36 UTC (rev 3274)
@@ -1,6 +1,7 @@
bin_SCRIPTS = gnunet-download-manager.scm
pkgdata_DATA = \
+ config-daemon.scm \
config-client.in \
config-daemon.in
Modified: GNUnet/src/applications/fs/Makefile.am
===================================================================
--- GNUnet/src/applications/fs/Makefile.am 2006-08-20 21:15:18 UTC (rev
3273)
+++ GNUnet/src/applications/fs/Makefile.am 2006-08-20 21:42:36 UTC (rev
3274)
@@ -1,5 +1,5 @@
SUBDIRS = \
- . module lib ecrs uritrack fsui namespace collection tools
+ . module lib ecrs uritrack namespace fsui collection tools
INCLUDES = -I$(top_srcdir)/src/include
Modified: GNUnet/src/setup/Makefile.am
===================================================================
--- GNUnet/src/setup/Makefile.am 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/src/setup/Makefile.am 2006-08-20 21:42:36 UTC (rev 3274)
@@ -7,7 +7,8 @@
curses_dir = ncurses
endif
-SUBDIRS = lib text $(curses_dir) $(gtk_dir) .
+SUBDIRS = lib
+# text $(curses_dir) $(gtk_dir) .
plugindir = $(libdir)/GNUnet
Modified: GNUnet/src/setup/gnunet-setup.c
===================================================================
--- GNUnet/src/setup/gnunet-setup.c 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/src/setup/gnunet-setup.c 2006-08-20 21:42:36 UTC (rev 3274)
@@ -38,6 +38,7 @@
struct GE_Context * ectx,
struct GC_Configuration * cfg,
struct GNS_Context * gns,
+ const char * filename,
int is_daemon);
static int config_daemon;
@@ -86,6 +87,7 @@
ectx,
cfg,
gns,
+ filename,
config_daemon);
os_plugin_unload(library);
return YES;
@@ -125,6 +127,7 @@
char * specname;
int i;
+ printf("Creating ectx\n");
ectx = GE_create_context_stderr(NO,
GE_WARNING | GE_ERROR | GE_FATAL |
GE_USER | GE_ADMIN | GE_DEVELOPER |
@@ -132,6 +135,7 @@
GE_setDefaultContext(ectx);
cfg = GC_create_C_impl();
GE_ASSERT(ectx, cfg != NULL);
+ printf("Parsing options\n");
i = gnunet_parse_options(INFO,
ectx,
cfg,
@@ -201,7 +205,7 @@
dirname = os_get_installation_path(ectx,
cfg,
GNDATADIR);
- specname = MALLOC(strlen(dirname) + strlen("/config-daemon.in") + 1);
+ specname = MALLOC(strlen(dirname) + strlen("/config-daemon.scm") + 1);
strcpy(specname, dirname);
FREE(dirname);
if (config_daemon)
Modified: GNUnet/src/setup/lib/tree.c
===================================================================
--- GNUnet/src/setup/lib/tree.c 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/src/setup/lib/tree.c 2006-08-20 21:42:36 UTC (rev 3274)
@@ -287,6 +287,8 @@
SCM proc;
SCM smob;
struct GNS_Tree * tree;
+
+ scm_c_primitive_load(specification);
proc = scm_variable_ref(scm_c_lookup("setup"));
smob = scm_apply_0(proc, SCM_EOL);
tree = (struct GNS_Tree*) SCM_SMOB_DATA(smob);
Modified: GNUnet/src/setup/text/conf.h
===================================================================
--- GNUnet/src/setup/text/conf.h 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/src/setup/text/conf.h 2006-08-20 21:42:36 UTC (rev 3274)
@@ -20,7 +20,7 @@
/**
- * @file conf/conf.h
+ * @file setup/text/conf.h
* @brief GNUnet text mode Setup
* @author Nils Durner
*/
@@ -29,12 +29,14 @@
#define CONF_H
#include "gnunet_util.h"
+#include "gnunet_setup_lib.h"
int conf_main(int argc,
const char ** argv,
struct PluginHandle * self,
struct GE_Context * ectx,
struct GC_Configuration * cfg,
+ struct GNS_Context * gns,
const char * filename,
int is_daemon);
Modified: GNUnet/src/util/os/installpath.c
===================================================================
--- GNUnet/src/util/os/installpath.c 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/src/util/os/installpath.c 2006-08-20 21:42:36 UTC (rev 3274)
@@ -99,10 +99,14 @@
/* II. reading /proc failed, trying with argv[0] */
found = 0;
- GC_get_configuration_value_string(cfg, "ARGV", "0", "gnunetd", &path1);
+ GC_get_configuration_value_string(cfg,
+ "ARGV",
+ "0",
+ "gnunetd",
+ &path1);
/* 1. absolute path */
- if(*path1 == '/') {
+ if (*path1 == '/') {
execpath = path1;
found = 1; }
@@ -188,8 +192,10 @@
static char *prefix = NULL; /*save it between calls */
unsigned int n;
- char *dirname, *final_dir, *appname;
- char *execpath, *tmp, *ptr;
+ const char * dirname;
+ char *execpath;
+ char *tmp;
+ char *ptr;
if(!prefix) { /* if we already got the prefix once, don't work more */
if( !(execpath = os_get_exec_path(ectx, cfg)) )
@@ -227,41 +233,33 @@
FREE(tmp); }
- /* what do we have to return ? */
- GC_get_configuration_value_string(cfg, "ARGV", "0", "gnunetd", &appname);
-
switch(dirkind) {
case PREFIX:
- dirname = STRDUP("\0");
+ dirname = "";
break;
case BINDIR:
- dirname = STRDUP("bin/\0");
+ dirname = "bin/";
break;
case LIBDIR:
- dirname = STRDUP("lib/\0");
+ dirname = "lib/GNUnet/";
break;
+ case PACKAGEDATADIR:
case GNDATADIR:
- dirname = STRDUP("share/\0");
+ dirname = "share/GNUnet/";
break;
- case PACKAGEDATADIR:
- tmp = MALLOC(9+strlen(prefix)+strlen(appname));
- sprintf(tmp, "share/%s/%s/", prefix, appname);
- dirname = STRDUP(tmp);
- FREE(tmp);
- break;
case LOCALEDIR:
- dirname = STRDUP("share/locale/\0");
+ dirname = "share/locale/";
break;
default:
return NULL; }
tmp = MALLOC(strlen(prefix)+strlen(dirname)+1);
-
- final_dir = STRDUP(tmp);
-
- FREE(tmp);
- FREENONNULL(dirname);
- return final_dir;
+ sprintf(tmp,
+ "%s%s",
+ prefix,
+ dirname);
+ FREE(prefix);
+ return tmp;
}
#if 0 /* keep Emacsens' auto-indent happy */
Modified: GNUnet/src/util/string/string.c
===================================================================
--- GNUnet/src/util/string/string.c 2006-08-20 21:15:18 UTC (rev 3273)
+++ GNUnet/src/util/string/string.c 2006-08-20 21:42:36 UTC (rev 3274)
@@ -260,13 +260,13 @@
char * string_expandFileName(struct GE_Context * ectx,
const char * fil) {
char * buffer;
- char * fn;
#ifndef MINGW
size_t len;
size_t n;
char * fm;
const char * fil_ptr;
#else
+ char * fn;
long lRet;
#endif
@@ -276,7 +276,7 @@
#ifndef MINGW
if (fil[0] == DIR_SEPARATOR)
/* absolute path, just copy */
- return(STRDUP(fil));
+ return STRDUP(fil);
if (fil[0] == '~') {
fm = getenv("HOME");
if (fm == NULL) {
@@ -316,9 +316,10 @@
}
n = strlen(fm) + 1 + strlen(fil_ptr) + 1;
buffer = MALLOC(n);
- SNPRINTF(fn, n,
+ SNPRINTF(buffer, n,
"%s/%s", fm, fil_ptr);
FREE(fm);
+ return buffer;
#else
fn = MALLOC(MAX_PATH + 1);
@@ -347,8 +348,8 @@
} else {
strcpy(fn, buffer);
}
+ return fn;
#endif
- return fn;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3274 - in GNUnet: contrib src/applications/fs src/setup src/setup/lib src/setup/text src/util/os src/util/string,
grothoff <=