Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/common/clib-package.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,13 +1555,6 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) {
}
#endif

#ifdef HAVE_PTHREADS
pthread_mutex_lock(&lock.mutex);
#endif
clib_cache_save_package(pkg->author, pkg->name, pkg->version, pkg_dir);
#ifdef HAVE_PTHREADS
pthread_mutex_unlock(&lock.mutex);
#endif

install:
if (pkg->configure) {
Expand All @@ -1582,6 +1575,16 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) {
rc = clib_package_install_dependencies(pkg, dir, verbose);
}

if (0 == rc) {
#ifdef HAVE_PTHREADS
pthread_mutex_lock(&lock.mutex);
#endif
clib_cache_save_package(pkg->author, pkg->name, pkg->version, pkg_dir);
#ifdef HAVE_PTHREADS
pthread_mutex_unlock(&lock.mutex);
#endif
}

cleanup:
if (pkg_dir)
free(pkg_dir);
Expand Down