[bug#74258,0/3] Fix uninstall script

Message ID cover.1731055803.git.david_boilleau@gmx.fr
Headers
Series Fix uninstall script |

Message

David Boilleau Nov. 8, 2024, 1:41 p.m. UTC
I installed Guix on Ubuntu 24.04 with the script guix-install.sh, then I
tried to uninstall it by running `guix-install.sh --uninstall`. The
uninstall failed three times:
1. The unit gnu-store.mount was not suppressed, because the prior test
on the gnu-store.mount file failed.
2. The variable ROOT_HOME did not exist, so /root/.guix-profile,
/root/.config/guix and /root/.cache/guix were not suppressed.
3. The "guixbuilder" users were already removed due to the previous
attempts, so the script failed to remove them and exited here. Same when
it tried to remove the service guix-daemon.service.

Here are propositions to fix all of this.

David Boilleau (3):
  guix-install.sh: Test if gnu-store.mount exists before removing the
    unit
  guix-install.sh: Replace `ROOT_HOME` with `~root`
  guix-install.sh: Run the uninstall even if already partially done

 etc/guix-install.sh | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)


base-commit: 673b924ac1e30a5d498e28859af365cf2bb4a508
--
2.43.0
  

Comments

Ludovic Courtès Nov. 14, 2024, 2:41 p.m. UTC | #1
Hi David,

David Boilleau <david_boilleau@gmx.fr> skribis:

> I installed Guix on Ubuntu 24.04 with the script guix-install.sh, then I
> tried to uninstall it by running `guix-install.sh --uninstall`. The
> uninstall failed three times:
> 1. The unit gnu-store.mount was not suppressed, because the prior test
> on the gnu-store.mount file failed.
> 2. The variable ROOT_HOME did not exist, so /root/.guix-profile,
> /root/.config/guix and /root/.cache/guix were not suppressed.
> 3. The "guixbuilder" users were already removed due to the previous
> attempts, so the script failed to remove them and exited here. Same when
> it tried to remove the service guix-daemon.service.
>
> Here are propositions to fix all of this.
>
> David Boilleau (3):
>   guix-install.sh: Test if gnu-store.mount exists before removing the
>     unit
>   guix-install.sh: Replace `ROOT_HOME` with `~root`
>   guix-install.sh: Run the uninstall even if already partially done

This looks good to me.

Applied, thank you for spotting the problems and for fixing them!

Ludo’.