• nodelist_handler.js cannot handle non-archived nodelists

    From Fernando Toledo@1:103/705 to GitLab note in main/sbbs on Sat Feb 17 20:14:34 2024
    https://gitlab.synchro.net/main/sbbs/-/issues/669#note_4864

    Hi @nelgin, I made this ugly patch on exec/load/tickit/file_handler.js to fallback copy file if archive format was not detected. Maybe @rswindell can help us to cleanup and write better code.

    It working for my for Hobbynet that delivery HOBBYNET.ZIP (for echolist) and HOBBYNET.??? (unpacket file for nodelist)

    my tickt.ini config for hobbynet:

    ```
    [HNET_NODE]
    Dir=hnet_node
    SourceAddress=954:895/37@hobbynet
    AKAMatching=true
    ForceReplace=true
    Handler=tickit/file_handler.js
    HandlerArg = { "match": "HOBBYNET*", "files": [{ "source": "HOBBYNET.*", "destination": "/sbbs/fido/NODELIST.HOBBYNET" }]}

    [HNET_INFO]
    Dir=hnet_info
    SourceAddress=954:895/37@hobbynet
    AKAMatching=true
    ForceReplace=true
    Handler = tickit/file_handler.js
    HandlerArg = { "match": "HOBBYNET.ZIP", "files": [{ "source": "HOBBYNET.NA", "destination": "/sbbs/fido/ECHOLIST.HOBBYNET" }]}

    ```


    ```diff
    --- file_handler.js.orig 2020-08-26 18:19:00.000000000 -0300
    +++ file_handler.js 2024-02-18 00:56:33.272600403 -0300
    @@ -107,8 +107,7 @@ function Handle_TIC(tic, ctx, arg) {
    f.close();

    if (unpack == undefined) {
    - log(LOG_ERROR, 'Unable to identify packer for ' + tic.file);
    - return false;
    + log(LOG_INFO, 'Unable to identify packer for ' + tic.file);
    }

    // Create a directory to extract to...
    @@ -129,10 +128,28 @@ function Handle_TIC(tic, ctx, arg) {
    }
    }

    - if (!run_and_log(unpack, tic.full_path, dir)) return false;
    + if (unpack == undefined) {
    + log(LOG_DEBUG, "No packer, direct copy file");
    + var sf = tic.full_path;
    + var df = backslash(dir) + tic.file;
    + if (!file_copy(sf , df)) {
    + log(LOG_ERROR, 'Failed to copy no packed file: ' + sf + ' to ' + df);
    + return;
    + }
    + }
    + else {
    + if (!run_and_log(unpack, tic.full_path, dir)) return false;
    + }

    cfg.files.forEach(function (e) {
    - var sf = backslash(dir) + e.source;
    + var sf;
    +
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Sat Feb 17 22:35:22 2024
    https://gitlab.synchro.net/main/sbbs/-/issues/669#note_4870

    Cool. You might want to clone the repo and then commit a change. It's usually going to get looked at faster rather than wait for someone to apply a diff.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)