aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-06-22 16:11:14 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-06-22 16:11:14 -0400
commit460237e94dfead390a7b8372af5c0ebf8c1f226b (patch)
tree997d6ffacc648267ba01a85459df83897ed0debc /src
parent62db2a4054a55883e7476750c925cb9d5a72fbc5 (diff)
downloadspmc-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 'src')
-rw-r--r--src/spm.c10
1 files changed, 8 insertions, 2 deletions
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);
}