#3046 PR merged: Remove unnecessary curly braces in var expansion

Labels: cleanup, fixed / solved / done

pcahyna opened issue at 2023-09-08 14:16:

Pull Request Details:
  • Type: Cleanup

  • Impact: Low

  • Reference to related issue (URL):

  • How was this pull request tested?
    Backup and recovery on RHEL 9: the log contains

2023-09-07 09:16:51.683209039 Including finalize/GNU/Linux/260_rename_diskbyid.sh
2023-09-07 09:16:51.751526112 Migrating disk-by-id mappings in certain restored files in /mnt/local to current disk-by-id mappings ...

and the recovered system has backup files:

# find /etc -name \*.rearbak
/etc/lvm/devices/system.devices.rearbak
/etc/lvm/lvm.conf.rearbak
/etc/fstab.rearbak

showing that the creation of backups still works.

Inspired by discussion of PR #3043 : https://github.com/rear/rear/pull/3043#discussion_r1314863175

jsmeix commented at 2023-09-08 14:44:

@pcahyna
only by the way FYI:
I think we have very many other code places
with unnecessary curly braces in var expansion
so it is basically hopeless to try to fix them all.
But if one detects them by chance while working on some code
it could make sense to also clean up unnecessary curly braces.

pcahyna commented at 2023-09-08 14:55:

@jsmeix indeed that's what did here: the new code in https://github.com/rear/rear/pull/3043 had this problem copied from finalize/GNU/Linux/260_rename_diskbyid.sh, so now I fixed the source for consistency.


[Export of Github issue for rear/rear.]