From 460237e94dfead390a7b8372af5c0ebf8c1f226b Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 22 Jun 2020 16:11:14 -0400 Subject: Move SPM_GLOBAL.repo_target string usage out of mirror_clone * Assign targets from inside spm.c instead of external manifest/mirror functions --- src/spm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/spm.c b/src/spm.c index bb03094..2c2b447 100644 --- a/src/spm.c +++ b/src/spm.c @@ -94,12 +94,14 @@ int main(int argc, char *argv[], char *arge[]) { override_manifests = 1; } else if (strcmp(arg, "-m") == 0 || strcmp(arg, "--manifest") == 0) { + char *target; if (arg_next == NULL) { fprintf(stderr, "-m|--manifest requires a directory path\n"); usage(); exit(1); } - manifestlist_append(mf, arg_next); + target = join((char *[]) {arg_next, SPM_GLOBAL.repo_target, NULL}, DIRSEPS); + manifestlist_append(mf, target); i++; } else if (strcmp(arg, "--reindex") == 0) { @@ -215,8 +217,12 @@ int main(int argc, char *argv[], char *arge[]) { // Apply some default manifest locations; unless the user passes -M|--override-manifests if (override_manifests == 0) { + char *target; // Remote package manifests have priority over the local package store - manifestlist_append(mf, "https://astroconda.org/spm"); + target = join((char *[]) {"https://astroconda.org/spm", SPM_GLOBAL.repo_target, NULL}, DIRSEPS); + manifestlist_append(mf, target); + free(target); + // Add the local package store to the bottom manifestlist_append(mf, SPM_GLOBAL.package_dir); } -- cgit