pkg: alternatives support
authorYousong Zhou <yszhou4tech@gmail.com>
Sat, 18 Mar 2017 08:45:53 +0000 (16:45 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Tue, 2 May 2017 14:28:33 +0000 (22:28 +0800)
commit546bc72356c7a6b435540852b10625b7531f2117
treef55e2e68a1c8d6a0ea87285e8f02d985f260e6de
parent7a9697267d937b18f89763c28f11a2e1b4018542
pkg: alternatives support

It's a list of specs of the following form seprated by commas to describe
alternatives provided by the package

    <prio>:<path>:<altpath>

where <path> will be a symbolic link to <altpath> of the highest <prio>

Size comparison on x86_64 after the change

    function                                             old     new   delta
    pkg_alternatives_update                                -     587    +587
    pkg_parse_line                                      2101    2609    +522
    .rodata                                            24594   24738    +144
    pkg_formatted_field                                 2385    2528    +143
    pkg_deinit                                           427     486     +59
    pkg_print_status                                     264     280     +16
    opkg_configure                                        59      69     +10
    xreadlink                                            120     128      +8
    opkg_remove_pkg                                     1079    1087      +8
    ------------------------------------------------------------------------------
    (add/remove: 2/0 grow/shrink: 8/0 up/down: 1483/0)           Total: 1497 bytes

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
libopkg/CMakeLists.txt
libopkg/opkg_configure.c
libopkg/opkg_remove.c
libopkg/pkg.c
libopkg/pkg.h
libopkg/pkg_alternatives.c [new file with mode: 0644]
libopkg/pkg_alternatives.h [new file with mode: 0644]
libopkg/pkg_parse.c
libopkg/pkg_parse.h