@@ -42,6 +42,24 @@ parse_deps(struct parsedata *pd, struct solv_jsonparser *jp, Offset *depp)
4242 return type ;
4343}
4444
45+ static int
46+ parse_otherdeps (struct parsedata * pd , struct solv_jsonparser * jp , Id handle , Id keyname )
47+ {
48+ int type = JP_ARRAY ;
49+ while (type > 0 && (type = jsonparser_parse (jp )) > 0 && type != JP_ARRAY_END )
50+ {
51+ if (type == JP_STRING )
52+ {
53+ Id id = pool_conda_matchspec (pd -> pool , jp -> value );
54+ if (id )
55+ repodata_add_idarray (pd -> data , handle , keyname , id );
56+ }
57+ else
58+ type = jsonparser_skip (jp , type );
59+ }
60+ return type ;
61+ }
62+
4563static int
4664parse_package (struct parsedata * pd , struct solv_jsonparser * jp , char * kfn )
4765{
@@ -64,6 +82,8 @@ parse_package(struct parsedata *pd, struct solv_jsonparser *jp, char *kfn)
6482 type = parse_deps (pd , jp , & s -> requires );
6583 else if (type == JP_ARRAY && !strcmp (jp -> key , "requires" ))
6684 type = parse_deps (pd , jp , & s -> requires );
85+ else if (type == JP_ARRAY && !strcmp (jp -> key , "constrains" ))
86+ type = parse_otherdeps (pd , jp , handle , SOLVABLE_CONSTRAINS );
6787 else if (type == JP_STRING && !strcmp (jp -> key , "license" ))
6888 repodata_add_poolstr_array (data , handle , SOLVABLE_LICENSE , jp -> value );
6989 else if (type == JP_STRING && !strcmp (jp -> key , "md5" ))
0 commit comments