upgrade to uci 0.5.0, adds list handling support
[openwrt.git] / package / busybox / patches / 526-ipkg_fix_pkg_comparison.patch
1 --- a/archival/libipkg/pkg.c
2 +++ b/archival/libipkg/pkg.c
3 @@ -1139,8 +1139,12 @@
4 return 0;
5 }
6
7 -int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b)
8 +int pkg_name_version_and_architecture_compare(const void *pkg_a, const void *pkg_b)
9 {
10 + pkg_t * const *p1 = pkg_a;
11 + pkg_t * const *p2 = pkg_b;
12 + const pkg_t *a = *p1;
13 + const pkg_t *b = *p2;
14 int namecmp;
15 int vercmp;
16 if (!a->name || !b->name) {
17 @@ -1167,8 +1171,12 @@
18 return 0;
19 }
20
21 -int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b)
22 +int abstract_pkg_name_compare(const void *apkg_a, const void *apkg_b)
23 {
24 + abstract_pkg_t * const *ap1 = apkg_a;
25 + abstract_pkg_t * const *ap2 = apkg_b;
26 + const abstract_pkg_t *a = *ap1;
27 + const abstract_pkg_t *b = *ap2;
28 if (!a->name || !b->name) {
29 fprintf(stderr, "abstract_pkg_name_compare: a=%p a->name=%p b=%p b->name=%p\n",
30 a, a->name, b, b->name);
31 --- a/archival/libipkg/pkg.h
32 +++ b/archival/libipkg/pkg.h
33 @@ -191,8 +191,8 @@
34 char *pkg_version_str_alloc(pkg_t *pkg);
35
36 int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
37 -int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b);
38 -int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b);
39 +int pkg_name_version_and_architecture_compare(const void *pkg_a, const void *pkg_b);
40 +int abstract_pkg_name_compare(const void *apkg_a, const void *apkg_b);
41
42 char * pkg_formatted_info(pkg_t *pkg );
43 char * pkg_formatted_field(pkg_t *pkg, const char *field );
This page took 0.050005 seconds and 5 git commands to generate.