Ticket #940: nALFS-1.2.4-disable-digest-checking.patch

File nALFS-1.2.4-disable-digest-checking.patch, 3.9 KB (added by jamie@…, 20 years ago)

patch to disable digest checking

  • src/handlers/unpack.c

    diff -Nru nALFS-1.2.4-original/src/handlers/unpack.c nALFS-1.2.4/src/handlers/unpack.c
    old new  
    4040#include "nprint.h"
    4141#include "parser.h"
    4242#include "backend.h"
     43#include "options.h"
    4344
    4445
    4546#define El_unpack_archive(el) alloc_trimmed_param_value("archive", el)
     
    191192        if (change_current_dir(destination))
    192193                goto free_all_and_return;
    193194
    194         alloc_element_digest(el, &digest, &digest_type);
     195        if (!*opt_disable_digest)
     196                alloc_element_digest(el, &digest, &digest_type);
    195197
    196198        /* Check if archive exists. */
    197199        if ((stat(archive, &file_stat))) {
  • src/init.c

    diff -Nru nALFS-1.2.4-original/src/init.c nALFS-1.2.4/src/init.c
    old new  
    304304        LONG_OPTION_VERSION,
    305305        LONG_OPTION_HELP,
    306306        LONG_OPTION_GENERATE_STAMP,
     307        LONG_OPTION_DISABLE_DIGEST,
    307308        LONG_OPTION_RCFILE,
    308309};
    309310
     
    358359"    -p, --prune <dirs>            Ignore <dirs> (separated with spaces) when\n"
    359360"                                  logging files.\n"
    360361"    -S, --generate-stamp          Toggle stamp mode.\n"
     362"    -d, --disable-digest          Disable digest checking\n"
    361363"    --rcfile <file>               Use <file> as configuration file.\n"
    362364"    -v, --verbose                 Toggle verbosity (%s).\n"
    363365"    --version                     Display program's version.\n"
     
    417419        {"help", no_argument, NULL, LONG_OPTION_HELP},
    418420
    419421        {"generate-stamp", no_argument, NULL, LONG_OPTION_GENERATE_STAMP},
     422       
     423        {"disable-digest", no_argument, NULL, LONG_OPTION_DISABLE_DIGEST},     
    420424
    421425        {"rcfile", required_argument, NULL, LONG_OPTION_RCFILE},
    422426
     
    425429        };
    426430
    427431
    428         while ((i = getopt_long(*argc, *argv, "lPfhisBSL:b:p:v", long_opts, NULL)) != -1) {
     432        while ((i = getopt_long(*argc, *argv, "lPfhisBSdL:b:p:v", long_opts, NULL)) != -1) {
    429433                switch (i) {
    430434                        case LONG_OPTION_DISPLAY_ALFS:
    431435                                Toggle(*opt_display_alfs);
     
    491495                                Toggle(*opt_stamp_packages);
    492496                                break;
    493497
     498                        case 'd':
     499                        case LONG_OPTION_DISABLE_DIGEST:
     500                                Toggle(*opt_disable_digest);
     501                                break;
     502
    494503                        case LONG_OPTION_RCFILE:
    495504                                parse_rc_file(optarg);
    496505                                break;
  • src/nalfs.c

    diff -Nru nALFS-1.2.4-original/src/nalfs.c nALFS-1.2.4/src/nalfs.c
    old new  
    18881888}
    18891889#endif
    18901890
     1891static INLINE void toggle_disable_digest(void)
     1892{
     1893        if (*opt_disable_digest) {
     1894                Nprint("Digest checking now enabled.");
     1895                *opt_disable_digest = 0;
     1896        } else {
     1897                Nprint("Digest checking now disabled.");
     1898                *opt_disable_digest = 1;
     1899        }
     1900}
     1901
    18911902static INLINE void toggle_system_output(void)
    18921903{
    18931904        if (Backend_exists) {
  • src/option-array.h

    diff -Nru nALFS-1.2.4-original/src/option-array.h nALFS-1.2.4/src/option-array.h
    old new  
    5757&real_opt_log_handlers,
    5858&real_opt_log_backend,
    5959&real_opt_stamp_packages,
     60&real_opt_disable_digest,
    6061&real_opt_display_stage_header,
    6162&real_opt_warn_if_set,
    6263&real_opt_follow_running,
  • src/options.h

    diff -Nru nALFS-1.2.4-original/src/options.h nALFS-1.2.4/src/options.h
    old new  
    5858BOOL_OPTION(log_backend, 1, NULL, NULL);
    5959BOOL_OPTION(stamp_packages, 0, NULL, NULL);
    6060STRING_OPTION(stamp_directory, "stamps", NULL, NULL);
     61BOOL_OPTION(disable_digest, 0, NULL, NULL);
    6162BOOL_OPTION(display_stage_header, 0, NULL, NULL);
    6263STRING_OPTION(find_base, "/", NULL, NULL);
    6364STRING_OPTION(find_prunes, "", NULL, NULL);