conan-io / conan-io/examples2

cmd_clean command removes wrong packages

Open
#44 3 comments 0 reactions 2 assignees Claimed by @czoido View on GitHub
Dominant language
Python
Stars
125
Forks
64
PR merge metrics
No merged PRs in 30d

Description

The command removes all package revisions except for the latest one from a **recipe**, but not a **package**. This leads to the following: if I build two packages for a single recipe, for example, Debug and Release one, "conan clean" removes one of them (the one that was built the first, I suppose).

I think the correct behaviour would be if this:

```py
all_prevs = conan_api.search.package_revisions(f"{rrev.repr_notime()}:*#*", remote=remote)
# ...
```

is replaced with this:

```py
packages = conan_api.list.packages_configurations(rrev, remote=remote)
for package in packages:
all_prevs = conan_api.search.package_revisions(repr(package), remote=remote)
# ...
```

At least, with such fix the behaviour looks like what I expected, so far.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.