Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (6 years ago)
Author:
bruno
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/archival/dpkg.c

    r2725 r3232  
    2929 */
    3030
     31//usage:#define dpkg_trivial_usage
     32//usage:       "[-ilCPru] [-F OPT] PACKAGE"
     33//usage:#define dpkg_full_usage "\n\n"
     34//usage:       "Install, remove and manage Debian packages\n"
     35//usage:    IF_LONG_OPTS(
     36//usage:     "\n    -i,--install    Install the package"
     37//usage:     "\n    -l,--list   List of installed packages"
     38//usage:     "\n    --configure Configure an unpackaged package"
     39//usage:     "\n    -P,--purge  Purge all files of a package"
     40//usage:     "\n    -r,--remove Remove all but the configuration files for a package"
     41//usage:     "\n    --unpack    Unpack a package, but don't configure it"
     42//usage:     "\n    --force-depends Ignore dependency problems"
     43//usage:     "\n    --force-confnew Overwrite existing config files when installing"
     44//usage:     "\n    --force-confold Keep old config files when installing"
     45//usage:    )
     46//usage:    IF_NOT_LONG_OPTS(
     47//usage:     "\n    -i      Install the package"
     48//usage:     "\n    -l      List of installed packages"
     49//usage:     "\n    -C      Configure an unpackaged package"
     50//usage:     "\n    -P      Purge all files of a package"
     51//usage:     "\n    -r      Remove all but the configuration files for a package"
     52//usage:     "\n    -u      Unpack a package, but don't configure it"
     53//usage:     "\n    -F depends  Ignore dependency problems"
     54//usage:     "\n    -F confnew  Overwrite existing config files when installing"
     55//usage:     "\n    -F confold  Keep old config files when installing"
     56//usage:    )
     57
    3158#include "libbb.h"
    3259#include <fnmatch.h>
    33 #include "archive.h"
     60#include "bb_archive.h"
    3461
    3562/* note: if you vary hash_prime sizes be aware,
     
    675702static void set_status(const unsigned status_node_num, const char *new_value, const int position)
    676703{
    677     const unsigned new_value_len = strlen(new_value);
    678704    const unsigned new_value_num = search_name_hashtable(new_value);
    679705    unsigned want = get_status(status_node_num, 1);
    680706    unsigned flag = get_status(status_node_num, 2);
    681707    unsigned status = get_status(status_node_num, 3);
    682     int want_len = strlen(name_hashtable[want]);
    683     int flag_len = strlen(name_hashtable[flag]);
    684     int status_len = strlen(name_hashtable[status]);
    685708    char *new_status;
    686709
     
    688711        case 1:
    689712            want = new_value_num;
    690             want_len = new_value_len;
    691713            break;
    692714        case 2:
    693715            flag = new_value_num;
    694             flag_len = new_value_len;
    695716            break;
    696717        case 3:
    697718            status = new_value_num;
    698             status_len = new_value_len;
    699719            break;
    700720        default:
     
    10071027                const unsigned package_num =
    10081028                    search_package_hashtable(package_edge->name,
    1009                                  package_edge->version,
    1010                                  package_edge->operator);
     1029                                package_edge->version,
     1030                                package_edge->operator);
    10111031                int result = 0;
    10121032                if (package_hashtable[package_num] != NULL) {
     
    10951115                if (root_of_alternatives && package_edge->type != root_of_alternatives->type - 1)
    10961116                    bb_error_msg_and_die("fatal error, package dependencies corrupt: %d != %d - 1",
    1097                                  package_edge->type, root_of_alternatives->type);
     1117                            package_edge->type, root_of_alternatives->type);
    10981118
    10991119                if (package_hashtable[package_num] != NULL)
     
    16461666    init_archive_deb_data(archive_handle);
    16471667    archive_handle->dpkg__sub_archive->accept = conffile_list;
     1668    /* Why ARCHIVE_REMEMBER_NAMES?
     1669     * We want names collected in ->passed list even if conffile_list
     1670     * is NULL (otherwise get_header_tar may optimize name saving out):
     1671     */
     1672    archive_handle->dpkg__sub_archive->ah_flags |= ARCHIVE_REMEMBER_NAMES | ARCHIVE_UNLINK_OLD;
    16481673    archive_handle->dpkg__sub_archive->filter = filter_rename_config;
    16491674    archive_handle->dpkg__sub_archive->action_data = data_extract_all_prefix;
    16501675    archive_handle->dpkg__sub_archive->dpkg__buffer = (char*)"/"; /* huh? */
    1651     archive_handle->dpkg__sub_archive->ah_flags |= ARCHIVE_UNLINK_OLD;
    16521676    unpack_ar_archive(archive_handle);
    16531677
     
    16551679    list_filename = xasprintf("/var/lib/dpkg/info/%s.%s", package_name, "list");
    16561680    out_stream = xfopen_for_write(list_filename);
     1681    archive_handle->dpkg__sub_archive->passed = llist_rev(archive_handle->dpkg__sub_archive->passed);
    16571682    while (archive_handle->dpkg__sub_archive->passed) {
     1683        char *filename = llist_pop(&archive_handle->dpkg__sub_archive->passed);
    16581684        /* the leading . has been stripped by data_extract_all_prefix already */
    1659         fputs(archive_handle->dpkg__sub_archive->passed->data, out_stream);
    1660         fputc('\n', out_stream);
    1661         archive_handle->dpkg__sub_archive->passed = archive_handle->dpkg__sub_archive->passed->link;
     1685        fprintf(out_stream, "%s\n", filename);
     1686        free(filename);
    16621687    }
    16631688    fclose(out_stream);
Note: See TracChangeset for help on using the changeset viewer.