• Bug#1109546: using a regexp as a pattern fails (e.g. backup2l -l ' /.*t

    From Marvin Renich@21:1/5 to All on Sat Jul 19 22:10:01 2025
    This is a multi-part MIME message sent by reportbug.


    Package: backup2l
    Version: 1.7-1
    Severity: normal
    Tags: patch

    The man page for backup2l says grep is used to filter the list of files
    for --get-available, --locate, and --restore. It even suggests
    prepending ' /.*' to the pattern to match only file names. However, the
    script sets shopt -s nullglob, which causes the for loop (on line 930 in
    the current testing version) in get_location to not execute its body,
    which means the $TMP.left file is not created.

    Since this script is bash, rather than /bin/sh, the simple fix is to use
    an array for MASK_LIST. I have attached a patch.

    ...Marvin

    --- trixie/backup2l 2025-07-19 12:47:02.818596906 -0400
    +++ new/backup2l 2025-07-19 13:19:46.634044974 -0400
    @@ -921,13 +921,13 @@
    fi
    shift

    - MASK_LIST="$@"
    - if [ "$MASK_LIST" = "" ]; then
    - MASK_LIST="/"
    + MASK_LIST=("$@")
    + if [ "${MASK_LIST[*]}" = "" ]; then
    + MASK_LIST=("/")
    fi

    # determine active files...
    - for MASK in $MASK_LIST; do
    + for MASK in "${MASK_LIST[@]}"; do
    gunzip -c $VOLNAME.$BID.list.gz | grep -a "$MASK" | tee $TMP.found | grep -a '/$' >> $TMP.dirs
    # dirs go to $TMP.dirs WITH attributes
    grep -av '/$' $TMP.found | eval "$FILTER_NAME" >> $TMP.left

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)