aquaproj/aqua

`aqua list --installed` can output a same configuration file over twice

suzuki-shunsuke opened this issue · 0 comments

aqua info

$ aqua info
{
  "version": "2.25.1",
  "commit_hash": "eda70876eb1041fe258cf6039372d692cf828e04",
  "os": "darwin",
  "arch": "arm64",
  "pwd": "/Users/(USER)/repos/src/github.com/aquaproj/aqua-registry",
  "root_dir": "/Users/(USER)/.local/share/aquaproj-aqua",
  "env": {
    "AQUA_GLOBAL_CONFIG": "/Users/(USER)/repos/src/github.com/suzuki-shunsuke/dotfiles/aqua.yaml:/Users/(USER)/repos/src/github.com/aquaproj/aqua-registry/aqua-all.yaml",
    "AQUA_PROGRESS_BAR": "true"
  },
  "config_files": [
    {
      "path": "/Users/(USER)/repos/src/github.com/aquaproj/aqua-registry/aqua.yaml"
    }
  ]
}

Overview

aqua list --installed can output a same configuration file over twice

How to reproduce

  1. Set up the environment with Docker
docker run --rm -ti debian:bookworm-20231009 bash
apt update
apt install -y curl vim

mkdir ~/workspace
cd ~/workspace
export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"
curl -sSfL -O https://raw.githubusercontent.com/aquaproj/aqua-installer/v3.0.0/aqua-installer
echo "8299de6c19a8ff6b2cc6ac69669cf9e12a96cece385658310aea4f4646a5496d  aqua-installer" | sha256sum -c

chmod +x aqua-installer
./aqua-installer -v v2.25.1

There are several ways to reproduce the issue.

Way 1

  1. Create a directory aqua
mkdir aqua
cd aqua
aqua init
aqua g -i cli/cli
  1. Run aqua list -installed
$ aqua list -installed
cli/cli	v2.46.0	standard
cli/cli	v2.46.0	standard

Way 2

aqua init
aqua g -i cli/cli
$ AQUA_GLOBAL_CONFIG=aqua.yaml aqua list -installed -a
cli/cli	v2.46.0	standard
cli/cli	v2.46.0	standard

Way 3

aqua init
aqua g -i cli/cli
$ AQUA_GLOBAL_CONFIG=aqua.yaml:$PWD/aqua.yaml aqua list -installed -a
cli/cli	v2.46.0	standard
cli/cli	v2.46.0	standard
cli/cli	v2.46.0	standard

Debug output

Expected behaviour

Packages in the same aqua.yaml is outputted only once.

Actual behaviour

Packages in the same aqua.yaml is outputted twice.

Note

https://zenn.dev/link/comments/22a54b3621af70