diff --git a/deps/url/url.c b/deps/url/url.c index 5a738bce..c6262464 100644 --- a/deps/url/url.c +++ b/deps/url/url.c @@ -175,7 +175,7 @@ url_parse (const char *url) { int pathname_len = (int)strlen(pathname); data->pathname = pathname; - char *search = (char *) malloc(sizeof(search)); + char *search = (char *) malloc(strlen(tmp_path)+1); if (!search) { free(tmp_url); url_free(data); @@ -190,7 +190,7 @@ url_parse (const char *url) { int search_len = (int)strlen(search); free(tmp_path); - char *query = (char *) malloc(sizeof(char)); + char *query = (char *) malloc(search_len+1); if (!query) { free(tmp_url); url_free(data); @@ -199,7 +199,7 @@ url_parse (const char *url) { sscanf(search, "?%s", query); data->query = query; - char *hash = (char *) malloc(sizeof(char)); + char *hash = (char *) malloc(strlen(path)+1); if (!hash) { free(tmp_url); url_free(data); diff --git a/src/clib-build.c b/src/clib-build.c index 4977eb4b..752f2d41 100755 --- a/src/clib-build.c +++ b/src/clib-build.c @@ -193,7 +193,7 @@ int build_package_with_manifest_name(const char *dir, const char *file) { #endif } else { #ifdef DEBUG - package = clib_package_new_from_slug(dir, 1); + package = clib_package_new_from_slug_and_url(dir, "FIXME", 1); #else package = clib_package_new_from_slug_and_url(dir, "FIXME", 0); #endif diff --git a/src/clib-configure.c b/src/clib-configure.c index 4e2ea077..5ac8058d 100755 --- a/src/clib-configure.c +++ b/src/clib-configure.c @@ -186,7 +186,7 @@ int configure_package_with_manifest_name(const char *dir, const char *file) { #endif } else { #ifdef DEBUG - package = clib_package_new_from_slug(dir, 1); + package = clib_package_new_from_slug_and_url(dir, "FIXME", 1); #else package = clib_package_new_from_slug_and_url(dir, "FIXME", 0); #endif diff --git a/src/clib-settings.h b/src/clib-settings.h deleted file mode 100644 index bdd17902..00000000 --- a/src/clib-settings.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CLIB_SRC_CLIB_SETTINGS_H -#define CLIB_SRC_CLIB_SETTINGS_H - -// Shared settings -#define CLIB_PACKAGE_CACHE_TIME 30 * 24 * 60 * 60 - -#ifdef HAVE_PTHREADS -#define MAX_THREADS 12 -#endif - -const char *manifest_names[] = {"clib.json", "package.json", 0}; - -#endif//CLIB_SRC_CLIB_SETTINGS_H diff --git a/src/common/clib-package-installer.c b/src/common/clib-package-installer.c index a6978ce3..70bf7c45 100644 --- a/src/common/clib-package-installer.c +++ b/src/common/clib-package-installer.c @@ -195,6 +195,7 @@ int clib_package_install_executable(clib_package_t *pkg, const char *dir, int ve E_FORMAT(&file, "%s-%s.tar.gz", reponame, pkg->version); E_FORMAT(&tarball, "%s/%s", tmp, file); + // TODO, move to repository rc = http_get_file(url, tarball, NULL, 0); if (0 != rc) { @@ -517,6 +518,7 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) { repository_file_free(handles[j]); } #endif + free(handles); #ifdef HAVE_PTHREADS pthread_mutex_lock(&lock.mutex); @@ -539,10 +541,9 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) { goto cleanup; } - // TODO, check if we want to enable this. - //if (pkg->install) { - // rc = clib_package_install_executable(pkg, dir, verbose); - //} + if (pkg->install) { + rc = clib_package_install_executable(pkg, dir, verbose); + } if (0 == rc) { rc = clib_package_install_dependencies(pkg, dir, verbose);