diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/install.c | 13 | ||||
-rw-r--r-- | src/resolve.c | 2 | ||||
-rw-r--r-- | src/rpath.c | 13 |
3 files changed, 24 insertions, 4 deletions
diff --git a/src/install.c b/src/install.c index a6b76ca..0858c5c 100644 --- a/src/install.c +++ b/src/install.c @@ -231,8 +231,19 @@ int spm_do_install(SPM_Hierarchy *fs, ManifestList *mf, StrList *packages) { int fetched = 0; char *package_dir = strdup(SPM_GLOBAL.package_dir); for (size_t i = 0; requirements != NULL && requirements[i] != NULL; i++) { - char *package_path = join((char *[]) {requirements[i]->origin, requirements[i]->archive, NULL}, DIRSEPS); + char *package_origin = calloc(PATH_MAX, sizeof(char)); + strncpy(package_origin, requirements[i]->origin, PATH_MAX); + + if (strstr(package_origin, SPM_GLOBAL.repo_target) == NULL) { + if (!endswith(package_origin, DIRSEPS)) { + strcat(package_origin, DIRSEPS); + } + strcat(package_origin, SPM_GLOBAL.repo_target); + } + + char *package_path = join((char *[]) {package_origin, requirements[i]->archive, NULL}, DIRSEPS); char *package_localpath = join_ex(DIRSEPS, package_dir, requirements[i]->archive, NULL); + free(package_origin); // Download the archive if necessary if (strstr(package_path, "://") != NULL && exists(package_localpath) != 0) { diff --git a/src/resolve.c b/src/resolve.c index ef1f15b..0f6dfc0 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -30,7 +30,7 @@ ManifestPackage **resolve_dependencies(ManifestList *manifests, const char *spec ManifestPackage *package = manifestlist_search(manifests, spec); ManifestPackage *requirement = NULL; if (package == NULL) { - return NULL; + return requirements; } for (size_t i = 0; i < package->requirements_records && i < SPM_REQUIREMENT_MAX; i++) { diff --git a/src/rpath.c b/src/rpath.c index 42a4c07..fbfdb18 100644 --- a/src/rpath.c +++ b/src/rpath.c @@ -209,6 +209,7 @@ char *rpath_autodetect(const char *filename) { char *start = realpath(rootdir, NULL); char *cwd = realpath(".", NULL); char *result = NULL; + int multilib_os = (exists("/lib64") == 0); // Change directory to the requested root chdir(start); @@ -228,7 +229,11 @@ char *rpath_autodetect(const char *filename) { } // Using the current visit path, check if it contains a lib directory - char *path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); + char *path = NULL; + if (multilib_os) + path = join((char *[]) {visit, "lib64", NULL}, DIRSEPS); + else + path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); if (access(path, F_OK) == 0) { // Check whether the lib directory contains one of `filename`'s libraries @@ -248,7 +253,11 @@ char *rpath_autodetect(const char *filename) { // Stop processing when a good lib directory is found if (has_real_libdir != 0) { - strcat(relative, "lib"); + if (multilib_os) { + strcat(relative, "lib64"); + } else { + strcat(relative, "lib"); + } free(path); free(visit); break; |