Menu

#142 batch cmds with consecutive '_' fail WAS: Failure when parsing groupIn following and/or

duply
closed-fixed
nobody
None
5
2025-01-01
2024-12-29
No

When a groupIn follows an "and" or "or" condition, the command string ends up containing two consecutive underscores, e.g.
pre+[purgeincr+purge+bkp]
becomes
pre_and__groupIn_purgeincr_and_purge_and_bkp_groupOut_
The two consecutive underscores are converted into an empty string entry in the CMDS_IN array by the token splitter in line 2567 (r75):
IFS='_' read -ra CMDS_IN <<< "$(tolower "$cmds")"
This in turn ends up in an
Unknown command ''.
error - effectively making it impossible to have a group following an and/or. The effect can also easily be reproduced by manually stating more than one underscore in the command list, e.g. pre___backup___post
This effect started somewhere in January 2024 (Raspberry Pi OS, bookworm) - I have no clue why it worked before.
My shell scripting skills are limited, so the pragmatic solution I use for now is to filter out empty commands in the case selection beginning in line 2574, like so:
case "$cmd" in '') # ignore empty parameter ;;
Would love to see this (or a more elegant solution) upstream - thanks for the great tool anyhow!

Discussion

  • Dominik Sommer

    Dominik Sommer - 2024-12-29

    Just noticed I didn't use the correct formatting for multiline code - here's the patch again:

    case "$cmd" in
        '')
          # ignore empty parameter
        ;;
    
     
  • ede

    ede - 2024-12-30

    nice catch Dominik,

    please try the latest snapshot. this should fix the issue. https://duply.net/tmp/duply.sh

    Thanks! ..ede

     
  • Dominik Sommer

    Dominik Sommer - 2025-01-01

    Thanks @edso! I couldn't test the whole file (since my system version is on 2.4.1 with duplicity at 0.8.22), but applied the changes manually. Elegant solution - works fine!

     
  • ede

    ede - 2025-01-01
    • status: open --> closed-fixed
     
  • ede

    ede - 2025-01-01

    good to hear. will be in the next release. happy new year ..ede

     
  • ede

    ede - 2025-01-01
    • summary: Failure when parsing groupIn following and/or --> batch cmds with consecutive '_' fail WAS: Failure when parsing groupIn following and/or
     
  • ede

    ede - 2025-01-01

    good to hear. will be in the next release. happy new year ..ede

     

Log in to post a comment.