mbox series

[bug#54180,00/12] Home: Clarify and better test symlink-manager.scm

Message ID 20220227134006.9860-1-ludo@gnu.org
Headers show
Series Home: Clarify and better test symlink-manager.scm | expand

Message

Ludovic Courtès Feb. 27, 2022, 1:40 p.m. UTC
Hello Guix!

This patch set aims to increase test coverage for ‘guix home reconfigure’,
to make symlink-manager.scm IMO easier to follow, and to have it more
closely follow the project’s conventions.

Functionality is unchanged.

Thoughts?

Thanks,
Ludo’.

Ludovic Courtès (12):
  home: symlink-manager: Clarify module imports.
  home: symlink-manager: Move helper procedures as top-level defines.
  home: symlink-manager: Use 'for-each' when used for effects.
  home: symlink-manager: Use 'file-is-directory?'.
  home: symlink-manager: Remove 'empty-directory?' and avoid TOCTTOU
    race.
  home: symlink-manager: Avoid extra 'lstat' call.
  tests: Make sure 'guix home reconfigure' backs up files.
  tests: Simplify use of 'local-file' in 'tests/guix-home.sh'.
  tests: Check 'guix home reconfigure' for a second generation.
  home: symlink-manager: 'cleanup-symlinks' uses 'file-system-fold'.
  home: symlink-manager: 'create-symlinks' uses 'file-system-fold'.
  home: symlink-manager: Rename "path" to "file" where appropriate.

 gnu/home/services/symlink-manager.scm | 355 ++++++++++++--------------
 tests/guix-home.sh                    |  44 +++-
 2 files changed, 198 insertions(+), 201 deletions(-)


base-commit: 33ce3f1c866231a3015411fdce18a3e72649e2f6

Comments

Andrew Tropin Feb. 28, 2022, 7:53 a.m. UTC | #1
On 2022-02-27 14:40, Ludovic Courtès wrote:

> Hello Guix!
>
> This patch set aims to increase test coverage for ‘guix home reconfigure’,
> to make symlink-manager.scm IMO easier to follow, and to have it more
> closely follow the project’s conventions.
>
> Functionality is unchanged.
>
> Thoughts?

That's great!  symlink-manager was a little messy for sure.

I took a brief look; On first glance patches seems good.  I'll take a
deep look later, when will be updating patch for bug#52808 and will
report or make a separate patch if something pop up.

Thank you very much for working on this :)

>
> Thanks,
> Ludo’.
>
> Ludovic Courtès (12):
>   home: symlink-manager: Clarify module imports.
>   home: symlink-manager: Move helper procedures as top-level defines.
>   home: symlink-manager: Use 'for-each' when used for effects.
>   home: symlink-manager: Use 'file-is-directory?'.
>   home: symlink-manager: Remove 'empty-directory?' and avoid TOCTTOU
>     race.
>   home: symlink-manager: Avoid extra 'lstat' call.
>   tests: Make sure 'guix home reconfigure' backs up files.
>   tests: Simplify use of 'local-file' in 'tests/guix-home.sh'.
>   tests: Check 'guix home reconfigure' for a second generation.
>   home: symlink-manager: 'cleanup-symlinks' uses 'file-system-fold'.
>   home: symlink-manager: 'create-symlinks' uses 'file-system-fold'.
>   home: symlink-manager: Rename "path" to "file" where appropriate.
>
>  gnu/home/services/symlink-manager.scm | 355 ++++++++++++--------------
>  tests/guix-home.sh                    |  44 +++-
>  2 files changed, 198 insertions(+), 201 deletions(-)
>
>
> base-commit: 33ce3f1c866231a3015411fdce18a3e72649e2f6
Ludovic Courtès March 10, 2022, 10:45 a.m. UTC | #2
Hi!

I went ahead and pushed this series:

  2a55f99aff home: symlink-manager: Rename "path" to "file" where appropriate.
  1fb6ef0473 home: symlink-manager: 'create-symlinks' uses 'file-system-fold'.
  5fa188e92e home: symlink-manager: 'cleanup-symlinks' uses 'file-system-fold'.
  5fabaf1128 tests: Check 'guix home reconfigure' for a second generation.
  26e67e0280 tests: Simplify use of 'local-file' in 'tests/guix-home.sh'.
  7b7e32d5ad tests: Make sure 'guix home reconfigure' backs up files.
  a3a76a8384 home: symlink-manager: Avoid extra 'lstat' call.
  a81bb1e4bb home: symlink-manager: Remove 'empty-directory?' and avoid TOCTTOU race.
  e1b38046a6 home: symlink-manager: Use 'file-is-directory?'.
  cf803b71c7 home: symlink-manager: Use 'for-each' when used for effects.
  7a8856f540 home: symlink-manager: Move helper procedures as top-level defines.
  66bf60a4cd home: symlink-manager: Clarify module imports.

Thanks Maxime for taking a look.

Ludo’.