89luca89 / 89luca89/distrobox

[Error] `distrobox assemble create` fails to override boolean flags from false->true when "include" key specified

Abierto
#1,940 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Go
Estrellas
13k
Forks
541
Merge medio
20 h 47 min
PR fusionados (30 d)
4

Descripción

**Describe the bug**
The "include" keyword has incorrect behavior regarding boolean values.
If `=true` overrides `=false` from the included configuration, it isn't generated in the output.
This doesn't happen if the key is omitted; for instance, if `root` isn't mentioned (default: false), then set `root=true`, there is no issue.

**To Reproduce**
```bash
cat >> bug.ini << EOF
[ubuntu]
image=ubuntu:latest
root=true
nvidia=false
additional_packages="zsh"

[ubuntu-nvidia]
include=ubuntu
root=false
nvidia=true
additional_packages="htop iotop"
EOF
```
then run `distrobox assemble create --dry-run --file bug.ini`. You get an output like this:

```
/usr/bin/distrobox-create --yes --name ubuntu --image ubuntu:latest --root --additional-packages " zsh"
/usr/bin/distrobox-create --yes --name ubuntu-nvidia --image ubuntu:latest --additional-packages " zsh htop iotop"
```

Note the `--root` flag is switched off, but `--nvidia` isn't switch on.

**Expected behavior**

```
/usr/bin/distrobox-create --yes --name ubuntu --image ubuntu:latest --root --additional-packages " zsh"
/usr/bin/distrobox-create --yes --name ubuntu-nvidia --image ubuntu:latest --nvidia --additional-packages " zsh htop iotop"
```

**Desktop (please complete the following information):**

- Are you using podman, docker or lilipod?
`podman`
- Which version or podman, docker or lilipod?
`podman version 5.7.1`
- Which version of distrobox?
distrobox: 1.8.2.2
- Which host distribution?
`ublue-main`
- How did you install distrobox?
Included by default

**Additional context**
Also worth noting the leading space in `--additional-packages` is also probably unintentional.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.