]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
repo_conda: overwrite the package subdir with the info subdir if there is a conflict
authorMichael Schroeder <mls@suse.de>
Fri, 21 Jul 2023 11:53:46 +0000 (13:53 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 21 Jul 2023 11:53:46 +0000 (13:53 +0200)
This is what classic conda does, so we also need to do it.
Fixes issue #529

ext/repo_conda.c

index 9211cbeac8e7348471b280c10a65c428a7073925..356d3b1159c1e93e8c62f9eed969efb1bffb8f8f 100644 (file)
@@ -314,8 +314,16 @@ parse_package(struct parsedata *pd, struct solv_jsonparser *jp, char *kfn, char
   /* if we have a global subdir make sure that it matches */
   if (subdir && pd->subdir && strcmp(subdir, pd->subdir) != 0)
     {
+      /* we used to return an error here, but classic conda
+       * just overwrites the package subdir with the global
+       * subdir */
+#if 0
       pd->error = "subdir mismatch";
       return JP_ERROR;
+#else
+      solv_free(subdir);
+      subdir = solv_strdup(pd->subdir);
+#endif
     }
 
   if (fn || kfn)