diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-06-22 16:11:14 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-06-22 16:11:14 -0400 |
commit | 460237e94dfead390a7b8372af5c0ebf8c1f226b (patch) | |
tree | 997d6ffacc648267ba01a85459df83897ed0debc /lib/manifest.c | |
parent | 62db2a4054a55883e7476750c925cb9d5a72fbc5 (diff) | |
download | spmc-460237e94dfead390a7b8372af5c0ebf8c1f226b.tar.gz |
Move SPM_GLOBAL.repo_target string usage out of mirror_clone
* Assign targets from inside spm.c instead of external manifest/mirror functions
Diffstat (limited to 'lib/manifest.c')
-rw-r--r-- | lib/manifest.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/manifest.c b/lib/manifest.c index f84867d..cd51b97 100644 --- a/lib/manifest.c +++ b/lib/manifest.c @@ -388,25 +388,17 @@ Manifest *manifest_read(char *file_or_url) { strcpy(path, SPM_GLOBAL.package_dir); } else { - tmpdir = spm_mkdtemp(TMP_DIR, "spm_manifest_read_XXXXXX", SPM_GLOBAL.repo_target); + tmpdir = spm_mkdtemp(TMP_DIR, "spm_manifest_read_XXXXXX", NULL); if (exists(tmpdir) != 0) { fprintf(stderr, "Failed to create temporary storage directory\n"); fprintf(SYSERROR); return NULL; } - snprintf(pathptr, PATH_MAX - 1, "%s%s%s%s%s", tmpdir, DIRSEPS, SPM_GLOBAL.repo_target, DIRSEPS, filename); + pathptr = join((char *[]) {tmpdir, filename, NULL}, DIRSEPS); } - const char *target_is; - if (strstr(file_or_url, SPM_GLOBAL.repo_target) != NULL) { - target_is = ""; - } - else { - target_is = SPM_GLOBAL.repo_target; - } - - char *remote_manifest = join_ex(DIRSEPS, file_or_url, target_is, filename, NULL); + char *remote_manifest = join_ex(DIRSEPS, file_or_url, filename, NULL); if (exists(pathptr) != 0) { // TODO: Move this out |